manager: Use AM instead of Monkey to start the app. (#1614)
Using Monkey will unlock the rotation, and possibly more unintended behavior. link: [ADB shell monkey command changing device orientation lock](https://stackoverflow.com/q/56684778)
This commit is contained in:
@@ -366,11 +366,11 @@ fun launchApp(packageName: String) {
|
||||
|
||||
val shell = getRootShell()
|
||||
val result =
|
||||
shell.newJob().add("monkey -p $packageName -c android.intent.category.LAUNCHER 1").exec()
|
||||
shell.newJob().add("cmd package resolve-activity --brief $packageName | tail -n 1 | xargs cmd activity start-activity -n").exec()
|
||||
Log.i(TAG, "launch $packageName result: $result")
|
||||
}
|
||||
|
||||
fun restartApp(packageName: String) {
|
||||
forceStopApp(packageName)
|
||||
launchApp(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user