iOS

Frida iOS Reference

Operational Modes

ModeRequirementsCapabilities
With JailbreakCydia + Frida repoSystem services, all apps, full instrumentation
Without JailbreakiOS 13+, Developer Disk Image, Gadget dylibDebuggable apps only

With Jailbreak

Prerequisites

Device Setup

  1. Open Cydia on the iOS device.
  2. Navigate to Manage → Sources → Edit → Add.
  3. Enter repository URL: https://build.frida.re
  4. Search for and install the Frida package.

This installs frida-server as a daemon that accepts connections over USB.

Smoke Test

Plug in the iOS device via USB and run on the host:

1frida-ps -U

Expected output (device connected):

 PID NAME
 488 Clock
 116 Facebook
 312 IRCCloud
1711 LinkedIn
…

If the device is not yet connected:

Waiting for USB device to appear...

Linux note (Frida < 6.0.9): USB (-U) is not supported. Use WiFi with an SSH tunnel:

1ssh -L 27042:localhost:27042 root@<device-ip>
2frida-ps -R   # -R = remote (localhost:27042)

Frida 6.0.9+ has usbmuxd integration; -U works directly.

Example: Trace Crypto Calls in an App

Target: Twitter app on device. Traces all variants of CCCryptorCreate from Apple’s libcommonCrypt.dylib.

1frida-trace -U -i "CCCryptorCreate*" Twitter

Sample output during attach:

Uploading data...
CCCryptorCreate: Auto-generated handler …/CCCryptorCreate.js
CCCryptorCreateFromData: Auto-generated handler …/CCCryptorCreateFromData.js
CCCryptorCreateWithMode: Auto-generated handler …/CCCryptorCreateWithMode.js
CCCryptorCreateFromDataWithMode: Auto-generated handler …/CCCryptorCreateFromDataWithMode.js
Started tracing 4 functions. Press Ctrl+C to stop.

Trigger network activity in the app; expected trace output:

3979 ms  CCCryptorCreate()
3982 ms  CCCryptorCreateWithMode()
3983 ms  CCCryptorCreate()
3983 ms  CCCryptorCreateWithMode()

The auto-generated .js handler files can be live-edited while the trace is running. Consult man CCryptorCreate for argument details to extend the handlers.


Without Jailbreak

How It Works

Frida injects Gadget automatically into debuggable apps. No frida-server or root access is required. Automatic injection was introduced in Frida 12.7.12.

Prerequisites

RequirementDetails
iOS versioniOS 13 or newer (recommended). Older versions are experimental.
Developer Disk ImageMust be mounted on the device. Xcode mounts it automatically on USB discovery; or use ideviceimagemounter manually.
Gadget dylibMust be present locally. On macOS: ~/.cache/frida/gadget-ios.dylib. Exact path shown in error output if missing.
App typeMust be a debuggable app (i.e., built with get-task-allow entitlement). App Store apps are not debuggable.

Workflow

  1. Ensure Gadget is cached locally (download via frida CLI; it will show the exact path in the error message if absent).
  2. Mount the Developer Disk Image (Xcode does this automatically).
  3. Attach to a debuggable app — Frida injects Gadget automatically:
1frida -U -f com.example.MyApp

Building Custom Tools

Use the Frida APIs to build programmatic instrumentation tools.

Key substitution for USB-connected iOS devices:

Replace any frida.attach(...) call with:

1frida.get_usb_device().attach(...)

Relevant API references:


Quick Reference

TaskCommand
List processes on USB devicefrida-ps -U
Attach to running appfrida -U -n AppName
Spawn and attach to appfrida -U -f com.bundle.id
Trace function by name patternfrida-trace -U -i "FunctionName*" AppName
Use WiFi tunnel (old Linux)frida-ps -R (after SSH tunnel on port 27042)