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

Use ADB to take screenshots of android devices #186

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

r1sim
Copy link

@r1sim r1sim commented Feb 9, 2020

This PR implements ADB screenshots for android devices as discussed in #175

Nexus 6P Before Nexus 6P After
image image

Main Changes:

  • Added adb_path & adb_device_id to config.screenshotsEnv
  • capture_screen.dart now checks if the new variables in config.screenshotsEnv are set and if the device_type is android. If that is the case it will attempt to take screenshots using adb. It will use FlutterDriver to take the screenshots if the adb method fails for whatever reason.
  • The new screenshot method for android uses adb to take screenshots and to setup the navbar
  • The unprocessed screenshots now have the extension .adb.png or .driver.png so the image processor knows how to process them. (Add Navbar or not)
  • I upgraded the SDK version of the example app to a more recent version.

This works well with my setup. If it works as well for everyone else we could maybe think about dropping FlutterDriver support for android devices. This would make it much easier to add new devices because we would no longer need to add a statusbar and navbar for every resolution. The only downside of this would be that demo mode requires android 6.0.

@r1sim r1sim changed the title Use ADB to take screenshots of android devices WIP: Use ADB to take screenshots of android devices Feb 9, 2020
@r1sim r1sim changed the title WIP: Use ADB to take screenshots of android devices Use ADB to take screenshots of android devices Feb 9, 2020
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.

2 participants