nx/packages/react-native/docs/run-ios-examples.md
Isaac Mann afa5eb59fa
docs(core): document the @nrwl => @nx rescope (#16403)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2023-04-27 18:14:59 -04:00

1.9 KiB

project.json:

{
  "name": "mobile",
  //...
  "targets": {
    //...
    "run-ios": {
      "executor": "@nx/react-native:run-ios",
      "options": {}
    }
  }
}
nx run mobile:run-ios

Examples

{% tabs %} {% tab label="Build the Debug/Release app" %} The mode option allows to specify the xcode configuartion schema, such as Debug or Release.

    "run-ios": {
      "executor": "@nx/react-native:run-ios",
      "options": {
        "mode": "Release"
      }
    }
nx run-ios <app-name> --mode=Debug

{% /tab %} {% tab label="Run on a simulator" %} 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
    "run-ios": {
      "executor": "@nx/react-native:run-ios",
      "options": {
        "simulator": "iPhone 14 Pro (16.2)"
      }
    }
nx run-ios <app-name> --simulator="iPhone 14 Pro (16.2)"

{% /tab %} {% tab label="Run on a device" %} The device option allows you to launch your iOS app in a specific device.

To see all the available devices, run command:

xcrun simctl list devices available
    "run-ios": {
      "executor": "@nx/react-native:run-ios",
      "options": {
        "device": "deviceName"
      }
    }
nx run-ios <app-name> --device="deviceName"

{% /tab %} {% tab label="Set Device by udid" %} 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
    "run-ios": {
      "executor": "@nx/react-native:run-ios",
      "options": {
        "udid": "device udid"
      }
    }
nx run-ios <app-name> --udid="device udid"

{% /tab %} {% /tabs %}