Reputation: 2089
I'd like to use an Azure devops pipeline for building ios bundle that contains both an iphone app and a watchos app.
There is a workspace that contains the 3 apps (one for the phone and two for the watch)
MyWorkspace:
I use the following XCode task
- task: Xcode@5
inputs:
actions: 'build'
scheme: 'MyApp'
sdk: 'iphoneos'
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
This task launches xcodebuild
xcodebuild -sdk iphoneos -configuration Release -workspace /Users/runner/work/1/s/MyApp/MyWorkspace.xcworkspace -scheme MyApp build
and it fails with the following errors:
error: unable to resolve product type 'com.apple.product-type.application.watchapp2' for platform 'iphoneos' (in target 'MyWatchApp' from project 'MyApp')
error: unable to resolve product type 'com.apple.product-type.watchkit2-extension' for platform 'iphoneos' (in target 'MyWatchApp Extension' from project 'MyApp')
What kind of SDK do I need to specify to build it?
Upvotes: 1
Views: 1934
Reputation: 501
To generate Ad-Hoc build on DevOps, create following tasks
npm install
npm install -g react-native-cli
npm i @react-native-community/[email protected]
Apple developer certificate
Provisioning profiles
Signing certificate development/ distribution certificates
xcodebuild clean -workspace Project.xcworkspace -scheme ProjectScheme
xcodebuild build -workspace Project.xcworkspace -scheme ProjectScheme -destination generic/platform=iOS -destination "platform=iOS Simulator,name=iPhone 13 Pro Max" -allowProvisioningUpdates
xcodebuild archive -workspace Project.xcworkspace -scheme Project -archivePath D:/path_to_save_build/terminalBuild.xcarchive
xcodebuild -exportArchive -archivePath D:/path_to_save_build/terminalBuild.xcarchive -exportPath ../../iOSbuilds -exportOptionsPlist ExportOptionAdhocSigning.plist
Upvotes: 0
Reputation: 2089
The command that I'd like to run using azure pipeline xcode task is the following:
xcodebuild -configuration Release -workspace /Users/runner/work/1/s/MyApp/MyWorkspace.xcworkspace -scheme MyApp build
Without the sdk specification
-sdk iphoneos
In this way the build of each component will follow the project default and the phone app will be built using iphoneos SDK and watch app will be built using watchos SDK.
Unfortunately if I remove the sdk specification from the xcode task
- task: Xcode@5
inputs:
actions: 'build'
scheme: 'MyApp'
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
then it uses its own default
-sdk $(SDK)
and it causes an error because the $(SDK) is not defined.
The right (but pretty odd) syntax for this use case is
- task: Xcode@5
inputs:
actions: 'build'
scheme: 'MyApp'
sdk:
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
leaving the sdk specification empty without any value.
Upvotes: 1