Android Genymotion 如何使用 Chrome Dev Tools 进行调试

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21627328/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:50:33  来源:igfitidea点击:

Genymotion how to debug with Chrome Dev Tools

androidgoogle-chrome-devtoolsgenymotion

提问by Nico Pernice

We're using Genymotion to test/debug a WebView based Android Application. The device show up in Chrome Dev Tools via Inspect Device, but with no inspection ability. We made different attempts, with/whitout ADB, with/whitout Android Studio but with no luck. What's wrong/missing ?

我们正在使用 Genymotion 来测试/调试基于 WebView 的 Android 应用程序。该设备通过检查设备显示在 Chrome 开发工具中,但没有检查功能。我们做了不同的尝试,使用/whitout ADB,使用/whitout Android Studio,但没有运气。有什么问题/缺少?

回答by Harsha Vardhan

See the official docs on enabling debugging on Android

请参阅有关在 Android 上启用调试的官方文档

  1. Start up your Virtual Device and, inside the virtual device, enable "USB debugging" by going to Settings> Developer Options> USB Debugging. If you get a prompt that says "always allow USB debugging", press "OK". If you don't see the option for Developer Options, first goto Settings > About Phone/Tablet, find Build Number, and tap it about 10 times. Go up one menu and find the Developer Options menu now enabled above the About menu options.

  2. Go to Chrome on your Host OS. type chrome://inspectin the url and press enter.

  3. Check the box at the top that says "Discover USB Devices". There should now be a list of virtual devices currently available to Chrome. Find the device you want to debug and click the inspectlink.

  4. A new Chrome Developer Tools window should open up containing the code for the page you're currently viewing in your browser, and should show the "Emulation" tab at the bottom with information about your device specs.

  1. 启动您的虚拟设备,并在虚拟设备内,通过转到Settings> Developer Options> USB Debugging启用“USB 调试” 。如果您收到“始终允许 USB 调试”的提示,请按“确定”。如果您没有看到Developer Options 的选项,请首先转到Settings > About Phone/Tablet,找到Build Number,然后点击它大约 10 次。上一级菜单,找到“关于”菜单选项上方现已启用的“开发人员选项”菜单。

  2. 转到主机操作系统上的 Chrome。输入chrome://inspect网址并按回车键。

  3. 选中顶部的“发现 USB 设备”框。现在应该有一个 Chrome 当前可用的虚拟设备列表。找到您要调试的设备并单击inspect链接。

  4. 应打开一个新的 Chrome 开发者工具窗口,其中包含您当前在浏览器中查看的页面的代码,并应在底部显示“仿真”选项卡,其中包含有关您的设备规格的信息。

If you are not able to get this working then check the following items:

如果您无法使其正常工作,请检查以下项目:

  • Check port forwarding.
  • Proxy settings.
  • USB driver installation.
  • 检查端口转发。
  • 代理设置。
  • USB驱动安装。