如何知道当前安装位置

How to Know Current Install Location

我在网上看到使用下面的代码会将安装位置设置为 sdcard

adb shell pm set-install-location 2

但是如何知道安装位置的当前设置?

在 Vb.net 或 VBA 中,我们使用(问号)?adb shell pm set-install-location 来获取当前设置。

它在 android 中是否相同,或者我需要其他东西?

通过使用 adb shell pm getInstallLocation 你可以获得安装位置

您正在查找此命令:adb shell pm get-install-location

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

source