Simple command line tool for sending touch events to iOS Simulator.
Currntly Support for tap, swipe, and long press
Clone and install globally:
git clone https://github.com/yourusername/simtouch.git
cd simtouch
./install.shThis will:
- Build simtouch with optimizations
- Install it to
/usr/local/bin - Make it available globally as
simtouch
If you prefer to build without installing globally:
git clone https://github.com/yourusername/simtouch.git
cd simtouch
zig build -Doptimize=ReleaseSafeThe binary will be at ./zig-out/bin/simtouch
Make sure iOS Simulator is running before using simtouch.
Send a single tap at specific coordinates:
simtouch tap 200 300Perform a swipe gesture from one point to another:
simtouch swipe 100 500 100 100Hold a touch for a specified duration (in milliseconds):
simtouch longpress 200 200 2000- Coordinates are in pixels relative to the simulator window
- (0, 0) is the top-left corner of the device screen
- Example: iPhone 14 Pro is typically 393x852 pixels
The main idea behind it is to create a simple, lightweight tool that can be easily integrated with AI/LLM workflows through tool calling. I don't want to use complex automation frameworks, so this simple solution provides a minimal interface that LLMs can directly invoke to interact with.
- AI Testing - Let LLMs explore and test your iOS apps autonomously
- Fuzzing Agents - Where a couple of agents are interacting the app simultaneously
simtouch uses C's Core Graphics APIs to send mouse events to the Simulator window. The iOS Simulator automatically translates these mouse events into touch events for the running iOS application.
CGEvent (Mouse) → Simulator.app → UITouch → iOS App
#!/bin/bash
# Tap a button
simtouch tap 200 400
# Wait
sleep 1
# Swipe up
simtouch swipe 200 600 200 200
# Long press for context menu
simtouch longpress 150 300 1500import subprocess
def tap(x, y):
subprocess.run(["simtouch", "tap", str(x), str(y)])
def swipe(x1, y1, x2, y2):
subprocess.run(["simtouch", "swipe",
str(x1), str(y1), str(x2), str(y2)])
# Example usage
tap(200, 300)
swipe(100, 500, 100, 100)zig build -Doptimize=ReleaseSafe- Requires Simulator window to be visible
- Single touch only (no multi-touch gestures yet)
- Multi-touch support (pinch, rotate)
- Element finding by accessibility label
- Record and replay functionality
MIT License - see LICENSE file for details