Your first automation
ApplesauceOS lets you write JavaScript that controls apps on a jailbroken iPhone or iPad. You can find buttons by their UI properties, simulate gestures, read text with OCR, and organize a task into reusable scripts. You can build scripts yourself in the app or connect an MCP-compatible agent from your computer.
Before you begin
Use the ApplesauceOS package supplied for your device’s jailbreak. Open the installed app and keep the device unlocked while testing. An app you want to inspect must have its helper enabled; check Settings → Blacklist if UIHelper is unavailable. These instructions do not require source code, build tools or SSH.
Run the included example
Open Scripts and tap the play button next to Welcome.cso. It visits Home Screen pages and opens Settings. It avoids translated Settings menu labels. Open the project to inspect its files. Your copy is preserved across package upgrades.
Create a small script
- Open ApplesauceOS → Scripts → + → Create script.
- Name it
Hello.jsand paste the code below. - Tap Run. Run saves first; Save only writes the file.
- Open Runs to inspect the output. Use Stop there to request cancellation.
if (!openApp("com.apple.Preferences")) {
throw new Error("Could not open Settings");
}
console.log("Foreground:", frontMostAppId());
showNotice("Settings opened", 2);This opens Settings without relying on screen size or language. It does not change a setting. Opening an app does not guarantee that a particular screen has finished loading: wait for an element before interacting with it.
Add a step using the inspector
Open a script, switch to the app you want to automate, and press both volume buttons together. Select a control in the inspector, open Details, and choose Insert code into script. Pick a UIHelper action or a simulated touch. Close the inspector before testing external actions.
The inserted code is a starting point. Check that its selector matches exactly one intended element, replace text placeholders, and add a check for the resulting screen. Reinspect after navigation: a temporary element reference is not a reusable selector.
Choose how to find a target
| What you can observe | Start with |
|---|---|
| Buttons, fields, labels and scroll views | UIHelper selectors and waits |
| Text drawn in a custom view | OCR |
| A recognizable image or color pattern | Visual matching |
| A gesture that must behave like a finger | swipe or tap |
| Automation from a computer | Connect an agent |
Read errors instead of guessing
Check the run’s output and the visible screen. The editor can open the error location from a failed run. A successful call only acknowledges that call: verify the screen or data that proves the task succeeded. Do not keep tapping when a selector or action fails.
Next: organize a project, handle interruptions, or browse every documented API.