即使按照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开发,这可能是问题所在。我希望利用这个功能从设备的角度来检查网页。


当前回答

要启动并运行该功能:

Follow steps at https://developers.google.com/chrome-developer-tools/docs/remote-debugging Install Windows USB driver http://developer.samsung.com/android/tools-sdks/Samsung-Android-USB-Driver-for-Windows Install Android SDK http://developer.android.com/sdk/index.html Install Android SDK Platform-tools http://developer.android.com/sdk/installing/adding-packages.html (this step was blocked on corporate wifi so I installed the single ADB package it required https://forum.xda-developers.com/showthread.php?t=2317790) Use command prompt to run ADB, in cmd go to the install directory of the ADB tools and type: adb.exe (might need to start and stop ADB using adb kill-server and adb start-server) Connect phone and browse to about:inspect in Chrome on desktop, ensuring a Chrome browser is open on your device

按照上面的步骤,我得到RSA密钥指纹提示接受,然后我在Chrome中看到我的设备。

绝对不像我想象的那么容易,但至少它现在起作用了。

2016年2月24日更新

所以我升级到Windows 10,现在有一台三星Galaxy S5,设备分别运行Chrome v48.0.2564.116 m和v48.0.2564.95 m。按照谷歌文档中的步骤……它又不能工作了,没有RSA密钥提示。所以我开始按照上面的步骤,并认为必须有一个更快的方法,因为Android SDK的下载超过1GB。

这次我试着:

Follow steps at https://developers.google.com/chrome-developer-tools/docs/remote-debugging Install Windows USB driver http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows (the PC alerted me saying it was already installed but I still did it anyway) Install the single ADB package required https://forum.xda-developers.com/showthread.php?t=2317790) Go to the ADB install folder which for me was C:\Program Files (x86)\Minimal ADB and Fastboot\ Open command prompt and run adb devices (alternatively I could have run adb start-server but the prior gives a more informational response)

现在,Chrome打开我的手机和Chrome://inspect/打开我的桌面上,我可以看到检查选项。

下一个问题:每次重启Windows时,我都需要重复相同的步骤。要解决这个问题:

打开文本编辑器,复制到“C:\Program Files (x86)\Minimal ADB and Fastboot\ ADB”设备中 将该文件保存为adb.bat在Windows启动文件夹中,位于C:\ProgramData\Microsoft\Windows\开始菜单\Programs\ Startup

注意,只要是.bat文件,文件就不需要被称为adb.bat。您复制到文件中的命令具有默认安装路径,您可能需要更改该路径以进行设置。

现在我有Chrome检查功能工作时,我需要它。

感谢并大声向所有为这个问题提供答案的人喊话,他们帮助我对我的答案进行了有用的更新。请给其他你认为对你有帮助的答案署名。

其他回答

三星手机+ Windows电脑

首先,你需要打开手机的USB调试:

设置/关于电话/软件信息/版本号 (点击7次打开开发者模式) 设置/开发人员选项/ USB调试(打开)

然后在你的电脑上:

Install Samsung USB driver https://developer.samsung.com/mobile/android-usb-driver.html Install ADB https://forum.xda-developers.com/showthread.php?t=2317790 (in the forum scroll down to the section "Downloads" to get the newest version of ADB) After ADB installation CMD should pop up -> start ADB with command "adb devices" (for example "C:\Program Files (x86)\Minimal ADB and Fastboot> adb devices") Connect your phone to your PC with USB cable Alert about the connection should pop up on your phone (allow it) In Chrome on your PC open Developer tools / More tools / Remote devices and you should finally see your phone being detected

用的是三星Galaxy S9,运行Android Pie。——2019年5月 类似于上面的答案,以及NickW的答案: 设备连接好后,不要进入设置,而是进入手机的通知栏> Android系统,然后“点击其他USB选项”。在选项下选择MIDI,您就可以开始了!

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

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.

下面是该方法的源代码

Chrome浏览器似乎有bug重新协商设备身份验证。您可以尝试禁用USB调试,并再次启用它。有时你会看到一个弹出窗口,要求你再次信任你的电脑密钥。

或者你可以去你的Android SDK,运行adb设备,这将迫使重新协商。

完成其中一个(或两个)后,Chrome就可以开始工作了。

如果你在windows上,你需要为你的手机安装驱动程序。你可以在这里买到。

如果它仍然不工作,我已经通过手动重新启动Android调试桥来幸运地连接。更多信息在这里。