spawn_and_inject
Automatically kill, relaunch, and inject Frida code into an Android app at startup to hook early lifecycle methods.
Instructions
Kill app, relaunch, connect, and inject script in one step. Use this when you need to hook early initialization (e.g. onCreate, static initializers). Equivalent to: kill_app -> launch_app -> connect -> execute.
Args: package: The app package name (e.g. com.taobao.taobao). script: Frida JavaScript code to inject at startup. Use send() to return data. script_file: Path to a .js file to inject. Use this for large scripts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"package": "<package>"
},
"name": "spawn_and_inject"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | ||
| script | No | ||
| script_file | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |