如何从 Android 设备获取 apk 文件? [英] How do I get an apk file from an Android device?

查看:39
本文介绍了如何从 Android 设备获取 apk 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从安卓设备获取 apk 文件?或者如何将 apk 文件从设备传输到系统?

How do I get the apk file from an android device? Or how do I transfer the apk file from device to system?

推荐答案

使用 adb.使用 adb pull ,当设备连接 USB 时,您可以将文件从设备复制到系统.

Use adb. With adb pull you can copy files from your device to your system, when the device is attached with USB.

当然,您还需要正确的权限才能访问您的文件所在的目录.如果没有,您需要先对设备进行 root.

Of course you also need the right permissions to access the directory your file is in. If not, you will need to root the device first.

如果您发现很多 APK 都被命名为base.apk";您还可以使用这一单行命令从您可以访问的手机中提取所有 APK,同时重命名任何base.apk".名称到包名称.这也修复了名称后带有看似随机字符的 APK 路径的目录未找到问题:

If you find that many of the APKs are named "base.apk" you can also use this one line command to pull all the APKs off a phone you can access while renaming any "base.apk" names to the package name. This also fixes the directory not found issue for APK paths with seemingly random characters after the name:

for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do 
  adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"
  mv base.apk $i.apk &> /dev/null 
done

如果您收到adb: error: failed to stat remote object"这表明您没有所需的权限.我在非 root 用户的 Moto Z2 上运行此程序,并且能够下载除 youtube 之外我没有卸载的所有 APK(见下文).

If you get "adb: error: failed to stat remote object" that indicates you don't have the needed permissions. I ran this on a NON-rooted Moto Z2 and was able to download ALL the APKs I did not uninstall (see below) except youtube.

adb shell pm uninstall --user 0 com.android.cellbroadcastreceiver   <--- kills presidential alert app!

(查看用户运行 adb shell pm list users)这是一种删除/卸载几乎任何应用程序的方法(不是从手机上,因为它恢复出厂设置)没有root 包括系统应用程序(提示烦人的更新应用程序是否更新您的电话线可以通过搜索ccc"找到)

(to view users run adb shell pm list users) This is a way to remove/uninstall (not from the phone as it comes back with factory reset) almost ANY app WITHOUT root INCLUDING system apps (hint the annoying update app that updates your phone line it or not can be found by grepping for "ccc")

这篇关于如何从 Android 设备获取 apk 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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