# run-ios

## Description

* Runs a MiniApp on an iOS emulator or connected device &#x20;

## Syntax

`ern run-ios`

**Options**

`--baseComposite <compositePath>`

* Git or File System path, to the custom Composite repository (refer to the \[custom  Composite] documentation for more information).

`--descriptor, -d`

* complete native application descriptor

`--dev [true|false]`

* Enable or disable React Native dev support

`--host`

* Host or ip to launch the local packager on.
* By default it will use the IP address that is returned by the `ipconfig getifaddr en0` command, and fallback to `localhost` in the case the command fails.

  `--launchArgs`
* Arguments to pass to the application when launching it (correspond to the `Arguments Passed On Launch` in application scheme run config in XCode as can be seen on screenshot below).
* Make sure to use `=` on the command line to provide this option, and keep the string in quotes. For example `--launchArgs="-ArgA -ArgB"`

`--launchEnvVars`

* Environment variables to pass to the application when launching it (correspond to the `Environment Variables` in application scheme run config in XCode as can be seen on screenshot below).
* Make sure to use `=` on the command line to provide this option, and keep the string in quotes. The string should contain `key=value` pairs delimited by spaces. For example `--launchEnvVars="aKey=aValue anotherKey=anotherValue"`

![xcode scheme run](https://1951893996-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LF_waG_U-NeI1vhIUwJ%2F-LqnIijeK72sOcRgCDmf%2F-LqnImIp5JVofvzLQKC5%2Fxcode-scheme-run.png?generation=1570671373653853\&alt=media)

`--mainMiniAppName`

* Name of the MiniApp to launch when starting the Runner application

`--miniapps/m`

* One or more MiniApps to combine in the Runner Container

`--port`

* Port on which the local packager should listen on *(default: 8081)*

`--usePreviousDevice/-u`

* Use the previously selected device to avoid prompt

## Remarks

* You can launch the MiniApp located in the current working directory or on a connected iOS device or running emulator if available. If a connected iOS device is not available, the command prompts you to select an emulator to launch from the list of installed emulator images. &#x20;
* The first time you run this command from within a MiniApp directory, it generates an iOS directory containing the iOS Runner application project. If the iOS folder already exists (it is not the first run of the `ern run-ios` command for this MiniApp), the existing runner project is used. &#x20;
* After the runner project is generated, you can safely make native code modifications to it, knowing that the next time the `ern run-ios` command is issued, the project and your changes will remain. &#x20;
* If you want to regenerate the runner project from scratch, remove the iOS directory. &#x20;
* The miniapp can be any Yarn package descriptor, including Git or other file system path schemes. &#x20;
* The `ern run-ios` command is the `ern` equivalent of the `react-native run-ios` command.

\[custom Composite]: ./platform-parts/composite/index.md
