Repository navigation
Device
The quick device commands. For the forensic acquisition, see device acquire.
- Phone connected, USB debugging on, this computer authorized on the phone. See Connecting a phone.
- No
adbserver running on the computer (adb kill-server). - The phone unlocked: required for the first authorization, recommended after.
| Option | Meaning |
|---|---|
--serial <SERIAL> |
the phone to use when several are plugged in (device listen prints the serials) |
--tcp <HOST[:PORT]> |
legacy ADB over TCP instead of USB, after adb tcpip 5555; port 5555 by default |
--adb-key <PATH> |
another ADB private key (default ~/.android/adbkey, created on first use) |
device listen takes none of them.
--case-id, --examiner, --case-notes, --seal: recorded in the evidence
bundle written by --evidence <dir>.
Waits until an ADB phone is connected over USB, prints its serial, exits.
apex device listen # wait forever
apex device listen --timeout 60 # exit 1 after 60 s without a phone
apex device listen --interval 2 # poll every 2 s (default 1)Use it to check the cable, the USB mode and the debugging prompt before a long command.
Third-party (user-installed) packages.
apex device listThe phone's own security posture, not its apps: Verified Boot and bootloader lock, SELinux mode, root indicators, storage encryption, security-patch age, developer options / ADB / mock location, global HTTP proxy, accessibility services and notification listeners enabled, device-admin apps, known stalkerware, and the remote-wipe check (printed first).
apex device posture
apex device posture --detail # evidence under each finding
apex device posture --json -o posture.json
apex device posture --evidence ./posture-bundle --case-id 2026-0142
apex device posture --fail-on high # exit 1 if a High or Critical findingRoot and verified-boot signals come from system properties, which can be spoofed: they are indicators, not attestation.
Pulls each third-party APK, runs the static analyzers, and adds what is
active on the phone: permissions granted (not only requested), install
source, DEBUGGABLE / TEST_ONLY flags, risky app-ops (overlay, all-files
access, installing other apps).
apex device scan # every third-party app
apex device scan --package com.foo.bar # one app
apex device scan --json -o reports/ # one JSON per app
apex device scan --no-runtime # static analysis only
apex device scan --evidence ./scan-bundle --fail-on highTakes a few seconds per app (APK size dominates).
Pulls the third-party APKs (all splits) and basic device info, nothing else.
apex device dump -o ./apks # default ./apex_dump
apex device dump --package com.foo.bar -o ./apksThen analyze them offline with apex analyze ./apks.
Runs one shell command as the shell user and prints its output. For
debugging and checks; nothing is recorded in a case.
apex device shell "getprop ro.build.version.release"
apex device shell "ls -la /sdcard/Download"Anything you run here changes nothing in a case's evidence, but it is still an action on the phone: note it if it is part of an examination.
APEX · mlab-sh/apex · This wiki is generated from the repository's wiki/ folder: edit it there, not here.
Getting started
On the phone
From an extraction
Analysis
Reporting and procedure
Static analysis
Concepts