[英]Chrome Inspect Device not showing android app
I am trying to debug this app using chrome://inspect - Devices, but I am not able to see my app in the debug app list. 我正在尝试使用chrome:// inspect-设备调试该应用,但在调试应用列表中看不到我的应用。 I can see the device name and only Chrome app under it, but not my app.
我可以看到设备名称,并且只能看到其下的Chrome应用程序,但看不到我的应用程序。
Settings that I have applied 我套用的设定
I have also tried using different USB cables, different android device, but no luck. 我也尝试过使用不同的USB电缆,不同的android设备,但是没有运气。
Found answer on Remote Debugging WebViews on Google Developers. 在Google Developers的远程调试WebView上找到了答案。
This method has been added in API Level 19 , hence had to add following check 此方法已在API级别19中添加,因此必须添加以下检查
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
As mentioned in documentation, this method does not respect debuggable flag in application manifest file. 如文档中所述,此方法不考虑应用程序清单文件中的可调试标志。 If you want to enable webview debugging only when debuggable flag is true, then add one more check
如果您只想在debuggable标志为true时启用webview调试,则再添加一项检查
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE))
{
WebView.setWebContentsDebuggingEnabled(true);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.