解决办法有两种:
1、AndroidManifest.xml中配置
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto" ></mainfest>
android:installLocation="auto" ></mainfest>
此行是配置让Android系统自行决定应用的安装位置。
使用这个方法,那么每个app需要这个配置,麻烦。
2、强制修改设备应用默认安装位置
1、连接上设备(确保安装驱动)
2、进入adb shell模式(在cmd中执行%sdk%/platform-tools/adb shell)
3、执行pm setInstallLocation
pm set-install-location 0 由App自行决定软件能否安装在SD卡
pm
set-install-location 1 强制全部App安装在ROM内
pm
set-install-location 2 强制全部App安装在SD卡
ps:网上教程大部分写的是pm setInstallLocation 0,但现在命令改为pm set-install-location 0了
这样一次搞定,以后不用每次都配置AndroidManifest.xml
本文介绍了两种解决Android应用安装位置问题的方法:一种是在AndroidManifest.xml文件中配置,另一种是通过adb shell命令强制修改设备应用默认安装位置。后者提供了一次性解决方式,避免了每次配置Manifest文件的繁琐。
3952

被折叠的 条评论
为什么被折叠?



