如何从android设备获取apk文件?或者如何将apk文件从设备传输到系统?
当前回答
不需要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命令,那么你会在那里找到这个包。
其他回答
这对那些寻求非技术性答案的人很有帮助
这是一个简单的hack
从谷歌播放商店下载App Share/Send Pro选择要发送的应用程序和方法发送应用程序。
我通常使用蓝牙将应用程序发送到我的电脑或其他手机上。
如上所述,您可以通过使用adb中的pull命令来获得apk。
由于您正在讨论已安装的应用程序,请继续查看Android文件系统的/data/app目录。你会在那里找到APK。
然后使用adb命令- adb pull /data/data/appname.apk
想要非常非常舒服的一分钟解决方案吗?
只需你这个应用程序https://play.google.com/store/apps/details?id=com.cvinfo.filemanager(智能文件管理器从谷歌发挥)。
点击“应用程序”,选择一个,然后点击“备份”。它将在你的文件系统的app_backup文件夹;)
你可以这样做:
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/
还有另一个bash脚本(即可以用于大多数基于unix的系统)。基于佩德罗·罗德里格斯的回答,但更容易使用。
对佩德罗版本的改进:
Original approach did not work for me on Android 7: adb pull kept complaining about no such file or directory while adb shell could access the file. Hence I used different approach, with temporary file. When launched with no arguments, my script will just list all available packages. When partial package name is provided, it will try to guess the full package name. It will complain if there are several possible expansions. I don't hardcode destination path; instead APKs are saved to current working directory.
保存到一个可执行文件:
#!/bin/bash
# Obtain APK file for given package from the device connected over ADB
if [ -z "$1" ]; then
echo "Available packages: "
adb shell pm list packages | sed 's/^package://'
echo "You must pass a package to this function!"
echo "Ex.: android_pull_apk \"com.android.contacts\""
exit 1
fi
fullname=$(adb shell pm list packages | sed 's/^package://' | grep $1)
if [ -z "$fullname" ]; then
echo "Could not find package matching $1"
exit 1
fi
if [ $(echo "$fullname" | wc -l) -ne 1 ]; then
echo "Too many packages matched:"
echo "$fullname"
exit 1
fi
echo "Will fetch APK for package $fullname"
apk_path="`adb shell pm path $fullname | sed -e 's/package://g' | tr '\n' ' ' | tr -d '[:space:]'`"
apk_name="`basename ${apk_path} | tr '\n' ' ' | tr -d '[:space:]'`"
destination="${fullname}.apk"
tmp=$(mktemp --dry-run --tmpdir=/sdcard --suffix=.apk)
adb shell cp "${apk_path}" "$tmp"
adb pull "$tmp" "$destination"
adb shell rm "$tmp"
[ $? -eq 0 ] && echo -e "\nAPK saved in \"$destination\""
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- 碎片中的onCreateOptionsMenu
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- DSL元素android.dataBinding。enabled'已过时,已被'android.buildFeatures.dataBinding'取代
- ConstraintLayout:以编程方式更改约束
- PANIC: AVD系统路径损坏。检查ANDROID_SDK_ROOT值
- 如何生成字符串类型的buildConfigField
- Recyclerview不调用onCreateViewHolder
- Android API 21工具栏填充
- Android L中不支持操作栏导航模式
- 如何在TextView中添加一个子弹符号?
- PreferenceManager getDefaultSharedPreferences在Android Q中已弃用
- 在Android Studio中创建aar文件