toolkit/packages/skills/start-android/SKILL.md
Start Android development with Emulator, dev server, and optional Poltergeist auto-rebuild
npx skillsauth add stevengonsalvez/agents-in-a-box start-androidInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Start Android development with Emulator, dev server, and optional Poltergeist auto-rebuild.
/start-android # debug build, .env.development
/start-android staging # staging build, .env.staging
/start-android release # release build, .env.production
/start-android debug Pixel_7 # Specific emulator
VARIANT=${1:-debug}
DEVICE=${2:-"Pixel_7_Pro"}
case $VARIANT in
debug)
ENV_FILE=".env.development"
BUILD_TYPE="Debug"
;;
staging)
ENV_FILE=".env.staging"
BUILD_TYPE="Staging"
;;
release|production)
ENV_FILE=".env.production"
BUILD_TYPE="Release"
;;
esac
[ ! -f "$ENV_FILE" ] && ENV_FILE=".env"
detect_android_project() {
if [ -d "android" ] && [ -f "android/build.gradle" ]; then
[ -f "package.json" ] && grep -q "react-native" package.json && echo "react-native" && return
[ -f "capacitor.config.json" ] && echo "capacitor" && return
[ -f "pubspec.yaml" ] && echo "flutter" && return
echo "native"
else
echo "unknown"
fi
}
PROJECT_TYPE=$(detect_android_project)
[ ! -d "android" ] && echo "❌ android/ directory not found" && exit 1
# Gradle wrapper
[ -f "android/gradlew" ] && chmod +x android/gradlew
# npm
if [ -f "package.json" ] && [ ! -d "node_modules" ]; then
npm install
fi
! command -v adb &> /dev/null && echo "❌ adb not found. Is Android SDK installed?" && exit 1
! emulator -list-avds 2>/dev/null | grep -q "^${DEVICE}$" && echo "❌ Emulator '$DEVICE' not found" && emulator -list-avds && exit 1
RUNNING_EMULATOR=$(adb devices | grep "emulator" | cut -f1)
if [ -z "$RUNNING_EMULATOR" ]; then
emulator -avd "$DEVICE" -no-snapshot-load -no-boot-anim &
adb wait-for-device
sleep 5
while [ "$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')" != "1" ]; do
sleep 2
done
fi
EMULATOR_SERIAL=$(adb devices | grep "emulator" | cut -f1 | head -1)
# For dev server access from emulator
if [ "$PROJECT_TYPE" = "react-native" ] || grep -q "\"dev\":" package.json 2>/dev/null; then
DEV_PORT=$(shuf -i 3000-9999 -n 1)
adb -s "$EMULATOR_SERIAL" reverse tcp:$DEV_PORT tcp:$DEV_PORT
fi
POLTERGEIST_AVAILABLE=false
if command -v poltergeist &> /dev/null; then
POLTERGEIST_AVAILABLE=true
[ ! -f ".poltergeist.yml" ] && cat > .poltergeist.yml <<EOF
platform: android
watchPaths:
- android/app/src/**/*.kt
- android/app/src/**/*.java
- android/app/src/**/*.xml
ignorePaths:
- android/app/build/**
- android/.gradle/**
buildCommand: |
cd android && ./gradlew assemble${BUILD_TYPE} && cd ..
installCommand: |
adb -s $EMULATOR_SERIAL install -r android/app/build/outputs/apk/${VARIANT}/app-${VARIANT}.apk
EOF
fi
PROJECT_NAME=$(basename "$(pwd)")
BRANCH=$(git branch --show-current 2>/dev/null || echo "main")
TIMESTAMP=$(date +%s)
SESSION="android-${PROJECT_NAME}-${TIMESTAMP}"
tmux new-session -d -s "$SESSION" -n build
case $PROJECT_TYPE in
react-native)
tmux send-keys -t "$SESSION:build" "npx react-native run-android --variant=$VARIANT --deviceId=$EMULATOR_SERIAL" C-m
;;
capacitor)
tmux send-keys -t "$SESSION:build" "npx cap sync android && npx cap run android --target=$EMULATOR_SERIAL" C-m
;;
flutter)
tmux send-keys -t "$SESSION:build" "flutter run -d $EMULATOR_SERIAL --flavor $VARIANT" C-m
;;
native)
tmux send-keys -t "$SESSION:build" "cd android && ./gradlew install${BUILD_TYPE} && cd .." C-m
;;
esac
# Dev server (if needed)
if [ "$PROJECT_TYPE" = "react-native" ] || grep -q "\"dev\":" package.json 2>/dev/null; then
tmux new-window -t "$SESSION" -n dev-server
tmux send-keys -t "$SESSION:dev-server" "PORT=$DEV_PORT npm start 2>&1 | tee dev-server.log" C-m
fi
# Poltergeist (if available)
if [ "$POLTERGEIST_AVAILABLE" = true ]; then
tmux new-window -t "$SESSION" -n poltergeist
tmux send-keys -t "$SESSION:poltergeist" "poltergeist watch --platform android 2>&1 | tee poltergeist.log" C-m
fi
# Logs
tmux new-window -t "$SESSION" -n logs
tmux send-keys -t "$SESSION:logs" "adb -s $EMULATOR_SERIAL logcat -v color" C-m
# Git
tmux new-window -t "$SESSION" -n git
tmux send-keys -t "$SESSION:git" "git status" C-m
cat > .tmux-android-session.json <<EOF
{
"session": "$SESSION",
"project_name": "$PROJECT_NAME",
"branch": "$BRANCH",
"type": "$PROJECT_TYPE",
"variant": "$VARIANT",
"environment": "$ENV_FILE",
"emulator": {
"name": "$DEVICE",
"serial": "$EMULATOR_SERIAL"
},
"dev_port": ${DEV_PORT:-null},
"poltergeist": $POLTERGEIST_AVAILABLE,
"created": "$(date -Iseconds)"
}
EOF
echo ""
echo "✨ Android Dev Environment Started: $SESSION"
echo ""
echo "Variant: $VARIANT ($ENV_FILE)"
echo "Emulator: $DEVICE ($EMULATOR_SERIAL)"
[ "$POLTERGEIST_AVAILABLE" = true ] && echo "Poltergeist: Auto-rebuild enabled"
echo ""
echo "Attach: tmux attach -t $SESSION"
echo "Status: /tmux-status"
echo ""
documentation
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
development
Show fleet status — every claude session running on the host, merged across ainb + claude-peers broker + background jobs. Use when you need to enumerate sessions before composing an action, see which sessions have a peer registered (broker-routable) vs tmux-only, check the `summary` of each session, or pipe the list into jq for filtering. Default output: text table. Pass --format json for LLM consumption.
testing
Ordered multi-step prompts to fleet targets, ack-gated between steps via JSONL assistant-turn-end detection. Use for cycles like disconnect→reconnect→verify, or any flow where step N+1 requires step N to have completed first. The skill BLOCKS until each target's transcript shows the next assistant turn finishing OR per-step timeout fires (default 300s).
development
Center control panel — enumerate every claude session that is blocked waiting on something: a user answer (AskUserQuestion fired), an API error retry, an idle assistant turn-end with no follow-up, or an explicit WAITING: marker. Returns rich JSON with signal kind + context per session. Use this when you've stepped away from the fleet and want one place to see everything that wants your attention and answer it.