This guide only covers the install
, uninstall
, and debug
in adb.
- USB Lightning Cable
- Android Phone
- ADB Platforms Tools | Download Link: https://developer.android.com/studio/releases/platform-tools
- Installed Git Bash Terminal on Windows.
- Enabled USB Debugging on Android Phone
- Extract / unzip the platform tools zip file that you downloaded.
- Open the extracted files and find the
platform-tools
folder. - Navigate inside the folder and open the Git Bash Terminal from the current directory by right clicking and choosing
Git Bash Here
. - Connect your phone to the computer using the USB lightning cable. Make sure to accept the USB debugging prompt.
If you want to install the app into your phone run the command
./adb install path/to/apk/Appname.apk
Note: You need to specify the path/to/apk/
on where the apk file is located.
To make it not complicated, you can just paste your app inside platform-tools
directory and run ./adb install Appname.apk
Uninstalling the apk installed on your phone is as easy as installing it. You just need to know the package name of the app that you need to uninstall.
./adb uninstall com.org.testapp
Note: You need to specify the package name (com.org.testapp
) of the app. The com.org
is the domain name and testapp
is the name of the app.
If you are not quite sure what's the package name of the app that is installed on your phone, you check it on the app's settings.
Debugging the apk is done to see the process or services running underlying the installed application.
It is done using logcat command which prints logs of the running applicaiton.
./adb logcat
You can also filter logcat if you only want to see the logs from your application. It is mainly done using pid support in adb. To filter logcat to show logs of your application only, simply run:
./adb logcat --pid=`adb shell pidof -s com.org.testapp`
Note: com.org.testapp
should be replaced with your application package name.
Android Developer: Logcat command-line tool
StackOverFlow: Filter LogCat to get only the messages from My Application in Android