iOS
To build an app with Xcode command line tools xcrun xcodebuild should be used. Here is an example on how to build Food Truck app for iOS simulator target:
xcrun xcodebuild -scheme 'Food Truck' \
-project 'Food Truck.xcodeproj' \
-configuration Debug \
-sdk 'iphonesimulator' \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath \
build
The .app file can be then found under /build folder, which can be modified via the last parameter of the script.
xcodebuild(
configuration: build_config[:configuration],
scheme: build_config[:scheme],
workspace: build_config[:xcode_workspace],
xcargs: "-quiet -sdk 'iphonesimulator' -destination 'generic/platform=iOS Simulator'",
derivedDataPath: IOS_DERIVED_DATA_PATH # this will contain the .app which we need later on
)