---
title: "Running Your App"
description: "Preview your app in a phone's browser, run it natively in the iOS simulator, an Android emulator, or on a device, and learn what each one can test."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.lairport.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Running Your App

## Introduction

While you build your app, there are three ways to see it on a phone. Each one trades setup for how much of the native app you can test, so it's worth knowing which to reach for:

| | Browser | Simulator | Device |
| --- | --- | --- | --- |
| Command | `dev` | `dev ios`, `dev android` | `dev ios --device` |
| Needs Xcode or Android SDK | No | Yes | Yes |
| Without a Mac | iPhone and Android | Android only | Android only |
| Live reload of your pages | Yes | Yes | Yes |
| Server changes | Reload the page | Pull down or relaunch | Pull down or relaunch |
| Native plugins | No | Yes | Yes |
| Native splash and icon | No | Yes | Yes |

> **Early release**
>
> Lairport is at v0.1. The `laravel-mobile` CLI is published on crates.io, and the `@laravel-rust-mobile/core` adapter is published on npm. Each feature is in beta or alpha: beta features are ready to try on your own apps, and alpha features are experimental. The [status](https://docs.lairport.app/status/) page lists the stage of each feature.

## Previewing in a Phone's Browser

The quickest way to see your app on a phone is the `dev` command with no platform:

```sh
laravel-mobile dev
```

The `dev` command starts your server, queue worker, and Vite on your network address, then prints a QR code. If your `.env` file broadcasts through a local Reverb server, `dev` starts that server too. See [troubleshooting](https://docs.lairport.app/troubleshooting/#reverb-doesnt-start-in-dev) for the conditions. Scan it with your phone's camera, and your app opens in the phone's browser. Your phone must be on the same network as your computer; if the page doesn't load, see [troubleshooting](https://docs.lairport.app/troubleshooting/#your-phone-cant-reach-the-dev-server).

This preview needs nothing but a phone on the same network, so it's a great way to check layouts and flows on a real screen, even from Linux or Windows. However, it is a browser, not your native app. Native plugins aren't available, so `mobile.isNative()` returns `false` and each `@laravel-rust-mobile/core` call uses its web fallback or does nothing.

> **Coming from Expo?**
>
> The browser preview is not Expo Go. Expo Go is a native app that runs the Expo SDK's native modules. Our equivalent, a prebuilt dev client app that runs your enabled plugins, is planned for v0.2. Until then, test native features in a simulator, an emulator, or on a device.

## Previewing from Another Network

The QR code works only when the phone is on the same network as your computer. If your phone is somewhere else, such as on mobile data, pass the `--tunnel` option to `dev`. It reaches your app at a public HTTPS address that works from anywhere:

```sh
laravel-mobile dev --tunnel
```

If you would like to choose the tunnel program yourself, name it after the option. You may use `cloudflared` for its quick tunnels, which need no account, or `expose` for Expose, the tunnel behind Herd's and Valet's `share`:

```sh
laravel-mobile dev --tunnel cloudflared
```

Install `cloudflared` or Expose first. Without either one, `dev` stops and names the program to install, with the error code `dev::tunnel_missing`. A tunnel can also fail to start, with `dev::tunnel_failed`, in which case the message says what to check.

When `dev` starts your server, it sets `APP_URL` to the tunnel's address, so redirects and links work through the tunnel. If you run with `--no-server` and start your own server, set `APP_URL` in `.env` to the address `dev` prints.

A tunnel reaches a single port, so `dev` builds your assets and rebuilds them when you save a file, instead of serving them through Vite's development server. To see a change on your phone, pull down to refresh the page. The `--tunnel` option conflicts with `--host` and `--device`, because the tunnel replaces both.

Anyone with the tunnel's address can open your development server while the command runs, so stop `dev` when you have finished testing.

## Running in a Simulator or Emulator

> **The iOS simulator is alpha**
>
> Running in the iOS simulator is alpha, at your own risk. The Android emulator is beta on Linux and alpha on macOS and Windows.

To run your real native app, pass the platform to the `dev` command:

```sh
laravel-mobile dev ios

laravel-mobile dev android
```

The first run creates the Xcode or Gradle project and compiles the app, which can take several minutes. After that, the app opens in the iOS simulator or Android emulator, pointed at the server on your machine.

From then on, changes to your Inertia pages appear within a few seconds through Vite, just as they do in a browser. If you change Rust code in `apps/mobile`, Tauri rebuilds and relaunches the app for you.

Sessions, login, forms and file uploads all work in `dev` on a device, just as they do in a release build.

> **Live camera and microphone on iPhone need a release build**
>
> On an iPhone, `dev` loads your pages from your computer's network address over plain `http://`, which browsers don't treat as a secure context. So `getUserMedia`, which opens a live camera or microphone stream, is unavailable there. It works in release builds. An Android phone connected over USB doesn't have this limit, and a file input with `capture` works everywhere.

Changes to your Laravel Rust server work a little differently. When you edit a Rust file, `dev` restarts the server, and the open page reloads through Laravel Rust's own `/_laravel/reload` stream. On a phone over USB, an edited route appeared about five seconds after the restart, without a full reload or a relaunch. If you change `mobile.toml`, such as enabling a plugin or adding a permission, stop `dev` and start it again so the native project picks up the change.

The iOS simulator only runs on a Mac with Xcode. The Android emulator runs on macOS, Linux, and Windows, using the Android SDK's emulator.

## Running on a Device

To run on a phone connected to your machine, provide the `--device` option with the device's name, such as "iPhone 17 Pro" or "Pixel 9". For Android, you may also use the serial number that `adb devices` lists:

```sh
laravel-mobile dev android --device "Pixel 9"
```

For Android, plug the phone in over USB and allow USB debugging when it asks.

If a release build of your app, or a build with a higher build number, is already installed on the phone, `dev android` stops before it builds. It prints the `adb uninstall` command to remove the installed app. Be aware that uninstalling also deletes the app's data on the device.

When a phone or emulator is connected this way, `dev` forwards the server and Vite ports with `adb reverse`, so the app loads from `127.0.0.1` and works even on Wi-Fi that isolates devices. The forwards are removed when `dev` stops. To keep the network path instead, pass `--host`.

> **Pass --device when two Android devices are connected**
>
> In `laravel-mobile-cli` 0.1.1, if two or more Android phones or emulators are connected and you run `dev android` without `--device`, Tauri's device prompt repeats forever, filling your disk with log output and ignoring Ctrl+C. In 0.1.2, `dev` stops at once and lists the devices instead, so pass `--device` with the one you want, such as `laravel-mobile dev android --device ZY22J64W7V`. Until you upgrade, disconnect the extra device. See [troubleshooting](https://docs.lairport.app/troubleshooting/#dev-android-loops-on-a-device-prompt).

For an iPhone, you'll need a Mac and an Apple Developer team, since every app on an iPhone must be signed. Add your team ID to `mobile.toml`, then enable developer mode on the iPhone:

```toml title="mobile.toml"
[ios]
team_id = "ABCDE12345"
```

```sh
laravel-mobile dev ios --device "Taylor's iPhone"
```

## Running on Your Computer

> **Desktop is alpha**
>
> Running as a desktop app is alpha, at your own risk.

To run your app as a desktop app on macOS, Windows, or Linux, run `dev desktop`. It opens the app in a resizable window on this computer, and the window reloads when you change your pages:

```sh
laravel-mobile dev desktop
```

The app is served on `127.0.0.1`, so only this computer can reach it. The desktop uses the same `mobile.toml` and pages as your phone app. Plugins that also run on the desktop, such as the clipboard, dialog, and notification plugins, work as they do on a phone. Haptics, biometrics, and the scanner do nothing on the desktop, as in a browser. Check `mobile.isDesktop()` before you call them, or read `mobile.platform()` to tell `'macos'`, `'windows'`, and `'linux'` apart.

## Developing Without a Mac

Apple only ships Xcode and the iOS simulator for macOS, so on Linux and Windows you have fewer options for iOS:

- **Android:** everything works, including the emulator, devices, and release builds.
- **iPhone:** you may preview your pages in the phone's browser with `laravel-mobile dev`, but you can't run the native app, test native plugins, or build for the App Store.

Two planned features close this gap. The prebuilt dev client (v0.2) will let you run your native plugins on an iPhone from any machine, and [cloud builds](https://docs.lairport.app/cloud-services/) will compile and sign your iOS app without a Mac. Until then, iOS work needs a Mac, whether your own, a borrowed one, or a hosted Mac in CI.

Source: https://docs.lairport.app/running/index.mdx
