When I try to force install any application on an emulator with Android 10 using Jadb API call PackageManager.forceInstall, it throws the following exception:
se.vidstige.jadb.JadbException: Could not install <APP NAME>.apk:
Exception occurred while executing:
java.lang.IllegalArgumentException: No argument expected after "-r "
at android.os.ShellCommand.getNextOption(ShellCommand.java:266)
at com.android.server.pm.PackageManagerShellCommand.makeInstallParams(PackageManagerShellCommand.java:2383)
at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1057)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:169)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21729)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4860)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4014)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
at se.vidstige.jadb.managers.PackageManager.verifyOperation(PackageManager.java:47)
at se.vidstige.jadb.managers.PackageManager.install(PackageManager.java:65)
at se.vidstige.jadb.managers.PackageManager.installWithOptions(PackageManager.java:78)
at se.vidstige.jadb.managers.PackageManager.forceInstall(PackageManager.java:82)
I've assumed that PackageManager uses simple pm install -r call under the hood, and this command changed in format in Android 10, but, surprisingly, calling pm install -r <PKNAME> manually from adb shell still works, as well as calling adb install -r <PKNAME>
When I try to force install any application on an emulator with Android 10 using Jadb API call
PackageManager.forceInstall
, it throws the following exception:I've assumed that PackageManager uses simple
pm install -r
call under the hood, and this command changed in format in Android 10, but, surprisingly, callingpm install -r <PKNAME>
manually from adb shell still works, as well as callingadb install -r <PKNAME>