Option A: Via Android Studio
- Open Android Studio
- Tools → Device Manager → Create Device
- Pick a phone (Pixel 7 recommended)
- Download a system image (API 33 or 34)
- Click the play button to launch
Option B: Via Command Line
List available emulators:
$ANDROID_HOME/emulator/emulator -list-avdsStart one:
$ANDROID_HOME/emulator/emulator -avd Pixel_7_API_34 -netdelay none -netspeed fullBuild the debug APK:
./gradlew :app:assembleDebugInstall on the running emulator:
adb install app/build/outputs/apk/debug/app-debug.apkOr build + install in one go:
./gradlew :app:installDebugThe app should appear in the app drawer. Or launch via adb:
adb shell am start -n com.ayagmar.pimobile/.MainActivityWatch logs in real-time:
# All app logs
adb logcat | grep "PiMobile"
# Performance metrics
adb logcat | grep "PerfMetrics"
# Frame jank detection
adb logcat | grep "FrameMetrics"
# Everything
adb logcat -s PiMobile:D PerfMetrics:D FrameMetrics:DSince the app needs the bridge to function:
cd bridge
pnpm install # if not done
pnpm startThe bridge logs the host/port it is listening on.
In the emulator app:
- Open the left drawer → Hosts tab → Add host
- Enter your laptop's Tailscale IP or MagicDNS hostname (
*.ts.net) - Port:
8787(or whatever the bridge uses) - Token: whatever you set in
bridge/.envasBRIDGE_AUTH_TOKEN
If the app shows "Connected" and lists your sessions, it's working.
If not, check:
- Is Tailscale running on both laptop and emulator host?
- Can the emulator reach your laptop? Test with:
adb shell ping 100.x.x.x - Is the bridge actually running? Check with:
curl http://100.x.x.x:8787/health
Normal on first launch. Open the left drawer and go to the Hosts tab to add one.
- Check Tailscale is running on both ends
- Verify the IP address is correct
- Make sure the bridge is listening on a reachable host (
BRIDGE_HOST, e.g. Tailscale IP or 0.0.0.0) - Check
bridge/.envhas correctBRIDGE_PORTandBRIDGE_AUTH_TOKEN
- Check
~/.pi/agent/sessions/exists on your laptop - The bridge needs read access to that directory
- Check bridge logs for errors
- Check
adb logcatfor stack traces - Large sessions might cause OOM - try compacting first in pi
For rapid iteration:
# Terminal 1: Keep logs open
adb logcat | grep -E "PiMobile|PerfMetrics|FrameMetrics"
# Terminal 2: Build and install after changes
./gradlew :app:installDebug
# The app stays open, just reinstallsOr use Android Studio's "Apply Changes" for hot reload of Compose previews.
Unit tests (on JVM):
./gradlew testAll quality checks:
./gradlew ktlintCheck detekt testBridge tests:
cd bridge && pnpm test