Cannot get remote WebView debugging to run on Android 4.4 Trigger.io app

橙三吉。 提交于 2019-12-13 21:01:28

问题


I'm trying to enable remote debugging for WebViews on a Trigger.io app running on Nexus 7 (Android 4.4.3). I've created a native module to set the Webview property with the following method:

public static void enableWebViewDebugging(final ForgeTask task) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
        WebView.setWebContentsDebuggingEnabled(true);
    }
    task.success();
}

I call it from JS with forge.internal.call('utils.enableWebViewDebugging', {}, null, null); a few seconds after the app started.

When looging at the chrome://inspect/#devices tab, I only see Chrome browser tabs, but no native WebView/app whatsoever.

Is there anything wrong with the way I set the property? I could imagine, that the WebView property must be set during a specific startup/oncreate method, however is that even possible with Trigger.io?


回答1:


Trigger.io natively supports remote debugging for Android > 4.4 so you shouldn't need to create your own custom module.

To enable it you can go to your app config in Trigger Toolkit and enable the checkbox at: Core => Android => Remote Debugging

Alternatively, edit your src/config.json file directly and add the 'remote_debugging' key to the core.android section:

"core": {
                "android": {
                        "remote_debugging": true,
                }
},


来源:https://stackoverflow.com/questions/24280397/cannot-get-remote-webview-debugging-to-run-on-android-4-4-trigger-io-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!