Skip to main content

Napacitor CLI - nap run

Build and run the app on a target device or emulator. This is a thin wrapper around dotnet build -t:Run with the target framework and configuration resolved for you.

npx nap run [maui] [--target <t>] [-c <cfg>]

Options:

  • --target <windows|android|ios|maccatalyst>: target platform. Defaults to windows on Windows, android elsewhere.
  • -c <Debug|Release>: build configuration (default: Debug).

Behavior:

Runs:

dotnet build maui/App.csproj -t:Run -f <TFM> -c <Debug|Release>

The -t:Run target builds, installs, and starts the app on Android and iOS.

Windows note:

The Windows SDK's Run target does not build — run nap build first, then nap run:

npx nap build --target windows
npx nap run --target windows

Prerequisites:

  • Android: an online device or emulator (adb devices must show device), otherwise deployment fails with XA0010.
  • iOS: macOS with Xcode installed.

See Running Your App and Environment Setup.