Chrome检查设备未显示android应用 [英] Chrome Inspect Device not showing android app
问题描述
我正在尝试使用 chrome://inspect -设备调试该应用程序,但是在调试应用程序列表中看不到我的应用程序.我可以看到设备名称,但只能看到其下的Chrome应用程序.
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. I can see the device name and only Chrome app under it, but not my app.
我已应用的设置
- 启用USB调试(Android设备)
- 发现美元设备(Chrome开发工具)
- 选择调试应用-应用名称
- 使用USB进行文件传输
- 在清单文件中添加了 android:debuggable ="true"
- Enable USB Debugging (Android Device)
- Discover USD Devices (Chrome Dev Tools)
- Select Debug app - App Name
- Use USB for - File Transfer
- Added android:debuggable="true" in Manifest file
我也尝试使用不同的USB电缆,不同的android设备,但是没有运气.
I have also tried using different USB cables, different android device, but no luck.
推荐答案
This method has been added in API Level 19, hence had to add following check
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
如文档中所述,此方法不遵守应用程序清单文件中的 debuggable 标志.如果您只想在 debuggable 标志为true时启用Webview调试,则再添加一项检查
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
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE))
{
WebView.setWebContentsDebuggingEnabled(true);
}
}
这篇关于Chrome检查设备未显示android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!