Last Updated: February 25, 2016
·
1.632K
· francesco

Inspecting HTML/JS code on Android devices for web development

Just a non-comprehensive guide to remote inspecting on Android.

Note: requires Android SDK, just download and install it if not present on your system.

On your Android device:

enable USB debugging on the phone*

on Chrome for Android, enable USB Web debugging

connect the device to your computer

On your computer

open a console, and run

adb devices

if your device is listed (yes, it's that strange alphanumeric string), run

adb forward tcp:9222 localabstract:chrome_devtools_remote

you should see a message telling you "daemon started successfully"

if you get a "device not found" error, cross your fingers and run the

adb kill-servercommand

to solve it.

All done! Now if you open Chrome (on your computer) and you go to: http://localhost:9222 you should be able to inspect the webpage currently opened on Chrome (on Android device).

BONUS: if you just need to simulate user-agent and device size, take a look at Chrome features about that.

*details here:
https://developers.google.com/chrome-developer-tools/docs/remote-debugging

1 Response
Add your response

Notice: Chrome for Android is NOT using the system webkit-engine

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip