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/index.md.

Run on iOS and Android

ng build --platform turns your app into a real iOS or Android app, with your app's name and icon. You can install it on a virtual phone or on your own phone. Use it to test what your users will get, and to make the files you upload to the app stores.

You never open an Xcode or Android Studio project. The builder generates the native project and builds it for you. You still install Xcode and Android Studio, because their build tools do the compiling.

Install the tools

Each platform needs its own tools. Install the ones for the platforms you build.

iOS: a Mac with Xcode

  1. Use a Mac. Apple only ships its build tools for macOS, so iOS apps can't be built on Windows or Linux.
  2. Install Xcode from the Mac App Store. It's a large download.
  3. Open Xcode once. It asks to install extra components and the iOS platform. Accept both. The iOS platform includes the iOS Simulator, a virtual iPhone that runs on your Mac.

After that, you can close Xcode. The build calls its command-line tools by itself.

Android: Android Studio and a JDK

  1. Install Android Studio, on macOS, Windows or Linux. Its setup wizard installs the Android SDK (Android's build tools) and the emulator, which runs virtual Android phones on your computer.

  2. Keep the SDK's default location, or set ANDROID_HOME to where you put it. The builder looks in:

    • ~/Library/Android/sdk on macOS
    • %LOCALAPPDATA%\Android\Sdk on Windows
    • ~/Android/Sdk on Linux
  3. Install JDK 17 or newer, Java's development kit. Android's build needs it. On macOS, the builder finds an installed JDK by itself. Elsewhere, or to use the JDK that comes with Android Studio, set JAVA_HOME. For example, on macOS:

    export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
  4. Create a virtual phone. In Android Studio's Device Manager, add a virtual device. You don't have to start it: --run does.

Build the apps

ng build --platform ios       # writes dist/ios/
ng build --platform android   # writes dist/android/
ng build --platform all       # both

Each build first makes the bundle, as ng build does, then the app around it. You get these files:

FileWhat it is
dist/ios/MyApp-simulator.appAn .app: an iOS app as a folder. This one runs only on the iOS Simulator
dist/ios/MyApp.ipaAn .ipa: a signed iOS app file for the App Store or your testers' iPhones. Built once iOS signing is set up
dist/android/my-app.apkAn .apk: an Android app file you can install directly on an emulator or phone
dist/android/my-app.aabAn .aab: an Android App Bundle, the file you upload to Google Play. It can't be installed directly

The file names come from your app's appName: My App gives MyApp on iOS and my-app on Android.

  • The first build is slow. The iOS build downloads a prebuilt copy of the Lynx engine once. The first Android build downloads Android's build system and libraries, which can take several minutes. Later builds take seconds.
  • The native project is hidden. The builder generates it in Angular's build cache (.angular/cache/, which ng new already git-ignores). It reuses the project until your options change. ng cache clean deletes it, and the next build generates it again.
  • When a build fails, the error names the full log file. Read the end of it for the tool's own message.
One screen, one bundle

The generated app shows main.lynx.bundle full screen, and Angular Router handles all navigation inside it. It doesn't open the other bundles of a multi-page app. For those, eject or embed them in your own app.

Run the app

Add --run, and the build installs the app on a virtual phone and opens it:

ng build --platform ios --run       # on the iOS Simulator
ng build --platform android --run   # on an emulator or Android phone

After a change, run the same command again: the new build replaces the copy that's open.

To choose the phone, name it with --device:

ng build --platform ios --run --device "iPhone 18 Pro"    # a simulator
ng build --platform ios --run --device "Jane's iPhone"    # a real iPhone
ng build --platform android --run --device Pixel_9

--device names one device, so it goes with --platform ios or --platform android. ng build --platform all --run opens the app on both.

A real iPhone needs a one-time setup first. Run on simulators and phones covers it, and each kind of device.

Next steps