Issue
I am trying to build Using Xcode task of React Native Ios App. Earlier I was using Scheme and it was working fine but developers changed the approach and started using target where they are mentioning APP name (Apps are multiple and using same code base with slightly different UI).
I am not able to build my code with target and on google most of the blogs are only related to scheme. Help me to figure it out how can i run my application.
Right now I am using the below:-
- task: Xcode@5
inputs:
actions: 'build'
scheme: 'MyApp'
sdk: 'iphoneos'
configuration: 'Release'
xcWorkspacePath: '$(system.defaultworkingdirectory)/MyWorkspace.xcworkspace'
xcodeVersion: '12'
Solution
Based on your requirement, you need to use target
in the Xcode and define the .xcconfig file.
Refer to this doc: xcode task
xcWorkspacePath - Workspace or project path string. Default value: **/*.xcodeproj/project.xcworkspace.
Optional. Specifies a relative path from the root of the repository to the Xcode workspace or project. If you specify a value, you must also specify the scheme. Do not specify a value if you are specifying -target flag in Advanced Arguments. For example, MyApp/MyApp.xcworkspace or MyApp/MyApp.xcodeproj.
If you need to use the -target
in the Xcode task, you don't need to define the xcWorkspacePath.
To meet your requirement, you can add the -target
and -xcconfig
flag in the args
field.
For example:
- task: Xcode@5
inputs:
actions: 'build'
sdk: 'iphoneos'
configuration: 'Release'
xcodeVersion: '12'
args: '-target <your_target_name> -xcconfig filepath/<your_configuration_file>.xcconfig'
workingDirectory: 'Define the Working Directory'
If the xcconfig file is not in the repo, you can save it in the secure file in Azure Pipelines -> Library -> Secure file
You can add the task DownloadSecureFile@1
to download it and then use it in the Xcode task.
Answered By - Kevin Lu-MSFT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.