looktap v0.10.0

Start

How it works

looktap ships its own small helper for each platform. Nothing is installed on simulators, emulators or Android devices. A real iPhone or iPad is the exception: it gets a small test runner (Using a real iPhone). The one Android exception is opt-in: looktap wifi --always installs a small app that keeps Wireless debugging on (built and signed on GitHub Actions, downloaded from the release; wifi --off removes it).

ItemiOS simulatorAndroid emulator / device
Read the screenlooktap-sim, a macOS helper that reads the simulator's accessibility tree through Apple's simulator frameworks (CoreSimulator, AccessibilityPlatformTranslation). Web content is found by probing the screenlooktap-server.jar, a 10 KB helper pushed to /data/local/tmp and run with app_process. It keeps one UiAutomation connection open
Tap, type, swipe, keysThe same helper, as touch and keyboard events through SimulatorKitThe same helper, as input events through UiAutomation
Clipboard (paste)simctl pbcopy, checked with simctl pbpaste; when Xcode 27's clipboard sync (dtpasteboardd) wins over it, the Mac's clipboard, which the sync carries in, then put backThe helper sets the clipboard as the shell (IClipboard), then the field's paste action or the paste key
Screenshots, burstThe simulator display's framebuffer, read in-processEmulators: the emulator's gRPC API, which also gets past FLAG_SECURE. Devices: the helper
Video (record)simctl io recordVideoscreenrecord on the device
Folding (fold)What Device Hub's fold buttons send: a vendor-defined HID report with the hinge angle, through dtuhidd. devicectl says which screen is lit, and the helper reads, touches and captures that one—
Orientation (rotate)The orientation event Simulator.app sends to the guest (the iPhone Duo: Device Hub's orientation report). Coordinates and frames are converted, so everything looktap prints and takes is as the user sees the screensettings (user rotation, auto-rotate off). The helper reports the turned display size
Logs, crasheslog show inside the simulator, and its .ips crash reportslogcat (by app uid), the crash buffer, and dumpsys activity exit-info
Home button, stopThe helper sends the hardware Home button; simctl terminateKEYCODE_HOME; am force-stop
Deep links, launch, biometricsxcrun simctladb and the emulator console

Each helper starts on first use, keeps running in the background, and is replaced automatically when looktap is upgraded. looktap setup starts it ahead of time, and looktap teardown stops it. The CLI talks to it over a local socket, using JSON lines.

iOS: private frameworks and Xcode versions

The iOS helper uses Apple's private simulator frameworks, the same ones idb uses. They can change between Xcode releases. looktap doctor checks they're present and shows which input path applies:

  • Xcode 26 and earlier (CoreSimulator below 1155.4): touches, keys and the Home button go through SimulatorKit's HID client ("indigo"). Tested.
  • Xcode 27 (CoreSimulator 1155.4 and later): touches, keys and the Home button go as XPC messages to the simulator's dtuhidd service ("dtuhid"), the same way idb does it. Tested on Xcode 27.1 with iOS 26 and iOS 27 simulators. Reading the screen and screenshots don't depend on it. Xcode 27.1 moved SimulatorKit to Contents/SharedFrameworks, which looktap 0.7.1 and later finds; it also replaced the Simulator app with Device Hub (see boot).

LOOKTAP_IOS_HID=indigo|dtuhid overrides the choice. It applies when the helper starts, so run looktap teardown first.

Using a real iPhone

A simulator can be driven from the Mac with nothing installed in it; a real iPhone or iPad can't. So the first command aimed at one builds a small XCUITest runner (native/ios-device), signs it with your Apple ID, and installs it. It reads the screen and taps, types and swipes through XCUITest, and looktap reaches it over USB or Wi-Fi (see how it connects below). Every looktap user signs the runner with their own Apple ID. A free one is enough; the paid Developer Program isn't needed.

Once per Mac and device:

  1. In Xcode → Settings → Accounts, sign in with your Apple ID. That gives you a "Personal Team".
  2. Pair the device with the Mac (connect it with a cable once and tap Trust; Wi-Fi works after that), and turn on Developer Mode on it: Settings → Privacy & Security → Developer Mode. (An iPhone on iOS 16 or older without a passcode needs no hand here: looktap setup -d <UDID> turns it on, see Older iPhones.)
  3. Unlock the device and run any command against it, for example looktap -d <hardware UDID> ls (looktap devices lists the UDID, and says what to do if the device isn't ready yet: Trust, Developer Mode). The first run builds the runner, which takes about a minute.
  4. With a free Apple ID, the device asks you to trust the developer the first time: Settings → General → VPN & Device Management → your Apple ID → Trust. Then run the command again.

If Xcode is signed in to more than one team, choose the one to sign with: LOOKTAP_TEAM=<team id>, or {"ios": {"team": "<team id>"}} in looktap.config.json. The error message lists your teams and their ids.

Picking the device: -d <hardware UDID> always picks it. Without -d, a paired device is used only when no simulator or emulator is running, so nothing changes for simulator workflows.

Signing expiry: a runner signed with a free Apple ID stops launching after 7 days, and one signed with a paid team after a year. looktap reads the expiry date and builds and signs the runner again before it lapses. If iOS refuses to launch it anyway (for example, after a certificate was revoked), looktap rebuilds it once and retries. Free Apple IDs have Apple's own limits too: about 3 devices and 10 app ids per 7 days, and at most 3 apps signed by the free account installed on one device at a time. The runner counts as one, so if the device is full, looktap names the apps it found and you delete one.

What works on a device: everything except location, network, push, statusbar, textsize, bio, record, permission, reset and crashes, which say so (on iOS 16 and older, location, route and crashes work); zoom works around the screen's centre only. logs reads the phone's live log (lockdown's syslog relay, as Console.app does), collected in the background from the first logs or launch on, since the phone keeps no history looktap can read. Only NSLog and os_log/Logger reach a device's log: Swift's print() never does, and logs says so when a debug build's own code shows nothing. prefs reads a development build's UserDefaults over house_arrest. perf reads CPU, memory and threads through Instruments (xcrun xctrace, part of Xcode), 10–25 s a reading, and perf --frames reads the screen over the USB cable, so it needs the phone plugged in rather than on Wi-Fi. Platform support has the reasons, and looktap capabilities prints them. A command takes about 1–1.5 s, slower than on a simulator, because XCUITest takes longer to read the screen.

The device must be unlocked while the runner starts. It keeps running until looktap teardown, or until the device is restarted. While the device is locked, commands that need the screen stop with "the device is locked" (stop still works), and looktap devices shows locked up front. --wait-unlock 60 (or "waitUnlock": 60 in the config, LOOKTAP_WAIT_UNLOCK=60) waits up to that many seconds for someone to unlock it instead, then runs the command; useful in a long flow, where the phone locks itself after a while. A runner can lose its permission to drive the screen while it keeps running (seen after the device sat idle); looktap then starts a fresh one, once, and carries on.

The runner app on the phone

The runner shows up on the home screen as looktap runner. Open it and it says what it is and how it's doing: which Mac is connected and how (USB or Wi-Fi), the last thing it did, how many actions and screen reads this session, when its build stops working and which team signed it, and its recent actions (typed text appears only as a character count). The Allow control switch stops looktap acting on the phone: while it's off, looktap can still read the screen and take screenshots, but taps, typing, swipes, launches and links are refused with "paused on the iPhone", until someone turns it back on on the phone. Stop the runner ends it; the next looktap command starts it again. Its Show touches switch is greyed out: iOS lets no app draw over another (see touches). Its Troubleshoot card shows the Link (how the Mac reached it: USB, Wi-Fi or the CoreDevice tunnel, the last command's round trip, marked slow over 3 s, and the routes tried first that didn't answer), Keep the screen on (no auto-lock while the runner is in front: iOS lets no app keep the screen on behind another, so for a test of another app, Open Auto-Lock settings and set it to Never), Restart the runner (a fresh test session; the next command starts it), Open Developer settings (Developer Mode, Enable UI Automation), and, since only one UI test session can drive an iPhone, the looktap who and release --all commands for this phone when another tool holds it.

On an Android phone looktap needs no app, but the same screen is there if you want it: looktap runner install puts looktap runner (com.looktap.app, Android 10+) on the phone and opens it. Its Allow control switch pauses looktap the same way ("paused on the phone"), and Show touches turns the pointer on and off for every app, in step with looktap touches on|off (it starts on). Its Troubleshoot card is for a phone looktap is slow to reach, or can't reach: the Link (USB or Wi-Fi, and the round trip looktap measured on its last command, marked slow over 3 s, and why when looktap moved it to Wi-Fi), a Wireless debugging switch (Android 11+: on, looktap drives the phone over Wi-Fi while USB is slow or stalled, with the cable still in), Keep it on (back on after a restart and whenever the phone joins Wi-Fi: the same as looktap wifi --always, which uses this app), Keep the screen on (so the phone doesn't lock mid-command: plugged in, USB counts, the screen never turns off, as Developer options' Stay awake; unplugged, it turns off after 30 minutes, and the phone's own timeout comes back when it's switched off), Restart looktap's helper (a fresh connection to the screen) and Open Developer options (to turn USB debugging off and on, which works even when the helper isn't running). It talks only to looktap's helper on the same phone, over the phone's own loopback, and the helper answers no other app. looktap runner remove takes it off.

How looktap reaches the phone

Each command tries, in order: USB (usbmuxd, when the cable is in), the CoreDevice tunnel (how Xcode itself reaches a phone on Wi-Fi, and what starts the runner), then usbmuxd's own Wi-Fi route. A network can block the last while the tunnel works. Plugging in a cable mid-session moves to USB at the next command, with no teardown.

When the runner is up on the phone but no route reaches it, looktap says so within about 20 s, with what each route answered, instead of waiting minutes: usually the network isolates its clients, or a VPN or firewall sits between the Mac and the phone. Plug in a cable and run the command again; the runner keeps running, so nothing restarts. looktap doctor -d <UDID> checks each step on the way: pairing, Developer Mode, the tunnel, usbmuxd, the lock screen, which routes the runner answers on, and the signing team.

Older iPhones (iOS 16 and earlier)

Xcode 27 no longer supports iOS 16 devices: it lists one without a UDID and won't build for it, install on it or start a test on it, and that's the way looktap reaches newer phones. So for an iPhone older than iOS 17, looktap does Xcode's part itself, through the services the phone's lockdown daemon offers over usbmuxd (USB, or Wi-Fi once paired):

After that it's like any other iPhone: looktap devices lists it as iOS 16.7 (through lockdown), and install, apps, uninstall, launch, stop and the screen commands work. location <lat> <lon> works too (the developer image's simulated location, as in Xcode), and crashes reads the phone's crash reports. perf doesn't (Instruments needs Xcode's support), but perf --frames does. looktap doctor -d <UDID> checks Developer Mode and the image.

Wear OS watches

A Wear OS watch is an Android device to looktap: ls, tap, shot, record, install and the rest work as on a phone, on its small round screen (a Galaxy Watch 4 is 198×198 dp). A watch has no USB port for adb, so it connects over Wi-Fi:

  1. On the watch: Settings → About watch → Software information → tap Software version five times. Then in Developer options turn on ADB debugging and Debug over Wi-Fi (or Wireless debugging), with the watch on the same Wi-Fi as this computer.
  2. If the watch shows only an address (192.168.1.96:5555): looktap connect 192.168.1.96:5555. If it offers Pair new device with a six-digit code: looktap pair <code> <host:port>.
  3. Accept Allow debugging? on the watch (tick "Always allow from this computer").

looktap devices then lists it as Wear OS (Android 11), and -d 192.168.1.96:5555 picks it. A Wear OS emulator (Android Studio's Device Manager → Wear OS) works the same way and lists as Wear OS (Android 14): looktap boot <AVD name>.

A watch's home is its watch face, its crown or button is key home, and an idle watch dims to its always-on face, with nothing to read: commands that act on the screen wake it first. looktap capabilities lists what a watch does differently (no rotation or fingerprint, for one).

A watch turns its Wi-Fi down while its screen is off, and a command sent then waits until it times out: keep it on its charger with Developer options → Stay awake while charging on, or lengthen its screen timeout (adb -s <id> shell settings put system screen_off_timeout 600000). Transfers can be slow for the first few minutes; leaving Bluetooth on is fine (the watch's apps need it to reach the phone). Debugging over Wi-Fi goes off when the watch restarts: turn it on and connect again.

Apple Watch simulators

An Apple Watch simulator is driven like an iPhone simulator, by the same helper: ls, tap, swipe, scrollto, shot, record, launch, logs, location, push, perf and the rest. looktap boot "Apple Watch Series 12 (46mm)" starts one, and devices --all lists them (watchOS 27.0). An iPhone simulator and a watch can run side by side: -d picks one.

A real Apple Watch can't be driven: it has no cable, and developer tools reach it only through its paired iPhone.

Android: the fallback path

If the helper can't start (for example, another tool holds UiAutomation), looktap falls back to plain adb + uiautomator dump. That works everywhere but takes about 2.5 s per screen read. LOOKTAP_ANDROID_HELPER=0 forces that path.

Generated from README.md. Edit it there.