kesto.de Cheatsheets

Capacitor

Add Capacitor to existing app and initialize

npm install @capacitor/core
npm install @capacitor/cli --save-dev
npx cap init

Add Android support to project

npm install @capacitor/android
npx cap add android

Set environment variables for Android SDK etc.

export ANDROID_HOME=$HOME/Android
export PATH="$ANDROID_HOME/cmdline-tools/latest:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"

List targets (devices)

npx cap run android --list

Run on specific target

npx cap run android --target [Target Id]

(Target Id as listed by --list)