Android debug bridge (adb) can be used to transfer an apk from mobile to computer over usb port. This can be useful when you are developing an android mobile app and for some reasons want to view apk installed on android mobile. We’ll use Mac for the purpose of this article. Here are the steps to transfer android apk from android mobile using adb:
- First ensure that android SDK (needed for adb tool) is installed on your computer and android usb debugging is enabled on your android device.
-
First list all packages using adb and look for the desired package.
$ adb -d shell pm list packages package:com.lenovo.leos.simsettings package:com.lenovo.recorder package:com.qualcomm.gsmtuneaway ...
-
We’ll transfer the apk for Dropbox package package com.dropbox.android for the purpose of this article. Run the following command to find the path of apk file for package com.dropbox.android:
$ adb -d shell pm path com.dropbox.android package:/data/app/com.dropbox.android-2/base.apk
-
Run adb pull command to pull the apk from the path obtained for the package:
$ adb -d pull /data/app/com.dropbox.android-2/base.apk 4357 KB/s (38810708 bytes in 8.697s)
-
In case you wish to view the content of apk you can use unzip as apk is a zipped file.
$ unzip -d base base.apk
This will create a directory base and unzip base.apk into it.