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


当前回答

如上所述,您可以通过使用adb中的pull命令来获得apk。

由于您正在讨论已安装的应用程序,请继续查看Android文件系统的/data/app目录。你会在那里找到APK。

然后使用adb命令- adb pull /data/data/appname.apk

其他回答

你可以这样做:

Download and install APK Extractor in your device. It is free, and is compatible in almost all of the Android devices. Another plus point is it does not even require root or anything to work. After you have it installed, launch it. There you will see a list of apps which are in your device, which include the apps you’ve installed later, along with the system apps. Long press any app you want to extract (you can select multiple or all apps at once), and click on the extract option you see in the top. You will also have the option to share via Bluetooth or messaging. You’re done, you will see the extracted apps as AppName_AppPackage_AppVersionName_AppVersionCode.apk, which will be saved in the path /sdcard/ExtractedApks/ by default.

android中如何提取apk文件的详细说明,请访问:http://appslova.com/how-to-extract-apk-files-in-android/

不需要root:

这段代码将获得第三方包的路径和名称,以便您可以轻松识别您的APK

adb shell pm list packages -f -3

输出将是

包:/ / app / XX.XX.XX.apk = YY.YY.YY数据

现在使用下面的代码拉出这个包:

adb pull /data/app/XX.XX.XX.apk

如果你在C:>\中执行上面的cmd命令,那么你会在那里找到这个包。

完成@Yojimbo的回答,这是我所做的(只适用于Linux/Mac,不会在Windows上开箱工作……可能在git的bash shell中):

for i in $(adb shell pm list packages -f -3 | cut -d= -f 1 | cut -d ":" -f 2); do adb pull $i; done

这是一个丑陋的bash,但工作:)

编辑: 它不再适用于AndroidM:所有文件都命名为“base.apk”在另一个目录下。应该是“微不足道的”修复。

如果你知道(或者你能“猜”到)。apk的路径(它的格式似乎是/data/app/com.example.someapp-{1,2,..}.apk to),那么你也可以从/data/app中复制它。这个功能甚至在我的非根安卓手机上也能运行。

只需使用终端模拟器应用程序(比如这个)并运行:

# step 1: confirm path
ls /data/app/com.example.someapp-1.apk
# if it doesn't show up, try -2, -3. Note that globbing (using *) doesn't work here.
# step 2: copy (make sure you adapt the path to match what you discovered above)
cp /data/app/com.example.someapp-1.apk /mnt/sdcard/

然后你可以把它从sd卡移到任何你想要的地方(或附加到电子邮件等)。最后一点在技术上可能是可选的,但它使您在尝试使用.apk文件时更加轻松。

不需要Root和ADB工具的方法。 从游戏商店安装MyAppSharer应用程序。