Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shorebird_cli): "SYS_KEYS has no physical keys" during preview #2646

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ words:
- SIGSTOP
- storepass # From .github/workflows/e2e.yaml
- storyboardc
- syskeys # From adb.dart
- subosito # From .github dir, doesn't show up in "**" check?
- swiftshader # From .github dir, doesn't show up in "**" check?
- sysroot
Expand Down
3 changes: 3 additions & 0 deletions packages/shorebird_cli/lib/src/executables/adb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class Adb {
if (deviceId != null) ...['-s', deviceId],
'shell',
'monkey',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so confused why we're using monkey at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I guess that's a known way. I'm used to historically sending an intent: https://www.repeato.app/launching-android-applications-via-adb/

// Adjust percentage of "system" key events to 0.
// This is needed to support Android systems with no hardware keys.
'--pct-syskeys 0',
'-p $package',
'1',
];
Expand Down
8 changes: 6 additions & 2 deletions packages/shorebird_cli/test/src/executables/adb_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ void main() {
completes,
);
verify(
() => process.run(adbPath, 'shell monkey -p $package 1'.split(' ')),
() => process.run(
adbPath,
'shell monkey --pct-syskeys 0 -p $package 1'.split(' '),
),
).called(1);
});

Expand All @@ -172,7 +175,8 @@ void main() {
verify(
() => process.run(
adbPath,
'-s $deviceId shell monkey -p $package 1'.split(' '),
'-s $deviceId shell monkey --pct-syskeys 0 -p $package 1'
.split(' '),
),
).called(1);
});
Expand Down
Loading