This repository demonstrates how you can enable debugging and test your apps use WebViews.
The main branch contains sample app for Android-AdvancedWebView app and the default branch contains code for the default webview.
- Android SDK and tools
- You are using Android API 19 or higher for development.
minSdkVersion=19
for your app.- In the OnCreate function of your application add the following code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { WebView.setWebContentsDebuggingEnabled(true); }
You can find more on this from Google's documentation.
Once you have followed the above process, you can build your application and test them on BrowserStack. For example, considering sample app of this repository:
- Build the application. This should give you a
.apk
or.aab
. You can find sample apps in the dist folder in the repository. - Upload them on BrowserStack.
- Start a session using your desired framework with the app capability as app_url obtained from the above step. Sample capabilities:
{ "app": "bs://<app_url>", "deviceName": "Google Pixel 5", "platformVersion": "11.0", "platformName": "android", "autoGrantPermissions": "true" }
- When you call the getContexts of Appium, it will return an array containing "WEBVIEW_com.browserstack.webview" as one of the contexts.