to-ios-script
To iOS Script
Generate the smallest iOS runtime code that answers the requested runtime question. Prefer Driver for requested user-visible actions, use Override only when normal App configuration or Driver actions cannot establish a required condition, add Evidence only when needed to answer the question, and use Direct Frida only when the encapsulated capabilities are insufficient. Driver, Override, Evidence, and Direct Frida can compose within their API boundaries; use only what the question requires and avoid unnecessary probing. Generate code only; do not connect to a device or execute it.
Before generating code
Call get_sdk_declarations({"platform":"ios"}) to obtain declaration paths in files[].path. It returns sdk (platform SDK), bridge (Frida Objective-C bridge), and gum (native Frida APIs) declarations. The capability sections below specify which declarations to read.
Resolve presets.directory from <project-root>/.meu/config.json
relative to the project root, defaulting to .meu/presets. If <base-directory>/ios/
contains presets.dist.js, read presets.entry.js to identify public exports and the
corresponding feature probe.d.ts files for their contracts. Prefer reusing capabilities that
satisfy the request; import only names exported by the entry, including any aliases.
When reusing a preset, use Module mode and import its declared export, for example:
import { inspectPageState } from '/meu/presets.js';. Connect loads presets; generated code
only needs the import.