Adb command-ments

Carlos Mota
Code, Procedure and Rants
6 min readSep 6, 2018

--

Copyright @ The Hacker News

If you’re an Android developer, it’s quite common that from time to time you end up needing one of these commands — well, no need to search on Google or open that favorite tab on Stack Overflow; I’m trying to sum up the most used here.

Notes:

  • These commands do not require your device to be rooted
  • You should replace [package] with your application package name
  • When two or more options are shown between brackets — you should select only one (for example, [install | uninstall])

In/uninstall a version on your device:

adb [install|uninstall] [flag] [apk]

Which on a real example, it would be something like:

adb install com.your.new.project.apk

If your app asks for runtime permissions and you’re running on Android 6.0+ you can add the flag -g to automatically grant access to all permissions:

adb install -g com.your.new.project.apk

Transfer files between your computer and your device

adb [push|pull] [source] [destination]

If you want to send a file to your phone — you just need to type:

adb push /path/to/filename /storage/emulated/0/

--

--

Carlos Mota
Code, Procedure and Rants

👨‍💻, 🔭🌖, 🗺, 📸, 🏃‍💨, 🇵🇹, 🖖 - is this how I should use emojis? Also: https://www.cafonsomota.xyz/