L&D series: Build iOS simulator .app via CLI
Learning and Development chapter 20.
- Install Xcode.
- Enter iOS developer repository.
- Run these command:
$ gem install bundler
$ bundle
$ pod install
To build iOS .app we could use this syntax.
$ xcodebuild -workspace <xcode workspace>.xcworkspace -scheme <xcode scheme name> -sdk iphonesimulator
.
Note: If there are any error, please consult with your iOS developer because each iOS repo might have any different way to setup.
Where is .xcworkspace file?
By default, we can find the file in the root folder of our repository. Also we can find .xcodeproj file in the same path.
Where is scheme name?
- Open Xcode.
- Open .xcworkspace file.
- Click
Product
menu.
- Choose
Scheme
menu.
Where is the generated result of .app file?
We can find the .app file in ~/Library/Developer/Xcode/DerivedData/{app name}/Build/Products/Debug-iphonesimulator/Deployment/{app name}.app
. Move the .app file to anywhere you want for your automation purpose.
FYI, if you want to build .app in iOS real device, you could use this syntax:
$ xcodebuild -workspace <xcode workspace>.xcworkspace -scheme <xcode scheme name> -sdk iphoneos -allowProvisioningUpdates CODE_SIGN_STYLE="Automatic" CODE_SIGN_IDENTITY="Apple Development" PROVISIONING_PROFILE_SPECIFIER="" DEVELOPMENT_TEAM="<team dev ID>"
. — MperMperPisang
References: