ADB & Frida Setup
Part 2 of the Android Pentest series. This is the boring-but-critical groundwork — get it wrong and every later technique fails in confusing ways.
Before you can inject a certificate or hook a function, you need a working ADB connection and a running Frida server that exactly matches your host. This part covers that foundation.
Prerequisites
Tools on your host machine:
| Tool | Check | Notes |
|---|---|---|
adb | adb version | Android SDK Platform-Tools (use the latest) |
frida | frida --version | Python package — install below |
objection | objection --version | Built on top of Frida |
openssl | openssl version | For certificate conversion (later parts) |
On the device:
- Root access (Magisk, SuperSU, or an
eng/userdebugbuild) - frida-server matching both your Frida host version and the device architecture (ARM, ARM64, x86, x86_64)
⚠️ Version mismatch is the #1 cause of Frida failures. Always match frida-server to
frida --versionon your host. Grab the exact release from Frida’s GitHub releases.
Check device architecture
You need this to download the correct frida-server binary.
adb shell getprop ro.product.cpu.abi
Inside an adb shell session you can also list every supported ABI:
getprop ro.product.cpu.abilist
This returns something like arm64-v8a,armeabi-v7a,armeabi. The first
entry is the primary architecture — use that when downloading frida-server.
Common results: arm64-v8a (most modern devices), x86_64 (emulators),
armeabi-v7a (older 32-bit devices).
ADB over Wi-Fi
Useful when USB is inconvenient or the device is across the room. Both device and host must be on the same network.
# 1. With USB still connected, switch ADB to TCP mode
adb tcpip 5555
# 2. Disconnect USB, then connect over Wi-Fi
adb connect <DEVICE_IP>:5555
📌 Edge case. Some devices reset to USB mode after a reboot — re-run
adb tcpipwith the cable connected. With multiple devices attached, target a specific one withadb -s <serial>.
Port forwarding
Port forwarding maps a local TCP port to a port on the device. This is essential for Frida and Objection over USB.
# Forward Frida's default port
adb forward tcp:27042 tcp:27042
# Verify the forward is active
adb forward --list
Install Frida tools on the host
pip install frida-tools objection
⚠️ Common mistake. The PyPI package is
frida-tools, notfridaalone. Installing justfridagives you the bindings without the CLI tools (frida,frida-ps,frida-ls-devices).objectiondepends onfrida-toolsand pulls it in automatically.
Run frida-server on the device
Download the matching frida-server from GitHub releases, push it, and run:
adb push frida-server-<version>-android-<arch> /data/local/tmp/frida-server
adb shell chmod +x /data/local/tmp/frida-server
adb shell /data/local/tmp/frida-server &
Verify it’s running:
frida-ps -U
A list of processes means you’re good. Nothing? The frida-server version almost certainly doesn’t match your host version exactly.
Frida over Wi-Fi
You can run frida-server listening on a network interface instead of USB:
# On device (adb shell)
./data/local/tmp/frida-server -l 0.0.0.0:8877 &
Then connect from the host with -H:
frida -H <DEVICE_IP>:8877 -f <package.name> -l script.js
⚠️ Security warning. Binding frida-server to
0.0.0.0exposes it to the entire network. Only do this on isolated test networks. For production-adjacent environments, bind to127.0.0.1and useadb forwardinstead.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
frida-ps -U shows nothing | frida-server not running or version mismatch | Re-check architecture and version; restart frida-server |
| Objection can’t connect | Port 27042 not forwarded | adb forward tcp:27042 tcp:27042 |
adb tcpip rejected | Charge-only USB mode or ADB not authorized | Enable USB debugging; accept the RSA prompt on device |
| App crashes on launch with Frida | Script error or incompatible hook | Use -f (spawn) not -F (attach); read the stack trace |
See also
- Previous: The Android CA Trust Store Across Versions
- Next: Certificate Injection — Android < 14
- Tools & Scripts