For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/native-apps/devices.md.

Run on simulators and phones

--run installs your app on a virtual or real phone and opens it. This page covers each kind of device, then ng serve --platform, which updates the app as you edit.

Run on the iOS Simulator

ng build --platform ios --run:

  1. Picks a simulator: the one that's running, or else the newest iPhone. With --device, the simulator with that name or UDID. Xcode lists the simulators in DeviceHub, and xcrun simctl list devices prints them.
  2. Starts it while the app builds, and shows its screen in a window: DeviceHub's on Xcode 27.1 and later, the Simulator app's on earlier versions.
  3. Installs the app and opens it, closing the copy a previous run left open.

The simulator keeps running after the build, while DeviceHub is open. Quitting DeviceHub shuts it down when DeviceHub's Stop simulators on quit setting is on. The next --run starts it again.

Without --run

  1. Start a simulator. On Xcode 27.1 and later, open DeviceHub (open -a DeviceHub), which lists the simulators, and click Start next to an iPhone. Earlier versions have the Simulator app instead (open -a Simulator), which starts one by itself.

  2. Install the app and open it:

    xcrun simctl install booted dist/ios/MyApp-simulator.app
    xcrun simctl launch booted com.example.myapp

    booted means the simulator that's running. Pass your appId to launch, or tap the app's icon instead.

Run on a real iPhone

Some things only show on a real phone: its speed, the camera, haptics and the real Liquid Glass. --run installs the app on your own iPhone when --device names it, without the App Store or TestFlight:

ng build --platform ios --run --device "Jane's iPhone"
  • --device takes the phone's name, as xcrun devicectl list devices prints it, or its UDID. A straight apostrophe matches the curly one iOS puts in the name.
  • Without --device, --run always picks a simulator, even with a phone plugged in.

Set up the iPhone once

iOS only runs signed apps, so the build signs this one for your phone.

  1. Sign in to Xcode with your Apple ID: Xcode → Settings → Accounts. A free Apple ID works. It gives a Personal Team, whose apps stop opening after 7 days: build again to renew one. The paid Apple Developer Program's team keeps them working for a year.

  2. Set your team in angular.json, next to the app identity:

    angular.json
    "ios": { "teamId": "ABCDE12345" }

    Don't know your team ID? Build without it: the error lists the teams this Mac can sign for.

  3. Pair the phone: connect it with a USB cable, unlock it and tap Trust. After that it also works over Wi-Fi.

  4. Turn on Developer Mode on the phone: Settings → Privacy & Security → Developer Mode. The phone restarts. The setting shows up once the phone has been connected to the Mac.

Some features need a paid team

NFC, Sign in with Apple, a share target, Wi-Fi and links from your website need capabilities a Personal Team can't sign. See Why some need a paid Apple team.

What --run does on an iPhone

  1. Builds the app for the phone, signed for development. Xcode registers the phone with your team and makes the provisioning profile itself, with -allowProvisioningUpdates. This build makes only dist/ios/MyApp-device.app, not the simulator app or the .ipa.
  2. Installs the app and opens it with xcrun devicectl, closing the copy a previous run left open.

Keep the phone unlocked while it builds: Xcode asks the phone for its development services before it compiles. If it's locked, if Developer Mode is off, or if the phone isn't paired, the build stops and says what to do on the phone.

The first time you open an app signed with a free Apple ID, iOS refuses to open it until you trust its developer:

  1. Open Settings → General → VPN & Device Management.
  2. Tap your Apple ID under Developer App, then Trust.
  3. Run the same command again.

To give the app to testers who don't have a Mac, build an ad hoc .ipa.

Run on an emulator or Android phone

ng build --platform android --run:

  1. Picks a device: a running emulator or a connected phone. Otherwise it starts the first virtual device in Android Studio's Device Manager while the app builds. With --device, the virtual device with that name, or the device with that serial (adb devices lists them).
  2. Waits for Android to start. An emulator's first start takes a minute or two.
  3. Installs the app and opens it, closing the copy a previous run left open.

It runs the SDK's own adb and emulator, so neither has to be on your PATH. The emulator keeps running after the build.

On a real Android phone

  1. Turn on Developer options and USB debugging in the phone's settings.
  2. Connect it with a USB cable, and allow the connection on the phone.

--run then uses it. With an emulator running too, it uses the first that adb devices lists: pass the other's serial to --device to choose.

Without --run

Install the app with adb, Android's tool for talking to emulators and phones. It's in the SDK's platform-tools folder, e.g. ~/Library/Android/sdk/platform-tools on macOS:

adb install -r dist/android/my-app.apk

-r replaces an older copy. Then tap the app's icon. With more than one device connected, pick one with adb -s <serial> install ….

Warning

INSTALL_FAILED_UPDATE_INCOMPATIBLE The installed copy was signed with a different key, e.g. before you set up signing. Uninstall it from the device (or with adb uninstall com.example.myapp), then build again.

Develop in the real app with ng serve

Rebuilding the app for every change takes a minute or more. While you work, run the dev server with --platform instead:

ng serve --platform ios                            # on the iOS Simulator
ng serve --platform android                        # on an emulator or Android phone
ng serve --platform ios --device "iPhone 18 Pro"   # --device as with --run

It starts the dev server, as ng serve always does, with the web preview and the Lynx Explorer QR code. Then it builds a development build of your app and opens it where --run would.

That app loads your code from the dev server instead of from a copy inside it. It updates on every save, as Lynx Explorer does.

Unlike Lynx Explorer, it's your app. It has the native modules --platform builds in, such as LynxSecureStorage, sign-in with LynxWebAuthSession and WebGL in <canvas>. It has the device features you turn on, too. So an app that needs them works.

It also gets back the memory the screens you leave hold on to. In Lynx Explorer, that memory keeps growing over a long session (see Free the memory screens leave behind).

  • The native build is cached. The next ng serve --platform with the same native options (appId, icon, permissions, ...) reinstalls the app without running Xcode or Gradle. A change to those options rebuilds it.
  • It's built from the build target's options, the same ones ng build --platform uses. So the development app has your app's name, icon and permissions.
  • On Android, the app reaches the dev server at localhost. ng serve forwards the port to the device with adb reverse. So it works over USB too, without the phone and your computer sharing a network.
  • When the dev server can't be reached, the app says so and keeps trying. Opening it from the home screen later loads from the same server, once ng serve runs again.

On a real iPhone

The phone loads from your Mac's address on the local network, the one the QR code shows.

  • Both need to be on the same Wi-Fi, even when the phone is plugged in: the cable only installs and opens the app.
  • The first time the app opens, iOS asks to let it find devices on your local network. Tap Allow. If you tap Don't Allow, turn it on again in Settings > Privacy & Security > Local Network.
  • Only the development build asks: the app for the stores doesn't. An ejected project's Info.plist needs its own NSLocalNetworkUsageDescription for iOS to say why it asks.

Never ship the development build

It's for development only. It's built in the Debug configuration (iOS) and as the debug build type (Android). It isn't optimized, and it has no copy of your app inside it. ng build --platform builds the app for the stores.

Switching between the two needs no uninstall: they're the same app, so each replaces the other.

Set the platform in angular.json

You can also set the platform in angular.json, for ng serve -c ios:

"serve": {
  "builder": "@blotch/angular-lynx-build:dev-server",
  "configurations": {
    "ios": { "platform": "ios" },
    "android": { "platform": "android" }
  }
}