cocool97 / adb_client

Rust ADB (Android Debug Bridge) client library
MIT License
144 stars 23 forks source link

feat: add `adb run` command with activitymanager #51

Closed lavafroth closed 1 week ago

lavafroth commented 1 week ago

Changes

Closes #16

lavafroth commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

Sure, I can add this to the library side. Please correct me if I'm wrong but to extract the default activity of an app, we'd first need to parse its apk, right?

cocool97 commented 1 week ago

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 commented 1 week ago

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