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/concepts/how-it-runs.md.

How a Lynx app runs

This page explains the pieces between your code and a phone screen: the bundle, the host app, Lynx Explorer and the web preview. Once you know them, the dev workflow and the build commands make sense.

The short version

  1. The build compiles your app into a single file: the bundle.
  2. A host app, a native iOS or Android app, loads that bundle and shows it.
  3. While you develop, the host app is Lynx Explorer, or a development build of your own app that ng serve --platform makes. When you ship, it's an app that ng build --platform generates for you.

The bundle

A bundle is one file that holds your whole app: compiled code, templates and styles. ng build writes it to dist/main.lynx.bundle.

Think of it like the JavaScript and CSS of a web app packed into a single download. It doesn't run on its own. It needs a Lynx engine to read it, and that engine lives inside a host app.

The build also writes main.web.bundle, the same app prepared for the web preview.

The host app

A host app is a regular iOS or Android app with the Lynx engine built in. It does three things:

  • loads your bundle, from the app itself or from a URL;
  • gives it a place on screen, a native view called a LynxView;
  • can pass it data, such as the user's theme or language, or values from your native code.

There are three kinds of host app:

Host appWhen you use itWho makes it
Lynx ExplorerDevelopmentLynx. You install it from a store or GitHub
The development buildDevelopment, with your app's native modulesng serve --platform ios|android builds it
The generated appShipping to the storesng build --platform ios|android builds it
Your own native appAdding Lynx screens to an existing appYour native team. See Embedding

Lynx Explorer

Lynx Explorer is a host app for development. You give it a URL, and it downloads and runs the bundle at that URL.

When ng serve runs, your computer serves the bundle over your network. The QR code in the terminal holds the bundle's URL. Lynx Explorer scans it, downloads the bundle and runs your app.

When you save a file, the dev server rebuilds the bundle and sends the changes to Lynx Explorer, which applies them to the running app:

  • A changed template or stylesheet re-renders its component, which keeps its state.
  • Any other change restarts the app on the screen it was showing.
  • A change that can't be applied reloads the whole app. That needs Lynx DevTool turned on in Lynx Explorer's settings.

Lynx Explorer only has Lynx's own native modules, not the ones your app adds. To develop in your own app instead, run ng serve --platform ios or --platform android: it builds a development build of your app, which loads the bundle from the dev server and updates the same way. See Develop in the real app.

The web preview

The web preview is Lynx's web renderer, running in your browser. It draws the same elements with HTML and CSS under the hood, so you can work without a phone.

When you save a file, the web preview reloads the page once the rebuild finishes. It can't apply changes to the running app as Lynx Explorer does, so the app starts over on its first screen, with its state reset. If the build fails, the page stays as it was, and the browser's console shows the errors.

It's close to a phone, not identical. Fonts, scrolling physics and a few CSS details differ. Check important screens on a real device or a simulator before you ship.

Shipping

You don't ship Lynx Explorer to your users. ng build --platform ios and ng build --platform android generate a host app of your own, with your bundle inside, your app name and your icon. You upload that app to the App Store or Google Play.

You never write Swift or Kotlin for it. You do install Apple's and Google's build tools, because they compile the app. Run on iOS and Android walks through it.

Inside the bundle: two threads

A Lynx app runs JavaScript on two threads, and AngularLynx starts your app on both. This is why some code behaves differently than on the web. Read Threads: where your code runs next.