project.json:

1{ 2 "name": "mobile", 3 //... 4 "targets": { 5 //... 6 "start": { 7 "executor": "@nx/expo:start", 8 "options": { 9 "port": 8081 10 } 11 } 12 //... 13 } 14} 15
Nx 15 and lower use @nrwl/ instead of @nx/

nx run mobile:start

Examples

The ios, android and web option allows you to start the server on different platforms.

Opens your app in Expo Go in a currently running iOS simulator on your computer:

1 "start": { 2 "executor": "@nx/expo:start", 3 "options": { 4 "port": 8081, 5 "ios": true 6 } 7 } 8
Nx 15 and lower use @nrwl/ instead of @nx/

or run command nx start <your app name> --ios.

Opens your app in Expo Go on a connected Android device

1 "start": { 2 "executor": "@nx/expo:start", 3 "options": { 4 "port": 8081, 5 "android": true 6 } 7 } 8
Nx 15 and lower use @nrwl/ instead of @nx/

or run command nx start <your app name> --android.

Opens your app in a web browser:

1 "start": { 2 "executor": "@nx/expo:start", 3 "options": { 4 "port": 8081, 5 "web": true 6 } 7 } 8
Nx 15 and lower use @nrwl/ instead of @nx/

or run command nx start <your app name> --web.


Options

android

a
boolean

Opens your app in Expo Go on a connected Android device

clear

c
boolean

Clear the Metro bundler cache

dev

boolean

Turn development mode on or off

devClient

boolean

Experimental: Starts the bundler for use with the expo-development-client

forceManifestType

string
Accepted values: expo-updates, classic

Override auto detection of manifest type.

https

boolean

To start webpack with https or http protocol

host

string
Accepted values: localhost, lan, tunnel

lan (default), tunnel, localhost. Type of host to use. lan uses the local network; tunnel ues any network by tunnel through ngrok; localhost connects to the dev server over localhost.

ios

i
boolean

Opens your app in Expo Go in a currently running iOS simulator on your computer

lan

boolean

Same as --host lan

localhost

boolean

Same as --host localhost

maxWorkers

number

Maximum number of tasks to allow Metro to spawn

minify

boolean

Whether or not to minify code

offline

boolean

Allows this command to run while offline

privateKeyPath

string

Path to private key for code signing. Default: 'private-key.pem' in the same directory as the certificate specified by the expo-updates configuration in app.json.

port

p
number
Default: 19000

Port to start the native Metro bundler on (does not apply to web or tunnel)

scheme

string

Custom URI protocol to use with a development build

tunnel

boolean

Same as --host tunnel

web

w
boolean

Opens your app in a web browser