AGENT SKILL

run-android

Build, deploy and visually verify the app on an Android emulator or device via the Capacitor shell, then verify with Maestro. Use when a change touches the native shell, plugins, or needs on-device confirmation.

License 许可
MIT
所属仓库
AfanasievN/appkeel
最近更新
2026-07-16
Stars
★ 0
Forks
0

01 前言 Front Matter

name
run-android
description
Build, deploy and visually verify the app on an Android emulator or device via the Capacitor shell, then verify with Maestro. Use when a change touches the native shell, plugins, or needs on-device confirmation.

03 SKILL.md 正文

Run on Android

pnpm mobile:android [target]      # scripts/run-android.sh: web build → cap sync → cap run

The script resolves JDK 21 automatically (Capacitor's Android build requires it; falls back to Android Studio's bundled JBR) and picks the first connected adb device if no target given.

No device running? Start an emulator first:

export ANDROID_HOME=$HOME/Library/Android/sdk
$ANDROID_HOME/emulator/emulator -avd $($ANDROID_HOME/emulator/emulator -list-avds | head -1) &
$ANDROID_HOME/platform-tools/adb wait-for-device

Verify on device

Use the Maestro MCP tools: list_devices → take_screenshot / inspect_screen with the device id (e.g. emulator-5554). A screenshot showing the expected screen + a hierarchy containing your data-testid markers is the pass criterion. Maestro YAML flows live in e2e/maestro/ (per feature) once they exist.

Troubleshooting

  • error: invalid source release: 21 — build ran with JDK < 21; use the script or export JAVA_HOME to a JDK 21+ (Android Studio JBR works).
  • SDK not found — apps/app/android/local.properties must contain sdk.dir=$HOME/Library/Android/sdk (machine-local file, not committed).
  • Web changes not visible in the app — you forgot cap sync (the script always does it).
  • iOS note: the shell is SPM-based (no CocoaPods). pnpm --filter app exec cap open ios and run from Xcode; signing is interactive and stays with the human.

04 同仓库更多 Skills