Saturday, September 15, 2012

Playing with Chrome's Remote debugging with Android phone

Remote debugging (Chrome Inspector)

For developers, remote debugging is one of the greatest additions. It allows us to use a full Remote Inspector –the same as in Chrome for Desktop- remotely using USB debugging
On your Android Phone:
1.- Go to Settings > "Develop option" > check on "USB debugging"

2.- Need to work with  Android Debug Bridge (adb), included in Platform Tools of the Android SDK

wmunguiam@server:~$ cd /var/www/android-sdk-linux/
wmunguiam@server:/var/www/android-sdk-linux$ cd platform-tools/

List devices: (When plugged in over USB, can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a "device.")
root@server:/var/www/android-sdk-linux/platform-tools# ./adb devices
List of devices attached 
???????????? no permissions
For device detection:  (More info at
root@server:/var/www/android-sdk-linux/platform-tools# cd /etc/udev/rules.d/
root@server:/etc/udev/rules.d# ls
70-persistent-cd.rules  70-persistent-net.rules  README
root@server:/etc/udev/rules.d# vim 51-android.rules
Add content: "SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" " , then apply permisions:
root@server:/etc/udev/rules.d# chmod a+r /etc/udev/rules.d/51-android.rules 
Review attached devices: (Yes again)
root@server:/var/www/android-sdk-linux/platform-tools# ./adb devices
List of devices attached 
HT1ASVJ24858 device
Start service:
root@server:/var/www/android-sdk-linux/platform-tools# ./adb forward tcp:9222 localabstract:chrome_devtools_remote
3.- Open chrome in PC
Open desktop Chrome and navigate to localhost:9222.

No comments:

Post a Comment