screenshots
screenshots copied to clipboard
Use ADB to take screenshots of android devices
This PR implements ADB screenshots for android devices as discussed in https://github.com/mmcc007/screenshots/issues/175
| Nexus 6P Before | Nexus 6P After |
|---|---|
![]() |
![]() |
Main Changes:
- Added
adb_path&adb_device_idtoconfig.screenshotsEnv - capture_screen.dart now checks if the new variables in
config.screenshotsEnvare set and if thedevice_typeis 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.pngor.driver.pngso 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.

