Skip to content

ADB

Android Debug Bridge is the tool to communicate with virtuals or physical android devices.

Start/Stop adb server

Bash
# Start
adb start-server
# Stop
adb kill-server

List all devices connected

Bash
adb devices
# List devices with informations about OS and model
adb devices -l

Reboot the device

Bash
adb reboot
# Reboot on the bootloader mode
adb reboot bootloader

Install an apk

Bash
adb install <app.apk>
# Reinstall app
adb install <app.apk>

Get informations about a installed app

Bash
adb shell dumpsys package <packageName>

Android shell

Execute a shell command

Bash
adb -s <device> shell <command>

Get / Quit an interactive shell

Bash
# Get an interactive shell with the last device connected
adb shell
# Quit
exit

Get logs from your android device

Bash
adb logcat

List process informations

Bash
# List all process
ps -A
# To find information about a specific app with grep
ps -A | grep <packageName>

Call an intent

Bash
run-as <com.andsec.tp2.filedisclosure>

Packages manager

List packages

Bash
pm list packages
# Disabled apps
pm list packages -d 
# Enabled apps
pm list packages -e

Uninstall package

Bash
pm uninstall -k --user 0 <app.apk> 

Get apk path

Bash
pm path <packageName>

Files

Push / Pull files beetween connected device and computer

Bash
# Push
adb push <computer.file.path> /sdcard/<device.path>
# Pull
adb pull /sdcard/<device.path> <computer.file.path> 

Sources