Simulators emulators

From championswimmer/TwoFac · View interactive version

Simulators emulators is an AI agent skill from the GitHub repository championswimmer/TwoFac. How to list, pick, and boot Android emulators and iOS simulators for local app runs.

How to use this skill

Skill file

Skill: Simulators and Emulators

IMPORTANT:

Preferred iOS Simulator Name: iPhone 16 w Watch (local), iPhone 16 CI

Preferred Android Emulator Name: Pixel_9 (local), pixel_6 CI

Use this skill to discover local Android emulators and iOS simulators, pick a target interactively, and boot it before running the app.

It also supports clearing app data for a specific Android package or resetting an iOS Simulator app by uninstalling its bundle from a selected simulator.

Companion scripts

Common checks

Android emulators

List and pick

Run app on selected emulator

Use shell output to set ANDROID_SERIAL:

eval "$(node .agents/skills/simulators-emulators/scripts/android-emulator-picker.mjs --boot --shell)"
ANDROID_SERIAL="$ANDROID_SERIAL" ./gradlew :androidApp:installDebug
adb -s "$ANDROID_SERIAL" shell am start -n tech.arnav.twofac.app/.MainActivity
adb -s "$ANDROID_SERIAL" shell dumpsys activity activities | rg 'Resumed: ActivityRecord|mCurrentFocus|mFocusedApp'

When multiple emulators/devices are connected, always pass ANDROID_SERIAL (or adb -s <serial>) to avoid ambiguous target errors.

Clear app data on Android

The Android script uses adb shell pm clear <package> against the selected emulator. This keeps the app installed but removes its local state:

node .agents/skills/simulators-emulators/scripts/android-emulator-picker.mjs \
  --avd Pixel_8_API_34 \
  --clear-app-data tech.arnav.twofac.app

Use --boot as well if you want the script to explicitly boot the emulator first; the script will also boot automatically when --clear-app-data targets a stopped emulator.

iOS simulators

List and pick

Run app on selected simulator

Use shell output to set IOS_SIMULATOR_UDID:

eval "$(node .agents/skills/simulators-emulators/scripts/ios-simulator-picker.mjs --boot --shell)"
xcodebuild \
  -workspace iosApp/iosApp.xcworkspace \
  -scheme iosApp \
  -destination "platform=iOS Simulator,id=$IOS_SIMULATOR_UDID"

UDID is preferred over simulator name because names are often duplicated across runtimes.

Clear app data on iOS Simulator

For iOS Simulator, the script clears app data by uninstalling the selected app bundle with xcrun simctl uninstall <UDID> <bundleId>. This removes the app sandbox, so reinstall the app afterward before launching it again:

node .agents/skills/simulators-emulators/scripts/ios-simulator-picker.mjs \
  --udid "$IOS_SIMULATOR_UDID" \
  --clear-app-data tech.arnav.twofac.app

Script behavior notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.