HID
Uses an ESP32-S3 board with ketec firmware, plugged into the iPhone over USB. The phone sees a real mouse and keyboard. No computer is needed after setup. Endpoints: /api/hid/*.
Quick start
Install the iPhone app, pick a run mode, finish the one-time setup, then control the phone over HTTP or with a script.
ketec is distributed through Apple TestFlight. You need an iPhone with iOS 15 or later and the free TestFlight app from the App Store.
On a computer: scan this code with the iPhone camera. On the iPhone: tap the button.
https://testflight.apple.com/join/5EDDv4vG
When ketec is open it runs a small HTTP service on the phone. Everything else — scripts, HTTP calls, AI tools — talks to that service.
phone-ip:9800. 9800 is the default port.Both modes run the same scripts and the same HTTP API. They differ in how taps reach the system. Switch modes in the app's Settings tab.
Uses an ESP32-S3 board with ketec firmware, plugged into the iPhone over USB. The phone sees a real mouse and keyboard. No computer is needed after setup. Endpoints: /api/hid/*.
No extra hardware: taps go through Apple's on-device test automation service, and you also get the UI tree and node selectors. It needs a one-time activation from a computer over USB with ketec Activator. Endpoints: /api/control/*.
Download ketec Activator for macOS or Windows, connect the iPhone with a cable and click Activate. Then switch the run mode to Agent in ketec Settings.
Plug in the HID board, then open Settings → Features in ketec. Each item opens the right iOS Settings page and lists what to change. Do it once per phone.
Tap Add Proxy Service and Add Auto Launch to add the bundled shortcuts to the Shortcuts app. The board uses them to bring ketec back if iOS suspends it.
Accessibility → Touch → AssistiveTouch: turn it on, turn on Show Onscreen Keyboard, turn off Always Show Menu, and drag Tracking Sensitivity all the way right. Then lock portrait orientation in Control Center.
With the board connected, drag Tracking Speed all the way left.
Accessibility → Keyboards → Full Keyboard Access: turn it on, then set Auto-Hide to on with 1 second.
Display & Brightness → Auto-Lock → Never, so the screen stays available to your scripts.
In Features, tap each hotkey item and choose Set Up Hotkey. ketec opens AssistiveTouch → Devices and presses the board's button for you, so iOS can record it.
From any computer on the same network. Replace phone-ip with the address on the Status tab.
# Is the phone reachable? Shows app version, iOS version, model and run mode curl http://phone-ip:9800/api/status # Take a screenshot curl -o screen.jpg http://phone-ip:9800/api/screenshot # Tap at (540, 1200) in screen pixels — HID mode curl "http://phone-ip:9800/api/hid/click?x=540&y=1200" # Same tap in Agent mode curl "http://phone-ip:9800/api/control/click?x=540&y=1200"
Every endpoint is listed in the HTTP API reference and in machine-readable form at /api/openapi.yaml (OpenAPI 3.1; JSON at /api/openapi.json).
Scripts run on the phone itself, so they keep going without a computer. The quickest way to try one is to post JavaScript to /api/runScript; the value of the last expression comes back as the result.
curl -X POST http://phone-ip:9800/api/runScript \
-H "Content-Type: application/json" \
-d '{"script":"var hits = appleOcr.findTextAbs(\"screen\", [\"Settings\"]); hits.length ? action.click(hits[0].centerX, hits[0].centerY) : \"not found\""}'For real projects, put scripts/main.js (or main.lua / main.py) in a script package and install it from the app's Packages tab. Same modules and function names in all three languages.
// Open Settings, find "General" with on-device OCR and tap it
system.startApp("com.apple.Preferences");
sleep(1500);
var hits = appleOcr.findTextAbs("screen", ["General"]);
if (hits.length > 0) {
action.click(hits[0].centerX, hits[0].centerY);
}All modules and functions: script API reference.
ChatGPT, Claude, Cursor and other assistants can write ketec scripts and HTTP calls for you. Paste this into your assistant to give it everything it needs.
I am automating an iPhone with ketec (https://ketec.top). Read these before answering: - Overview for AI: https://ketec.top/llms.txt - Full docs in one file: https://ketec.top/llms-full.txt - HTTP API (OpenAPI 3.1): https://ketec.top/api/openapi.json - Script API (JSON): https://ketec.top/api/script-api.json My phone's ketec service is at http://phone-ip:9800 and runs in HID mode. Task: <describe what you want to automate>
Tell the assistant which run mode you use: HID mode uses /api/hid/*, Agent mode uses /api/control/*.