First of all, get prepared by installing the Android SDK and SDK tools in order to get the adb
executable. Then:
-
adb connect <device ip>
-
To get the service name `adb shell "cat /proc/net/unix | grep devtools_remote", which will give you something like this output:
00000000: 00000002 00000000 00010000 0001 01 423897 @webview_devtools_remote_18279
-
Now we need to make a port forwarding between the open socket on the android device and your local machine:
adb forward tcp:9222 localabstract:webview_devtools_remote_18279
(assuming thatwebview_devtools_remote_18279
was returned by the command on step 2. -
To make sure it worked, just open http://localhost:9222 in your browser, and you should see something like this
- Now you can curl the JSON endpoint to get the so much desired
webSocketDebuggerUrl
:curl localhost:9222/json
orcurl localhost:9222/json/version
(varies depending on the Chrome/Chromium version)
You a lifesaver! Thank you so much!