如何将应用程序安装到Android模拟器的SD卡而不是其内部存储器?

时间:2019-05-20 17:30:08

标签: android android-emulator

我找不到将应用程序安装到SD卡的方法,也找不到通过模拟器的Android设置UI在安装后移动它的方法。我的清单中确实有installLocation=auto,也尝试过preferExternal。这完全可行吗?

this old question,但已接受的答案不再起作用:

adb install -s .\app-debug.apk
Performing Streamed Install
adb: failed to install .\app-debug.apk:
Exception occurred while executing:
java.lang.IllegalArgumentException: New installs into ASEC containers no longer supported

这是与Android 9 Google Services x86_64映像一起提供的。

2 个答案:

答案 0 :(得分:1)

根据link,您可以使用

set-install-location location

位置

  
      
  • 0:自动:让系统决定最佳位置。
  •   
  • 1:内部:安装在内部设备存储上。
  •   
  • 2:外部:在外部媒体上。
  •   

答案 1 :(得分:-1)

您可以检查以下链接:- https://developer.android.com/guide/topics/data/install-location

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
 >