Quick start

From install to your first tap in about ten minutes.

Install the iPhone app, pick a run mode, finish the one-time setup, then control the phone over HTTP or with a script.

1. Install ketec from TestFlight

ketec is distributed through Apple TestFlight. You need an iPhone with iOS 15 or later and the free TestFlight app from the App Store.

QR code for the ketec TestFlight invite link

On a computer: scan this code with the iPhone camera. On the iPhone: tap the button.

Join on TestFlight

2. Open the app and find its address

When ketec is open it runs a small HTTP service on the phone. Everything else — scripts, HTTP calls, AI tools — talks to that service.

  • The Status tab shows the phone's address and port, for example phone-ip:9800. 9800 is the default port.
  • Your computer must be on the same Wi‑Fi network as the phone to reach it.
  • Keep ketec running. It stays alive in the background, and the service stops if you swipe the app away.

3. Pick a run mode

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.

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/*.

Agent

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.

4. One-time setup (HID mode)

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.

  1. Add the two shortcuts

    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.

  2. AssistiveTouch

    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.

  3. Trackpad & Mouse

    With the board connected, drag Tracking Speed all the way left.

  4. Full Keyboard Access

    Accessibility → Keyboards → Full Keyboard Access: turn it on, then set Auto-Hide to on with 1 second.

  5. Auto-Lock

    Display & Brightness → Auto-Lock → Never, so the screen stays available to your scripts.

  6. Bind the hotkeys

    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.

5. Send your first command

From any computer on the same network. Replace phone-ip with the address on the Status tab.

terminal
# 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).

6. Run your first script

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.

terminal
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.

scripts/main.js
// 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.

Use ketec with an AI assistant

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.

prompt.txt
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/*.

Next steps