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


当前回答

C:\Users\xyz>adb shell pm list packages -f | findstr whatsapp
package:/data/app/com.whatsapp-1/base.apk=com.whatsapp

C:\Users\xyz>adb pull /data/app/com.whatsapp-1/base.apk Desktop
/data/app/com.whatsapp-1/base.apk: 1 f.... 13.8 MB/s (32803925 bytes in 
2.269s)

其他回答

你可以这样做:

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/

在unix系统上,您可以尝试这个函数:

function android_pull_apk() {
    if [ -z "$1" ]; then
        echo "You must pass a package to this function!"
        echo "Ex.: android_pull_apk \"com.android.contacts\""
        return 1
    fi

    if [ -z "$(adb shell pm list packages | grep $1)" ]; then
        echo "You are typed a invalid package!"
        return 1
    fi

    apk_path="`adb shell pm path $1 | sed -e 's/package://g' | tr '\n' ' ' | tr -d '[:space:]'`"
    apk_name="`adb shell basename ${apk_path} | tr '\n' ' ' | tr -d '[:space:]'`"

    destination="$HOME/Documents/Android/APKs"
    mkdir -p "$destination"

    adb pull ${apk_path} ${destination}
    echo -e "\nAPK saved in \"$destination/$apk_name\""
}

例如:android_pull_apk com.android.contacts 注意:识别包:adb shell pm列表包

这对那些寻求非技术性答案的人很有帮助

这是一个简单的hack

从谷歌播放商店下载App Share/Send Pro选择要发送的应用程序和方法发送应用程序。

我通常使用蓝牙将应用程序发送到我的电脑或其他手机上。

试试这个bash命令来备份你所有的应用程序:

for package in $(adb shell pm list packages -3 | tr -d '\r' | sed 's/package://g'); do apk=$(adb shell pm path $package | tr -d '\r' | sed 's/package://g'); echo "Pulling $apk"; adb pull -p $apk "$package".apk; done

这个命令来自于Firelord的脚本。我只是将所有apks重命名为它们的包名,以解决elcuco的脚本问题,即相同的base.apk文件被覆盖在Android 6.0“棉花糖”及以上。

注意,这个命令只备份第三方应用,因为我不认为备份内置应用有什么意义。但如果你也想备份系统应用程序,只需省略-3选项。

适用于所有Android版本的一行代码:

adb shell 'cat `pm path com.example.name | cut -d':' -f2`' > app.apk