使用 adb 命令获取已安装应用的 APK [英] get APK of installed app with adb command

查看:68
本文介绍了使用 adb 命令获取已安装应用的 APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的 Android 手机上获取已安装应用的 APK 文件,我遵循了这个答案 表示不需要 root 访问.

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.

我知道 Facebook 应用程序包名称是 com.facebook.katana,我用命令 adb shell pm list package 看到它.

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

它返回:

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

然后,我通过以下方式将 apk 文件拉到我的计算机上:

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

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

但是输出是:

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

为什么我无法获得 APK,但该答案说它有效?

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

推荐答案

通过设置目标路径将 APK 文件从 Android 设备拉到开发盒中.

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

或使用,

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

这篇关于使用 adb 命令获取已安装应用的 APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆