# remove the leading '#' to uncomment lines The Screengrabfile is written in Ruby, so you may find it helpful to use an editor that highlights Ruby syntax to modify this file. Since most values will not change often for your project, it is recommended to store them there.
Running fastlane screengrab init generated a Screengrabfile which can store all of your configuration options. To enable it for all screenshots by default, make the following call before your tests run: tDefaultScreenshotStrategy(new FalconScreenshotStrategy(activityRule.getActivity())) Falcon may work better than UI Automator in some situations and also provides similar benefits as UI Automator:įalcon requires a device with API level >= 10. tDefaultScreenshotStrategy(new DecorViewScreenshotStrategy()) Īs of screengrab 1.2.0, you can specify a new strategy to delegate to Falcon.
How to remove locale emulator android#
If you need to grab screenshots on an older Android version, use the latest 1.x.x version of this library and set the DecorView ScreenshotStrategy. However, UI Automator requires a device with API level >= 18.
How to remove locale emulator apk#
To capture screenshots, add the following to your tests Screengrab.screenshot("name_of_screenshot_here") on the appropriate screens It won't work like this:Ĭompanion object localeTestRule = LocaleTestRule() If you're using Kotlin localeTestRule = LocaleTestRule() If you're using Java static final LocaleTestRule localeTestRule = new LocaleTestRule() Configuring your Manifest PermissionsĮnsure that the following permissions exist in your src/debug/AndroidManifest.xml Ĭonfiguring your UI Tests for ScreenshotsĪdd LocaleTestRule to your tests class to handle automatic switching of locales. If you wish to capture screenshots with an older Android OS, then you must use a 1.x.x version. This means a device with API 18+, Android 4.3 or greater is required. Gradle dependency androidTestImplementation 'tools.fastlane:screengrab:x.x.x'Īs of Screengrab version 2.0.0, all Android test dependencies are AndroidX dependencies.
Screengrab generates localized screenshots of your Android app for different device types and languages for Google Play and can be uploaded using supply. Alias for the capture_android_screenshots actionĪutomated localized screenshots of your Android app on every device