Frida Gadget Injection
Use this skill when normal attach is blocked, root or jailbreak is unavailable, or instrumentation must load from inside the target app.
Decide Gadget Mode
- Use
listenmode when a host should attach after the app starts. - Use
connectmode when Gadget should call back to a host. - Use
scriptmode for an embedded script that must run without an interactive host. - On jailed iOS, account for code-signing policy before relying on
Interceptor.
Android Shape
- Match Gadget architecture to APK ABI.
- Place the Gadget
.sowhere the app will load it. - Add the matching
.configfile beside Gadget. - Load the library early enough for the target behavior.
- Rebuild, sign, install, and run the app.
Example config:
{
"interaction": {
"type": "listen",
"address": "127.0.0.1",
"port": 27042
}
}
iOS Shape
- Match Gadget to device architecture and Frida version.
- Embed Gadget in the app bundle or dynamic library load path.
- Add the
.configfile named exactly like the Gadget binary plus.config. - Re-sign the app with the required entitlements.
- Launch the app and connect with Frida tools.
Verify
frida-ls-devices
frida-ps -Uai
frida -U Gadget
If Gadget does not appear, verify library load, config filename, app signing, architecture, and logs before editing hooks.
References
Read references/gadget-patterns.md for configuration examples and troubleshooting.