Everything the Android Devices dialog does is also on the ZAP API, under the zaptun component, for scripts, CI and ZAP running headless. Progress and the reasons for failures are written to ZAP’s log (zap.log).
serial): the third-party apps installed on a device.serial, apps): sets the device up and starts capturing its traffic. Without a serial, the only connected device is used. apps is an optional, comma-separated list of package names; leave it out to capture every app.serial): stops capturing.curl "http://localhost:8080/JSON/zaptun/view/devices/?apikey=$KEY"
curl "http://localhost:8080/JSON/zaptun/action/intercept/?apikey=$KEY&serial=emulator-5554&apps=com.example.app"
curl "http://localhost:8080/JSON/zaptun/action/stop/?apikey=$KEY&serial=emulator-5554"
curl "http://localhost:8080/JSON/zaptun/action/setOptionSdkPath/?apikey=$KEY&String=/opt/android-sdk"
The options can also be set when starting ZAP, e.g. zap.sh -daemon -config zaptun.sdkPath=/opt/android-sdk.
| zaptun: Android Interception | the add-on’s main page | |
| Options | what the adb options mean |