Repository navigation
Conversation
On devices without physical keys (emulators, Redroid, car head units) monkey warns
"SYS_KEYS has no physical keys" and its single event does not launch the app, so
the initial app launch timed out three times (about 45 s) before the agent opened
the app from the app drawer. With --pct-syskeys 0 the launch event is injected
("Events injected: 1") and the app comes to the foreground.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AndroidAdbDriver.launch_apprunsmonkey -p <pkg> -c android.intent.category.LAUNCHER 1. On devices without physical keys, that one event does not launch the app. This covers emulators, Redroid, and car head units. monkey prints** SYS_KEYS has no physical keys but with factor 2.0%., reports noEvents injected, and the previous app stays in the foreground.As a result, every task with a locked app spends about 45 s on three launch attempts before the agent gives up. The agent then opens the app from the app drawer, which costs extra steps.
This PR adds
--pct-syskeys 0. monkey then injects the launch (Events injected: 1), and the app comes to the foreground. On devices that do have keys, behavior is unchanged: the flag only disables system-key events, and a launch never needs one.Reproduction (Redroid, Android 13, 1920×720)
com.android.settingsbehaves the same way.Effect on a Flash run
I ran two test cases through the Flash profile on the same device, judging each result by device state read over adb.
Before the change, 22 of the last 24 locked-app tasks in the log started with
Failed to launch locked app … after 3 attempts.Tests
tests/unit/test_drivers.pynow asserts the exact launch command.make test,make lintandmake typecheckpass (0 errors).