qa-device-management
Skill274 starsChanged 8 months agoMITView on GitHub
Boot and control iOS Simulators and Android Emulators for QA testing using agent-device CLI. Manage sessions, capture screenshots, launch apps, and control devices across platforms. Invoke when user says "bring up simulators", "boot the device", "take a screenshot", "launch the app", "compare iOS and Android", "test both platforms", "visual parity check", or any task requiring device/simulator lifecycle management.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- autoresearchSkill
- building-native-uiSkill
- expo-api-routesSkill
- expo-cicd-workflowsSkill
- expo-deploymentSkill
- expo-dev-clientSkill
- expo-tailwind-setupSkill
- expo-ui-jetpack-composeSkill
- expo-ui-swift-uiSkill
- just-bashSkill
- nano-bananaSkill
- native-data-fetchingSkill
- qa-scrollSkill
- qa-setupSkill
- qa-state-persistenceSkill
- qa-test-flowsSkill
- qa-webSkill
- slack-webSkill
- upgrading-expoSkill
- use-domSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
All device settings are in qa.config.sh.
- Distinctive: line 219
When coordinate-based tapping fails (e.g., full-screen video players intercept touches), use CDP to control navigation directly via the …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
qa-device-management
Side-by-side iOS Simulator and Android Emulator control using the agent-device CLI. Manages the device lifecycle for all QA Automation skills.
When to Use
- Bringing up simulators/emulators for testing
- Launching your app on one or both platforms
- Capturing baseline or comparison screenshots
- Checking device state, app state, or accessibility tree
- Managing agent-device sessions across platforms
Configuration
All device settings are in qa.config.sh. Set these before using:
# In qa.config.sh or qa.config.local.sh:
export APP_BUNDLE_ID="com.yourapp.dev" # Your app's bundle/package ID
export SIMULATOR_UDID="auto" # "auto" or specific UDID
export SIMULATOR_DEVICE_NAME="iPhone 16 Pro" # For creating simulators
export ANDROID_AVD="Pixel_8" # Android AVD name
export ANDROID_SERIAL="emulator-5554" # Android serialQuick Start — Full Startup Sequence
Boot iOS Simulator
# Auto-detect a booted simulator, or boot one
source .pi/skills/qa-automation/qa.config.sh
UDID=$(qa_detect_simulator_udid)
# Or boot a specific one
xcrun simctl boot "$SIMULATOR_UDID" 2>&1 || true
open -a SimulatorBoot Android Emulator
nohup $EMULATOR_PATH -avd "$ANDROID_AVD" -no-snapshot-load > /tmp/qa-emu.log 2>&1 &
# Wait for boot
for i in $(seq 1 30); do
BOOT=$($ADB_PATH shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
if [ "$BOOT" = "1" ]; then
echo "Android emulator booted after ~$((i*2))s"
break
fi
sleep 2
doneVerify Both Devices
agent-device devices --jsonLaunch App on iOS
agent-device open "$APP_BUNDLE_ID" --platform ios --session defaultLaunch App on Android
agent-device open "$APP_BUNDLE_ID" --platform android --serial "$ANDROID_SERIAL" --session androidCapture Baseline Screenshots
agent-device screenshot /tmp/qa-ios-baseline.png --session default
agent-device screenshot /tmp/qa-android-baseline.png --session androidSession Management
agent-device binds each session to one platform. Use the correct session flag:
| Platform | Session Flag | Example |
| iOS | --session default (or omit) | agent-device snapshot --session default |
| Android | --session android | agent-device snapshot --session android |
# List active sessions
agent-device session list
# Release a session
agent-device close --session defaultCommon Operations
Screenshots (Both Platforms)
agent-device screenshot /tmp/qa-ios.png --session default
agent-device screenshot /tmp/qa-android.png --session androidAccessibility Snapshots
agent-device snapshot --session default # iOS
agent-device snapshot --session android # Android
# With options
agent-device snapshot -i --session default # Interactive elements only
agent-device snapshot --depth 3 # Limit depthNavigate and Interact
# Tap
agent-device click 200 400 --session default
# Swipe
agent-device swipe 200 800 200 200 --session default
# Scroll
agent-device scroll down --session default
# Type
agent-device fill @e3 "hello world" --session defaultGo Home / Go Back
agent-device home --session default
agent-device back --session androidCheck Foreground App
agent-device appstate --session default
agent-device appstate --session androidRelaunch App (Fresh State)
agent-device open "$APP_BUNDLE_ID" --session default --relaunchBuilding and Installing Your App
iOS — Expo
cd "$PROJECT_DIR"
npx expo run:ios --device "$SIMULATOR_DEVICE_NAME"iOS — React Native CLI
cd "$PROJECT_DIR"
npx react-native run-ios --simulator "$SIMULATOR_DEVICE_NAME"Android — Expo
cd "$PROJECT_DIR"
npx expo run:androidAndroid — React Native CLI
cd "$PROJECT_DIR"
npx react-native run-androidCheck If App Is Installed
# iOS
xcrun simctl listapps booted 2>/dev/null | grep "$APP_BUNDLE_ID"
# Android
$ADB_PATH shell pm list packages | grep "$APP_BUNDLE_ID"Shutdown Sequence
# Close agent-device sessions
agent-device close --session default
agent-device close --session android
# Shutdown simulators
xcrun simctl shutdown "$SIMULATOR_UDID"
$ADB_PATH emu killCDP Connection (for React Native apps)
When coordinate-based tapping fails (e.g., full-screen video players intercept touches), use CDP to control navigation directly via the React Native Hermes runtime.
Prerequisites
- Dev server running (e.g.,
npx expo start) wsnpm package available
Discover CDP Endpoints
# List available debug targets
curl -s http://localhost:$METRO_PORT/json
# Get WebSocket URL (auto-detected by qa.config.sh)
source qa.config.sh
qa_detect_cdp_ws_urlNavigate via CDP
source .pi/skills/qa-automation/qa-test-flows/lib/cdp-helpers.sh
# Navigate to a screen
cdp_navigate "SettingsScreen"
# Navigate to a tab
cdp_navigate_tab "ProfileScreen"
# Get current route
cdp_get_routeTroubleshooting
| Problem | Solution |
| "No device found" | Verify simulator is booted: xcrun simctl list devices | grep Booted |
| Session bound to wrong platform | Use --session android for Android, close session and rebind |
| Simulator already booted (error 149) | Safe to ignore — simulator is already running |
| App not installed | Build and install: npx expo run:ios or npx expo run:android |
| agent-device click hangs | Wrap with timeout: timeout 5 agent-device click 100 200 |
| CDP "Connection refused" | Ensure dev server is running: curl http://localhost:$METRO_PORT/status |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

