即使按照https://developer.chrome.com/docs/devtools/remote-debugging/上列出的步骤操作,我还是无法在我的三星Galaxy S4上使用DevTools Devices功能

我的设备有Chrome v32和Chrome Beta v33,而我的个人电脑有Chrome v33和Chrome Canary v35。

我的设备上已开启USB调试,并且已安装设备驱动程序。我从未从上面的链接中得到步骤3中概述的提示,以批准RSA密钥指纹,但设备确实连接到我的PC以允许媒体传输。我甚至根据上面的链接撤销了所有USB调试授权。

我的电脑上没有任何额外安装的东西用于Android开发,这可能是问题所在。我希望利用这个功能从设备的角度来检查网页。


当前回答

上面提到的答案对我都没用。然而,对我有用的是端口转发。步骤如下:

Ensure you have adb installed (steps here for windowd, mac, ubuntu) Ensure you have chrome running on your mobile device On your PC, run the following from command line: adb forward tcp:9222 localabstract:chrome_devtools_remote On running the above command, accept the authorization on your mobile phone. Below is the kind of output I see on my laptop: $:/> adb forward tcp:9222 localabstract:chrome_devtools_remote * daemon not running. starting it now on port 5037 * * daemon started successfully * Now open your chrome and enter 'localhost:9222' and you shall see the active tab to inspect.

下面是该方法的源代码

其他回答

执行adb命令行。像这样

adb devices

我使用过六种不同的Android设备和多种电缆,我不得不说调试器工作不稳定。有时它能看到设备,有时不能。有时重新启动Chrome会有帮助。这里有一个相关的bug https://bugs.chromium.org/p/chromium/issues/detail?id=788161,也许你可以提供你的证据。

在一台Galaxy S7和Windows 10笔记本电脑上,当我连接到电脑时,我所要做的就是将USB连接模式更改为“音频源”(电话设置>开发人员选项> USB配置)。

然后立即出现设备上的提示,允许RSA密钥指纹。然后电脑上的开发工具识别了我的设备。

我不知道为什么这样做,但它是迄今为止最简单的解决方案,而且不需要安装不必要的软件。

我也有一些运气把它改为“MTP(媒体传输协议)”模式,但只是偶尔。

编辑:

MTP选项不再适用于我。

除“音频源”外,还可以将连接方式设置为“MIDI”。通过直接从设备的通知栏访问来更改连接模式要容易得多-点击“通过USB传输媒体文件”或等效的通知。

使用MIDI可能是两种方法中最简单的,因为它不需要进入多个设置屏幕来访问它。

我是应用程序编程的新手,这是我在尝试使用LG G3设备进行示例程序调试时遇到的第一个问题。上面有详细说明的职位应该适用于所有人。我补充了我的经验,以防它能帮助到其他人:

I had followed instructions step by step but one. That is, installing the USB driver from my OEM. My phone kept notifying that the debugging is on (in the notification area) and I could transfer data as well as charge. That made me think that appropriate USB drivers are installed. But it wasn't. Finally I went to LG site and downloaded the USB driver for my LG G3. Right after I installed the driver and reconnected the phone to the computer via the cable, I got the RSA key prompt. My Chrome now detects it and I was able to get my app run on my phone via Android studio as well.

如果你的手机里有android9,你必须在Android Studio更新Android SDK。

打开Android studio,进入设置。 系统设置\安卓 选择Android SDK(你会看到SDK的新版本) 点击应用 您的移动电话将需要访问现在的MIDI模式。