get APK of installed app with adb command

2020-03-17 05:07发布

问题:

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?

回答1:

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 


回答2:

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



回答3:

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:

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   


标签: android adb apk