get APK of installed app with adb command

2020-03-17 04:44发布

I try to get the APK file of installed app on my Android phone, I followed this answer which says no need for root access.

I know Facebook app package name is com.facebook.katana, I see it with command adb shell pm list package.

Then, I tried in command line:

adb shell pm path com.facebook.katana

It returns:

package:/data/app/com.facebook.katana-2/base.apk

Then, I pull the apk file to my computer by:

adb pull /data/app/com.facebook.katana-2/base.apk

But output is:

adb: error: remote object '/data/app/com.facebook.katana-2/base.apk' does not exist

Why I can not get the APK but that answer says it works?

标签: android adb apk
4条回答
The star\"
2楼-- · 2020-03-17 05:07

Try using adb pull to download a specified file from an emulator/device to your computer.

adb pull /data/app/com.facebook.katana-2/base.apk target/path   
查看更多
欢心
3楼-- · 2020-03-17 05:09

Install MyAppSharer from Google Play on the phone, run it, find your desired app, share it to your Google Drive (or email if file is small enough).

Works on Android 7.1, where the above adb pull commands don't work (at least not for me); says app doesn't exist. So just use the app, no need to run adb commands.

查看更多
何必那么认真
4楼-- · 2020-03-17 05:14

Insted of

adb pull /data/app/com.facebook.katana-2/base.apk

Use :

adb shell cat /data/app/com.facebook.katana-2/base.apk > app.apk

And your apk will be generated inside Your_Android_SDK_path\platform-tools

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2020-03-17 05:26

Pull the APK file from the Android device to the development box by setting destination path.

adb pull /data/app/com.facebook.katana-2/base.apk path/to/desired/destination

or use,

adb shell cat /data/app/com.facebook.katana-2/base.apk > app.apk 
查看更多
登录 后发表回答