The run command allows you to compile your app locally.

project.json:

1{ 2 "name": "mobile", 3 //... 4 "targets": { 5 //... 6 "run-ios": { 7 "executor": "@nx/expo:run", 8 "options": { 9 "platform": "ios" 10 } 11 }, 12 "run-android": { 13 "executor": "@nx/expo:run", 14 "options": { 15 "platform": "android" 16 } 17 } 18 //... 19 } 20} 21

nx run mobile:run-ios

nx run mobile:run-android

Examples

The variant option allows you to specify the compile Android app with variants defined in build.gradle file (e.g. debug, release).

1 "run-android": { 2 "executor": "@nx/expo:run", 3 "options": { 4 "platform": "android", 5 "variant": "release" 6 } 7 } 8

Options

platform

pRequired
string
Default: ios
Accepted values: ios, android

Platform to run for (ios, android).

variant

string
Default: debug

(Android) Specify your app's build variant (e.g. debug, release).

xcodeConfiguration

string
Default: Debug

(iOS) Xcode configuration to use. Debug or Release

bundler

boolean

Whether to skip starting the Metro bundler. True to start it, false to skip it.

buildCache

boolean

Should use derived data for builds.

clean

boolean
Default: false

Delete the native folders and regenerate them before applying changes

device

d
string

Device name or UDID to build the app on. The value is not required if you have a single device connected.

install

boolean
Default: true

Installing npm packages and CocoaPods before building.

port

p
number
Default: 8081

Port to start the Metro bundler on

scheme

string

(iOS) Explicitly set the Xcode scheme to use