Run on Android or iOS
Open your browser app in a native shell connected to the development server.
Complete installation first. Keep pnpm dev running on port 5173 with devHost: "localhost" in vite.config.ts.
Run every command below from your app directory. Install the native dependencies for the platform you want to run.
Android
Install Android Studio with the Android SDK, Android SDK Platform-Tools, and a JDK compatible with Capacitor 8. Create an Android Virtual Device in Device Manager and start it. See Capacitor's environment setup for toolchain requirements.
Set ANDROID_HOME or ANDROID_SDK_ROOT to your SDK directory. Put adb and emulator on PATH.
Install the native packages:
pnpm add @capacitor/core@^8.5.3 @capacitor/android@^8.5.3 @capacitor/device@^8.0.3
pnpm add -D @capacitor/cli@^8.5.3Device info is enabled by default, so its native peer is included here. List connected devices:
adb devicesUse the emulator's serial in both commands:
adb -s YOUR_SERIAL reverse tcp:5173 tcp:5173
pnpm exec radical android --target YOUR_SERIALRadical generates the Android project, builds it, and launches the app. You see My app with platform: "android". Port reversal lets the Android shell reach the computer's development server at localhost:5173.
For an authorized USB device, use its serial in the same commands. See device targets and LAN access for other connection options.
iOS
Use macOS with Xcode, its command-line tools, and an installed iOS simulator runtime. Open Xcode once to finish setup and accept its license.
Install the native packages:
pnpm add @capacitor/core@^8.5.3 @capacitor/ios@^8.5.3 @capacitor/device@^8.0.3
pnpm add -D @capacitor/cli@^8.5.3List available simulators:
xcrun simctl list devices availableLaunch one using its UDID:
pnpm exec radical ios --target YOUR_SIMULATOR_UDIDRadical generates the Xcode project, builds it, and opens your app. You see My app with platform: "ios". The simulator reaches the host's localhost without port forwarding.
For a physical iPhone, follow physical-device signing and LAN setup.
Keep the server reachable
Remote mode needs the web server for documents and server functions. If the shell cannot connect, check that pnpm dev is still running on port 5173. On Android, repeat port reversal after reconnecting the device.
Changing native flags or assets requires regeneration. Run pnpm exec radical android or pnpm exec radical ios again. Use --generate-only to create the project without building or launching it.
Continue with next steps.