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

Conversation

elliots
Copy link
Contributor

@elliots elliots commented Nov 27, 2024

"** SYS_KEYS has no physical keys but with factor 2.0%."

Description

When running preview, I got

⠹ Starting app... (0.2s)Exited with code 251

stdout:
  bash arg: -p
  bash arg: com.my.app
  bash arg: 1


stderr:
args: [-p, com.my.app, 1]
 arg: "-p"
 arg: "com.my.app"
 arg: "1"
data="com.my.app"
** SYS_KEYS has no physical keys but with factor 2.0%.

Found https://stackoverflow.com/questions/44860475/how-to-use-the-monkey-command-with-an-android-system-that-doesnt-have-physical

Now it doesn't error.

But, I have no idea why I got it, or if this fix will cause other problems.

❯ adb --version
Android Debug Bridge version 1.0.41
Version 35.0.2-12147458
Installed as /Users/me/Library/Android/sdk/platform-tools/adb
Running on Darwin 23.5.0 (arm64)

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Tests

@@ -51,6 +51,7 @@ 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/

 "** SYS_KEYS has no physical keys but with factor 2.0%."
@bryanoltman
Copy link
Contributor

It looks like tests are failing and cspell is unhappy. These should both be easy to fix. For cspell, you can add "syskeys" to shorebird/cspell.config.yaml

@felangel felangel changed the title fix: "SYS_KEYS has no physical keys " error on preview fix(shorebird_cli): "SYS_KEYS has no physical keys " error on preview Jan 14, 2025
@felangel felangel changed the title fix(shorebird_cli): "SYS_KEYS has no physical keys " error on preview fix(shorebird_cli): "SYS_KEYS has no physical keys" during preview Jan 14, 2025
@felangel felangel added the bug Something isn't working label Jan 14, 2025
Copy link
Contributor

@felangel felangel left a comment

Choose a reason for hiding this comment

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

LGTM thanks so much for the contribution!

@felangel felangel closed this Jan 14, 2025
@felangel felangel reopened this Jan 14, 2025
@felangel
Copy link
Contributor

For context the reason you saw this error is most likely because you were trying to preview on an Android system which does not have hardware/physical system keys.

@felangel felangel enabled auto-merge (squash) January 14, 2025 18:37
@felangel felangel disabled auto-merge January 14, 2025 18:39
@felangel felangel merged commit dfd8c9f into shorebirdtech:main Jan 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants