In previous versions, the app was pinned by typing the following command:
adb shell "task_id=$(dumpsys activity | grep -A2 '(dumpsys activity recents)'| grep '#'| cut -d ' ' -f 7| cut -c 2-); am task lock $task_id"
However, starting with Android 9.0
, the app is not fixed with the following exceptions:
java.lang.IllegalArgumentException: Argument expected after "lock" at android.os.ShellCommand.getNextArgRequired(ShellCommand.java:321) at com.android.server.am.ActivityManagerShellCommand.runTaskLock(ActivityManagerShellCommand.java:2615) at com.android.server.am.ActivityManagerShellCommand.runTask(ActivityManagerShellCommand.java:2601) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:265) at android.os.ShellCommand.exec(ShellCommand.java:103) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:19057) at android.os.Binder.shellCommand(Binder.java:642) at android.os.Binder.onTransact(Binder.java:540) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3462) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3848) at android.os.Binder.execTransact(Binder.java:739)
How do I apps pinning using adb
on Android 9.0?
Comments
Post a Comment