NPa*_*utt 7 xamarin.ios azure-devops
我在Azure Devops上有一个用Xamarin编写的应用程序和一个buildpipline。当我以IOS 11.x为目标时,这可以很好地构建。但是我想更新到SDK 12,因为Apple从2019年3月开始强制执行此操作:
SDK版本问题-此应用是使用iOS 11.4 SDK构建的。从2019年3月开始,提交给App Store的所有iOS应用程序必须使用Xcode 10.1或更高版本中包含的iOS 12.1 SDK或更高版本构建。
但是在生成时,我总是在Azure Devops管道中收到此错误:
MTOUCH : error MT0074: Xamarin.iOS 11.14.0 does not support a deployment target of 12.0 for iOS (the maximum is 11.4). Please select an older deployment target in your project's Info.plist or upgrade to a newer version of Xamarin.iOS.
Run Code Online (Sandbox Code Playgroud)
根据本文,我尝试使用以下脚本设置SDK版本:
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0"
Run Code Online (Sandbox Code Playgroud)
不幸的是,它仍然使用11 SDK而不是12。我选择了错误的Mono版本还是选择Xamarin.IOS SDK的方法错误?
我为IOS工作完成的构建YAML:
queue:
name: Hosted macOS
demands:
- xcode
- Xamarin.iOS
steps:
- bash: |
echo "Select Xamarin Version"
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0"
displayName: 'Select Xamarin Version'
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: '6f1c094d-c147-41e0-9bc6-c9fe9a40b2e6'
certPwd: '$(P12password)'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'a883a983-6027-4382-afd4-94b52736323c'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet'
inputs:
versionSpec: 4.x
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: XamariniOS@2
displayName: 'Build Xamarin.iOS '
inputs:
solutionFile: Src/MoneyFox.Ios/MoneyFox.iOS.csproj
configuration: '$(BuildConfiguration)'
Run Code Online (Sandbox Code Playgroud)
您现在应该可以根据本文档选择正确的Mono和Xcode版本。在构建和发布管道中的Azure DevOps中(分别在Xamarin.iOS构建任务和发布任务之前),我添加了一个运行以下命令的命令行任务:
echo 'Updating fastlane...'
sudo gem install fastlane
echo 'Selecting Mono version...'
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_16_0"
echo 'Selecting Xcode version...'
/bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_10.1.app;sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1139 次 |
| 最近记录: |