Closed thefex closed 7 months ago
Hello! VS for Mac is going to be completely retired by August 31 2024, see here, we are also aware that Xamarin components will be retired next April, so it was decided that neither Xamarin nor VSMAC will be pre-installed in the runner starting with macOS 13.
Can you at least give guide how to install vs for mac as buildstep?
Hello! VS for Mac is going to be completely retired by August 31 2024, see here, we are also aware that Xamarin components will be retired next April, so it was decided that neither Xamarin nor VSMAC will be pre-installed in the runner starting with macOS 13.
Xamarin has been updated to support Xcode 15 and is a fallback position if developers have not successfully migrated from Xamarin to .NET MAUI by 1st May 2024. To build for Xcode 15 we will need macOS-13 updated with Xamarin symlinks.
We are your paying customers, please listen to us. I pay for a single pipeline for my hobby projects, the company I work for pays for 20 concurrent build hosts.
@mikhailkoliada any comments on the above pls? Is there a way of manually installing the components by script at least?
@JohnHDev See https://github.com/actions/runner-images/issues/8320#issuecomment-1736578220
I have used boots to install the latest Xamarion.iOS version on a Mac OS 13 image (in an Azure DevOps runner):
- script: |
dotnet tool install --global boots
boots https://download.visualstudio.microsoft.com/download/pr/de7f727f-243c-4429-8773-eebd735eb1bb/da4a65f27ace7f805914ef63661e0efd/xamarin.ios-16.4.0.18.pkg
displayName: Install Xamarin.iOS
@JohnHDev as far as I am aware Xamarin components (iOS, android, Mac) are still available in home-brew so you can install them by something like brew install --cask xamarin-ios
As of VS for Mac, as it requires the machine reboot, it does not looks possible to install it in runtime.
VS for mac is not necessary, xamarin ios and android should be sufficient
For anyone interested in building C# 10 apps with the Visual Studio provided MSBuild, I've implemented a workaround in my project which extracts the MonoBundle from VS for Mac installer and then uses it to build the app: https://github.com/Vulcanova/Vulcanova/blob/main/.github/workflows/ios.yml#L21
- name: Download Visual Studio for Mac
run: curl https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/91eb158e928097dcb6e42ece2db7ebac/visualstudioformac-17.6.7.417-arm64.dmg -o /tmp/vsformac.dmg
- name: Mount Visual Studio for Mac dmg
run: hdiutil attach /tmp/vsformac.dmg
- name: Extract MSBuild
run: cp -R /Volumes/Visual\ Studio/Visual\ Studio.app/Contents/MonoBundle/MSBuild/Current/bin /tmp/msbuild
then, to build the app:
- name: Build
run: mono '/tmp/msbuild/MSBuild.dll' <your_csproj>
For anyone interested in building C# 10 apps with the Visual Studio provided MSBuild, I've implemented a workaround in my project which extracts the MonoBundle from VS for Mac installer and then uses it to build the app: https://github.com/Vulcanova/Vulcanova/blob/main/.github/workflows/ios.yml#L21
- name: Download Visual Studio for Mac run: curl https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/91eb158e928097dcb6e42ece2db7ebac/visualstudioformac-17.6.7.417-arm64.dmg -o /tmp/vsformac.dmg - name: Mount Visual Studio for Mac dmg run: hdiutil attach /tmp/vsformac.dmg - name: Extract MSBuild run: cp -R /Volumes/Visual\ Studio/Visual\ Studio.app/Contents/MonoBundle/MSBuild/Current/bin /tmp/msbuild
then, to build the app:
- name: Build run: mono '/tmp/msbuild/MSBuild.dll' <your_csproj>
Where did you get the dl link I would like to update it ?
I believe I set up a proxy to monitor the installer’s network traffic.On 25 Mar 2024, at 15:34, ZeBen @.***> wrote:
For anyone interested in building C# 10 apps with the Visual Studio provided MSBuild, I've implemented a workaround in my project which extracts the MonoBundle from VS for Mac installer and then uses it to build the app: https://github.com/Vulcanova/Vulcanova/blob/main/.github/workflows/ios.yml#L21
name: Download Visual Studio for Mac run: curl https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/91eb158e928097dcb6e42ece2db7ebac/visualstudioformac-17.6.7.417-arm64.dmg -o /tmp/vsformac.dmg
name: Mount Visual Studio for Mac dmg run: hdiutil attach /tmp/vsformac.dmg
name: Extract MSBuild run: cp -R /Volumes/Visual\ Studio/Visual\ Studio.app/Contents/MonoBundle/MSBuild/Current/bin /tmp/msbuild then, to build the app:
name: Build
run: mono '/tmp/msbuild/MSBuild.dll'
Where did you get the dl link I would like to update it ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
@v0idzz I fixed your version, as this issue will never be resolved. The path you used is incorrect.
This is what has worked for me.
So the whole idea is to use the macos13 image in order to get xcode 15 and get rid of the appstore warning.
(The "latest" image is macos12 with xcode 14 only).
The macos13 image does not have VS Mac pre-installed. And does not contain any xamarin sdk.
So we install the xamarin sdk via boots.
But that is insufficient. We also need msbuild from VsMac. That is because msbuild from mono is too old and don't understand xcode 15.
pool:
vmImage: 'macos-13'
- task: Bash@3
displayName: Install VS Mac 2022 MsBuild
inputs:
targetType: 'inline'
failOnStderr: true
script: |
echo "downloading"
curl -L "https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/91eb158e928097dcb6e42ece2db7ebac/visualstudioformac-17.6.7.417-arm64.dmg" -o "/tmp/vsformac.dmg" 2>/dev/null
echo "attaching"
hdiutil attach "/tmp/vsformac.dmg" -noverify 2>/dev/null
echo "copying"
mkdir "/tmp/msbuild"
cp -R "/Volumes/Visual Studio/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin" "/tmp/msbuild"
ls -alF "/tmp/msbuild/bin"
echo "done"
- task: Bash@3
displayName: Install Xamarin.iOS
inputs:
targetType: 'inline'
failOnStderr: true
script: |
dotnet tool install --global boots
boots --stable Xamarin.Android
boots --stable Xamarin.iOS
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'Store.p12'
certPwd: '$(CERT_PASSWORD)'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@1
displayName: 'InstallAppleProvisioningProfile'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/release/pro/store')
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'AppStore.mobileprovision'
- task: NuGetToolInstaller@1
inputs:
versionSpec: ">=6.7.0"
- task: NuGetCommand@2
inputs:
restoreSolution: '$(Build.SourcesDirectory)/YourSolution.sln'
feedsToUse: config
- task: Bash@3
displayName: 'Build iOS IPA'
inputs:
targetType: 'inline'
failOnStderr: true
script: |
signIdentityEscaped=$(echo "$APPLE_CERTIFICATE_SIGNING_IDENTITY" | sed 's/,/%2C/g')
cmd='
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
"/tmp/msbuild/bin/MSBuild.dll"
"'"$(Build.SourcesDirectory)"'/YourSolution.sln"
/t:Build
/p:Configuration=Release
/p:Platform=iPhone
/p:buildForSimulator=false
/p:BuildIpa=true
/p:Codesignkey="'"$signIdentityEscaped"'"
/p:CodesignProvision='"$APPLE_PROV_PROFILE_UUID"'
'
echo $cmd
eval $cmd
- task: AppCenterDistribute@3
displayName: 'Post IPA and Symbols to appcenter distribute'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/release/pro/store')
inputs:
serverEndpoint: 'Your AppCenter Endpoint See Task Doc'
destinationType: 'store'
destinationStoreId: '$(APPCENTER_STOREID)'
appSlug: 'YourCompany/$(APPCENTER_SLUG)'
app: 'YourApp/YourApp.iOS/bin/iPhone/Release/YourAPpiOS.ipa'
symbolsType: Apple
dsymPath: 'YourApp/WYourApp.iOS/bin/iPhone/Release/YourAppiOS.app.dSYM'
releaseNotesSelection: 'input'
releaseNotesInput: 'Updates to our mobile app'
@softlion It's strange that it didn't work for you because I've been using this pipeline in my projects without any issue. Last time it ran was 5 days ago https://github.com/Vulcanova/Vulcanova/actions/runs/8379671635/job/22947155813
@v0idzz does it work fine? I have an issues with the Roslyn references in my projects, when I'm trying to build Xamarin.Forms application for iOS
@JohnHDev as far as I am aware Xamarin components (iOS, android, Mac) are still available in home-brew so you can install them by something like
brew install --cask xamarin-ios
As of VS for Mac, as it requires the machine reboot, it does not looks possible to install it in runtime.
This is the most easiest way how to fix your current pipeline⬆️
My setup is like:
vmImage
from macOS-latest
to at least macOS-13
- script: |
brew install --cask xamarin-ios
XamariniOS@2
task to build your Xamarin projectJust to note, these are needed to build Xamarin projects with latest iPhone SDK in order to be able to push them into Apple Store. With macOS-latest
you will compile against old SDK which leads to rejection at IPA package upload to the store.
@v0idzz I fixed your version, as this issue will never be resolved. The path you used is incorrect. This is what has worked for me.
So the whole idea is to use the macos13 image in order to get xcode 15 and get rid of the appstore warning. (The "latest" image is macos12 with xcode 14 only).
The macos13 image does not have VS Mac pre-installed. And does not contain any xamarin sdk. So we install the xamarin sdk via boots.
But that is insufficient. We also need msbuild from VsMac. That is because msbuild from mono is too old and don't understand xcode 15.
pool: vmImage: 'macos-13' - task: Bash@3 displayName: Install VS Mac 2022 MsBuild inputs: targetType: 'inline' failOnStderr: true script: | echo "downloading" curl -L "https://download.visualstudio.microsoft.com/download/pr/ceb0ea3f-4db8-46b4-8dc3-8049d27c0107/91eb158e928097dcb6e42ece2db7ebac/visualstudioformac-17.6.7.417-arm64.dmg" -o "/tmp/vsformac.dmg" 2>/dev/null echo "attaching" hdiutil attach "/tmp/vsformac.dmg" -noverify 2>/dev/null echo "copying" mkdir "/tmp/msbuild" cp -R "/Volumes/Visual Studio/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin" "/tmp/msbuild" ls -alF "/tmp/msbuild/bin" echo "done" - task: Bash@3 displayName: Install Xamarin.iOS inputs: targetType: 'inline' failOnStderr: true script: | dotnet tool install --global boots boots --stable Xamarin.Android boots --stable Xamarin.iOS - task: InstallAppleCertificate@2 inputs: certSecureFile: 'Store.p12' certPwd: '$(CERT_PASSWORD)' keychain: 'temp' - task: InstallAppleProvisioningProfile@1 displayName: 'InstallAppleProvisioningProfile' condition: eq(variables['Build.SourceBranch'], 'refs/heads/release/pro/store') inputs: provisioningProfileLocation: 'secureFiles' provProfileSecureFile: 'AppStore.mobileprovision' - task: NuGetToolInstaller@1 inputs: versionSpec: ">=6.7.0" - task: NuGetCommand@2 inputs: restoreSolution: '$(Build.SourcesDirectory)/YourSolution.sln' feedsToUse: config - task: Bash@3 displayName: 'Build iOS IPA' inputs: targetType: 'inline' failOnStderr: true script: | signIdentityEscaped=$(echo "$APPLE_CERTIFICATE_SIGNING_IDENTITY" | sed 's/,/%2C/g') cmd=' /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono "/tmp/msbuild/bin/MSBuild.dll" "'"$(Build.SourcesDirectory)"'/YourSolution.sln" /t:Build /p:Configuration=Release /p:Platform=iPhone /p:buildForSimulator=false /p:BuildIpa=true /p:Codesignkey="'"$signIdentityEscaped"'" /p:CodesignProvision='"$APPLE_PROV_PROFILE_UUID"' ' echo $cmd eval $cmd - task: AppCenterDistribute@3 displayName: 'Post IPA and Symbols to appcenter distribute' condition: eq(variables['Build.SourceBranch'], 'refs/heads/release/pro/store') inputs: serverEndpoint: 'Your AppCenter Endpoint See Task Doc' destinationType: 'store' destinationStoreId: '$(APPCENTER_STOREID)' appSlug: 'YourCompany/$(APPCENTER_SLUG)' app: 'YourApp/YourApp.iOS/bin/iPhone/Release/YourAPpiOS.ipa' symbolsType: Apple dsymPath: 'YourApp/WYourApp.iOS/bin/iPhone/Release/YourAppiOS.app.dSYM' releaseNotesSelection: 'input' releaseNotesInput: 'Updates to our mobile app'
Thank you. For me, I have to update the Install Xamarin.iOS with below
- script: | brew install --cask xamarin-ios
Tried all above suggestions, not working for my projects due to my project has more complicated references (Roslyn references). It's not able to restore the sub project
Tried all above suggestions, not working for my projects due to my project has more complicated references (Roslyn references). It's not able to restore the sub project
Time to switch to maui.
Xamarin github's repository is archived. Noone can even contribute to it. And noone will publish any nuget for it anymore.
Visual Studio Mac is also stopped, and all download links will be retired the 1st of June.
So it won't be possible to install it anymore, even from Azure Pipeline.
In a few months (September), when the next iOS and the next Android are launched, you won't be able to publish a Xamarin app for those anyway.
Tried all above suggestions, not working for my projects due to my project has more complicated references (Roslyn references). It's not able to restore the sub project
Time to switch to maui. Xamarin github's repository is archived. Noone can even contribute to it. And noone will publish any nuget for it anymore. Visual Studio Mac is also stopped, and all download links will be retired the 1st of June. So it won't be possible to install it anymore, even from Azure Pipeline.
In a few months (September), when the next iOS and the next Android are launched, you won't be able to publish a Xamarin app for those anyway.
Tried to move to MAUI but failed due to many issues.
So ... no thanks, we would rather stick with this for awhile, release a final version (do it manually for now) and decide if we should migrate to MAUI or switch to another framework instead of migrating to the buggy state of MAUI at the moment
When next iOS or next Android is launched, we still have couples month ,so at least it should be April next year
Not sure what you are doing, but:
Tool name
Visual studio for Mac
Tool license
https://visualstudio.microsoft.com/license-terms/visual-studio-mac-eula/
Add or update?
Desired version
Latest stable channel
Approximate size
No response
Brief description of tool
Github mac13 runners miss Visual studio for mac which prevents building Xamarin.iOS/Android apps that are still supported till April of next year.
URL for tool's homepage
No response
Provide a basic test case to validate the tool's functionality.
No response
Platforms where you need the tool
Runner images where you need the tool
Can this tool be installed during the build?
Tool installation time in runtime
No response
Are you willing to submit a PR?
No response