f71316
f71316

Reputation: 252

Configure WebViews for Debugging - Where?

Trying to work through problems on a phonegap app and can't figure out how to debug, so trying to use the Chrome Remote Debugging. Having trouble getting the app set up for remote viewing.

Following the instructions on this page:

https://developer.chrome.com/devtools/docs/remote-debugging

but when I get to the section on "Configure WebViews for debugging" it specifically says I need to add the following lines of code:

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    WebView.setWebContentsDebuggingEnabled(true);
}

Exactly where am I supposed to add this code to my app in order to make it able to use remote debug?

I have the app installed on a device, Chrome://inspect sees the device, and I can remote view anything I open in Chrome on the device, so I know the connection is good. I can even see that the app is running, but can't click on it to remote view.

Upvotes: 0

Views: 1628

Answers (1)

codevision
codevision

Reputation: 5520

With latest version of Cordova you don't need to worry about setting debuggable flag manually in the code.

This feature is part of the core Cordova and was introduced by this commit https://github.com/apache/cordova-android/commit/ea1f041e1167de9add5346a7d4fe6afec095d910 Which was shipped with Cordova 3.3 version.

Current version as of writing is Cordova 3.5.1

Upvotes: 1

Related Questions