Skip to main content

Napacitor CLI - nap add

Generate the MAUI host project from the CLI's embedded template.

npx nap add <platform>

Inputs:

  • platform (optional): maui. Napacitor has a single native platform target, so the argument can be omitted.

Behavior:

  • Copies the template into maui/ (configurable via maui.hostDir in napacitor.config.json).
  • Replaces tokens such as __APP_ID__ / __APP_NAME__ and the default brand colors in the generated files.
  • If the webDir has already been built, automatically runs copy + sync once.
  • If an assets section is present in the config, prints a reminder to run nap assets to apply brand icons/splash screens.

Example:

npm run build
npx nap add maui
npx nap run --target android

Fails if the host directory already exists. Delete the directory first if you need to re-add the platform.

See Adding the MAUI Platform for details on the generated host project.