如何spcific应用从SD卡使用ADB移动到/? [英] How to move spcific apps to/from sd card using ADB?
问题描述
有可能通过使用(以 此设置默认安装到SD卡链接 ):
It is possible to set the default installation to the SD card by using (based on this link) :
为pre-API14:
for pre- API14 :
adb shell pm setInstallLocation 2
有关API 14及以上的:
for API 14 and above:
adb shell pm set-install-location 2 (Android 4.x)
问题
这仅适用于新安装的应用程序工程(或者你只是手动去了他们每个人,并将其设置在那里),但我想知道如何重新安装已安装的应用程序到SD卡(也回内部存储)。
The problem
This only works for newly installed apps (or you just go manually over each of them and set it there), but I would like to know how to re-install an already installed app into the SD card (and also back to the internal storage).
我想读通过ADB可用的命令,并试图运行下一个命令:
I tried to read the commands available via ADB, and tried to run the next command:
adb shell pm install -s -r -i com.example.test
但它没有工作。
假设一个应用程序已经被安装在内部存储(或SD卡),我该如何使用ADB将它重新安装到SD卡(或内部)?
Suppose an app is already installed on the internal storage (or the SD card), how can I use ADB to re-install it to the SD card (or the internal) ?
推荐答案
显然,需要提供APK的位置,而不是包的名称。
Apparently, need to provide the location of the APK rather than the package name.
在我结束之后工作了 VLC 我从Play商店安装,最初设在内部存储:
Following worked on my end for VLC that I installed from Play Store and was originally located in internal storage:
$ adb shell pm install -s -r /data/app/org.videolan.vlc.betav7neon-1.apk
pkg: /data/app/org.videolan.vlc.betav7neon-1.apk
Success
$
和移回内部存储:
$ adb shell pm install -f -r /mnt/asec/org.videolan.vlc.betav7neon-1/pkg.apk
pkg: /mnt/asec/org.videolan.vlc.betav7neon-1/pkg.apk
Success
$
更新1
以下是与各自的命令 -i:指定安装程序包的名称
选项
移动到SD卡:
$ adb shell pm install -i "com.android.vending" -s -r /data/app/org.videolan.vlc.betav7neon-1.apk
pkg: /data/app/org.videolan.vlc.betav7neon-1.apk
Success
移至内部存储:
$ adb shell pm install -i "com.android.vending" -f -r /mnt/asec/org.videolan.vlc.betav7neon-1/pkg.apk
pkg: /mnt/asec/org.videolan.vlc.betav7neon-1/pkg.apk
Success
更新2
使用 -i
是可选的,但如果不使用它的安装信息运动过程中丢失:
Update 2
Using -i
is optional, but if it is not used the installer information is lost during movement:
$ adb shell pm list packages -3 -i
package:org.videolan.vlc.betav7neon installer=com.android.vending
$ adb shell pm install -s -r /data/app/org.videolan.vlc.betav7neon-1.apk
pkg: /data/app/org.videolan.vlc.betav7neon-1.apk
Success
$ adb shell pm list packages -3 -i
package:org.videolan.vlc.betav7neon installer=null
希望这有助于。
这篇关于如何spcific应用从SD卡使用ADB移动到/?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!