Skip to main content

Capacitor

Archibald integrates Capacitor as a native-shell runtime: it wraps your Archibald web application in a native iOS/Android shell instead of a full React Native/Expo setup. It is one of the three native runtimes supported by the framework — see the Native Integration guide for choosing between Expo, Capacitor and bare React Native.

Setup

The scaffolder is built into @archibald/cli, so there is no integration package to install. In an Archibald project:

archibald add capacitor

This scaffolds Capacitor into the project:

  • installs the @capacitor/* dependencies,
  • runs cap init / cap add <platform> for the chosen platforms,
  • ensures a web output directory exists,
  • records cli.native.framework = "capacitor" in the project config.

Unlike most scaffolders, this one ships no template directory — everything is generated by the Capacitor CLI itself.

Serving into the native shell

archibald serve --native ios|android runs cap sync, rewrites the platform-specific capacitor.config.json — pointing server.url at the running dev server and setting webDir — and opens Xcode or Android Studio. The shell then loads from the dev server instead of a static build. Setting cli.native.capacitor.bundle clears server.url again, so the shell loads the bundled client output. This is handled by the CLI; there is no public API to call.

Further documentation