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

Guide to deploy it on Android devices #19

Open
dubeyabhijeet opened this issue Jul 25, 2021 · 6 comments
Open

Guide to deploy it on Android devices #19

dubeyabhijeet opened this issue Jul 25, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@dubeyabhijeet
Copy link

dubeyabhijeet commented Jul 25, 2021

Hi ,

I want to use it on real devices not on emulator.
Can you help me guide how to do it?

Regards,
Abhijeet

@kenjitoyama
Copy link
Collaborator

Hello @dubeyabhijeet! We do not officially support running AndroidEnv on real devices at the moment.
To do that, you'll need a new Simulator to grab screenshots and sending actions. If you don't care about performance that much, it's relatively straightforward to write one that uses adb screencap (https://developer.android.com/studio/command-line/adb#screencap) and adb input tap. Keep in mind that this solution will probably achieve only a handful of steps per second.

Cheers,

Daniel

@dubeyabhijeet
Copy link
Author

dubeyabhijeet commented Jul 25, 2021

Understood ! Thanks a lot....

Right now you are controlling it from PC to emulator. If i used real devices then performance will be trade off [PC to real devices].

What about deploy it through apk in phone? Like i use app traversal and on each screen use android_env to decide on actions to take? Like ndroid_env in wrapped in traversal apk and deployed on phone.

@kenjitoyama
Copy link
Collaborator

Yes, it's possible but at the moment there's no good way to do so. There are no APIs to fetch screenshots and execute actions from within Android, and that would also probably require root access, which is a security issue.

@dubeyabhijeet
Copy link
Author

Got it ! Understood. Thanks a lot Daniel :)

@dubeyabhijeet
Copy link
Author

Hi Daniel, What i see we need to add logs in apps source code. I have two queries:

  1. Not possible with 3rd party apps without source code?
  2. How deepmind trained agents for youtube? Have source code or youtube has those logs needed for rewards?

@kenjitoyama
Copy link
Collaborator

kenjitoyama commented Aug 12, 2021

Hello @dubeyabhijeet!

Not possible with 3rd party apps without source code?

You can run anything you want in the emulator, but rewards are only available if something is shown in the log stream and captured by a regex.

How deepmind trained agents for youtube? Have source code or youtube has those logs needed for rewards?

We haven't trained explicitly for YouTube, it was just an example. However, we did train agents on apps for which we don't have the source code such as the Clock or System Settings by reusing accessibility events. Please see https://github.com/deepmind/android_env/blob/main/docs/example_tasks.md#accessibility-forwarder. At one point, we also extracted rewards from view hierarchies, but they're much slower to get (it needs a slow adb dumpsys call + parsing) than simple Log.i() calls. We also experimented with OCR, but though that works in synthetic text in static apps, it doesn't really work well for things like games or apps with unusal fonts and/or graphics. In theory, any event or message in Android could be used as a source of rewards, but we relied on logs because they're the easiest to implement (from a developer and task designer's point of views) and reliable.

Cheers,

Daniel

@kenjitoyama kenjitoyama added the enhancement New feature or request label Aug 12, 2021
@kenjitoyama kenjitoyama changed the title Guide to reploy it on Android devices Guide to deploy it on Android devices Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants