Mobile

Mobile CLI and devices

Add the native projects, test the app on a phone against your own machine and prepare a release.

This page covers the frigear-mobile command, testing on a phone, Android and the steps before a release. It is for app developers. Set up the module first: Overview.

CLI

The package ships the frigear-mobile command, which sets up and checks the native iOS and Android projects.

frigear-mobile native [--platform ios|android] [--if-missing] [--cwd <dir>]   # cap add + URL schemes, idempotent
frigear-mobile doctor [--strict] [--cwd <dir>]                                # plugins and native projects
  • native adds the missing iOS and Android projects with cap add, for each platform whose package (@capacitor/ios or @capacitor/android) is installed. Then it registers the OAuth redirect and deep-link schemes in ios/App/App/Info.plist (with NSAllowsLocalNetworking) and in android/app/src/main/AndroidManifest.xml (with verified app links). Running it again changes nothing. --if-missing leaves existing platform folders alone.
  • doctor checks that the app depends on @capacitor/cli and every plugin a feature uses, and that the native projects register the URL schemes. --strict exits with 1 on errors, for CI.

Both read the app's settings from .nuxt/mobile/native.json, and run nuxt prepare first when it is missing.

Device development

There are two ways to run the app on a phone against a server on this machine.

  • Live reload (nuxt dev --host 0.0.0.0, cap run ios --live-reload). nuxt-capacitor points the app at the dev server. Auth in client mode rewrites a localhost issuer and API base to that host.
  • A build on a phone. MOBILE_LAN=1 nuxt generate rewrites localhost to this machine's LAN address. MOBILE_LAN=192.168.1.20 picks the address. It never applies in nuxt dev.
VariablePurpose
MOBILE_LAN1 (or true) detects the LAN address; an address fixes it.
MOBILE_RELEASE1 marks a release build. Combined with MOBILE_LAN, it fails the build, so a LAN address never ships.

Android

Android uses the web tab bar and header by default; see Native chrome. The back button closes an open overlay, goes back, returns to the first tab, then minimizes the app.

Prefer live reload on Android. The WebView's origin is https://localhost, so a plain-http development server is mixed content.

Release checklist

Check these before a build goes to a store.

Never ship a localhost or LAN address. Build releases with MOBILE_RELEASE=1, so MOBILE_LAN cannot slip in.
  1. Install every plugin frigear-mobile doctor lists, as dependencies of the app.
  2. Install @aparajita/capacitor-secure-storage when the app signs in. Without it a production build fails, because tokens would be stored unencrypted. authentication.client.storage: 'preferences' accepts that.
  3. Register the redirect URI <scheme>:/auth/callback at the issuer. The scheme is the app id in lowercase, with _ as -. Allow capacitor://localhost and https://localhost for CORS at the issuer and on your API. See Use your own OAuth server.
  4. Point issuer, apiBase and clientId at production, through NUXT_PUBLIC_AUTHENTICATION_CLIENT_*.
  5. Check the guards (Sign-in), and keep privileged data out of the bundle.
  6. Run frigear-mobile native and frigear-mobile doctor --strict, then nuxt generate and cap sync.
  7. Check that no client secret is in the bundle. The build refuses one.

Next steps

  • Mobile starter – see these commands wired into run scripts for iOS and Android.
Copyright © 2026