Skip to content
Docs

Capacitor

A Capacitor app has native projects under android/ and ios/, next to the web app. The capacitor source kind points at the app directory and finds the right files:

Target type Resolves to
android <dir>/android/app/build.gradle
ios <dir>/ios/App/App.xcodeproj
targets: {
android: { type: "android", source: { kind: "capacitor", dir: "apps/mobile" } },
ios: { type: "ios", source: { kind: "capacitor", dir: "apps/mobile" } },
}

launchset init finds capacitor.config.* and prefers this kind.

  • For Android it is the same as gradle on that file, so the same rules apply: literal versionCode and versionName in defaultConfig. If both build.gradle and build.gradle.kts exist, launchset fails instead of guessing.
  • For iOS it is the same as xcodeproj. You can limit the native targets with xcodeTargets.
  • The dir is relative to the repo root. Use "." when the Capacitor app is the repo root.
  • The web part of the app is usually a web target or part of the native build (npx cap sync before the native build).

Run npm ci, your web build and npx cap sync before the Gradle or Xcode step, after stamp:

- run: npm ci && npm run build && npx cap sync android
if: matrix.target == 'android' && steps.verify.outputs.already-published != 'true'

cap sync copies web assets into the native projects. It doesn’t touch the version files that launchset stamped.