packages/react-native/docs/build-ios-examples.md
project.json:
{
"name": "mobile",
//...
"targets": {
//...
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {}
}
}
}
nx run mobile:build-ios
The buildFolder option allows to specify the location for ios build artifacts. It corresponds to Xcode's -derivedDataPath.
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {
"buildFolder": "dist/ios/build"
}
}
nx build-ios <app-name> --buildFolder=dist/ios/build
The mode option allows to specify the xcode configuartion, such as Debug or Release.
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {
"mode": "Release"
}
}
nx build-ios <app-name> --mode=Debug
nx build-ios <app-name> --mode=Release
The simulator option allows you to launch your iOS app in a specific simulator:
To see all the available simulators, run command:
xcrun simctl list devices available
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {
"simulator": "iPhone 14 Pro"
}
}
nx build-ios <app-name> --simulator="iPhone 14 Pro"
The device option allows you to launch your iOS app in a specific device.
To see all the available device, run command:
xcrun simctl list devices available
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {
"device": "deviceName"
}
}
nx build-ios <app-name> --device="deviceName"
The udid option allows you to explicitly set device to use by udid.
To see all the available simulators and devices with udid, run command:
xcrun simctl list devices available
"build-ios": {
"executor": "@nx/react-native:build-ios",
"options": {
"udid": "device udid"
}
}
nx build-ios <app-name> --udid="device udid"