Inspect and debug a production Cordova app installed on the device from the app store

Viewed 1621

I'm trying to debug a Cordova app by inspecting it remotely using the browser.

Per example, on my iPhone, I could access the webView by Safari Developer Menu, or in my Android, using Google Chrome chrome://inspect.

It works good when I install the app on the device by the CLI cordova run ios cordova run android but, when I download the same app from the store, where I published it, I can't inspect it anymore, in fact I can't find it to inspect it in Chrome/Android nor Safari/iOs.

Is there a way to inspect the production app?

How am I supposed to debug it otherwise (e.g. the bug happens only in production)?

Thanks.

3 Answers

It's no longer possible to upload a debuggable apk:

enter image description here

You need to enable debugging for webviews in android application.

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

add above code in main activity file.

more info about remote debugging :

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

Note : It is not recommended to turn on debugging on live playstore apps.

Related