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

feat: add adb run command with activitymanager #51

Merged
merged 3 commits into from
Nov 9, 2024

Conversation

lavafroth
Copy link
Contributor

@lavafroth lavafroth commented Nov 6, 2024

Changes

  • LocalCommand and USBCommand now have respective variants for "run"
  • Both these impls run the shell command am start INTENT
  • Added new trait method run_activity for ADBDeviceExt
  • run_activity requires a package name and an associated activity to invoke
  • The library ships with a default implementation of run_activity which invokes an intent using the am start command.

Closes #16

@lavafroth
Copy link
Contributor Author

In addition to this, would you be open to using monkeyrunner to start an activity in the case where a user supplies a package name without an intent? Alternatively we could just default to MainActivity which applies to most apps.

@cocool97
Copy link
Owner

cocool97 commented Nov 6, 2024

Thanks for the PR, can you add this feature to adb_client as well ?
Currently it is only available to the CLI.

I would have seen something like run_application that only takes a package name as parameter and run_activity that takes both package name and activity to start. run_application could call run_activity with default activity name.

What do you think about it ?

@lavafroth
Copy link
Contributor Author

lavafroth commented Nov 6, 2024 via email

@cocool97
Copy link
Owner

cocool97 commented Nov 6, 2024

As a library we let users fill these two fields, users will have to know what main activity names their applications have.

APK parsing could be done using other libraries

@lavafroth
Copy link
Contributor Author

I have edited the PR description to reflect the changes committed.

### Changes
- `LocalCommand` and `USBCommand` now have respective variants for "run"
- Both these impls run the shell command `am start INTENT`
@cocool97 cocool97 merged commit 61ba07e into cocool97:main Nov 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Adb run command
2 participants