How can we help?

The app screen goes blank when I click a button via an automation script on BrowserStack App Automate

BrowserStack uses a custom streaming technology to stream video content from the remote devices hosted in our data centres to your local browsers. To facilitate this video streaming, screen capture capabilities/permissions are essential.

You might see a blank screen when you click a button via automation on BrowserStack App Automate if you have this screen capture capability/permission (FLAG_SECURE setting) enabled for your Android app. This prevents the app screens from appearing in screenshots or screen recordings. Disable this setting to allow screen recording on BrowserStack.

BrowserStack offers a custom feature where in you can upload your app with the bypass_secure_screen_restriction parameter to bypass this screen capture capability. Refer to this sample code snippet:

curl -u "username:accesskey" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@/path/to/app/file/application-debug.apk"
-F "bypass_secure_screen_restriction=true"

Note the following limitations with this feature:

  • This can lead to potential stability issues such as breaking APIs with certificate restriction such as Google maps, Firebase, etc if your app has them because we will be modifying your app and resigning it with our signing keys.
  • App file (apk) needs to be uploaded to BrowserStack via the above-mentioned command. It doesn’t work with apps downloaded from Play Store, etc.
  • Cross platforms such as Xamarin, React Native are not supported.
  • Only apps <= 130 MB are supported.

Other Resources

Still can’t find what you are looking for?

We are always happy to help with any questions

Support resources Contact Us

Provide your business email to continue