Control Your Android Phone with ADB
ADB, or Android Debug Bridge, is a tool that lets you send commands to your Android phone from your computer. It's really helpful for developers, testers, and anyone who wants more direct control.
Here are some commands you might find useful:
Getting into the Phone's Shell
Your Android phone has a command line inside. You can get to it with this command:
adb shell
Managing Apps
You can install, update, or uninstall apps using ADB.
Install an APK
adb install MyApp.apk
Force Update or Reinstall (Keep Data)
Use this if you want to update an app but keep all its data.
adb install -r MyApp.apk
Uninstall an App
To remove an app:
adb uninstall MyApp.apk
Capturing Your Screen
Take pictures or videos of what's on your phone's screen.
Capture an Image (Screenshot)
adb shell screencap -p /sdcard/image.png
Capture a Video (Screenrecord)
adb shell screenrecord -p /sdcard/video.mp4
Get Files from Your Phone
After capturing, you'll want the file on your computer. Use pull
.
adb pull /sdcard/image.png ./
(Replace /sdcard/image.png
with your file's location and ./
with where you want to save it on your computer)
Controlling Device Display Features
Toggle things like showing where you touch the screen.
Enable Show Touches
adb shell content insert \
--uri content://settings/system \
--bind name:s:show_touches \
--bind value:i:1
Disable Show Touches
adb shell content insert \
--uri content://settings/system \
--bind name:s:show_touches \
--bind value:i:0