# Remote Debugging using chrome

In the previous chapter we saw **UIAutomatorviewer** and how to use that tool to look for elements and locators.

However, when you are working on a hybrid application (developed on a platform like [Phonegap](http://phonegap.com/) ), we can use remote debugging.

To use Remote debugging, we need to have:

* Chrome (version 69) or later installed on your machine
* Android Device
  * Should be running Android 4.4+
  * USB Debugging enabled
* USB cable

Once the basic things are in place, connect your device to machine using USB cable. Launch Chrome and open a tab with target "*chrome://inspect*". This is how it would look like.

![](https://2766960072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4S6_RrxngPvmkeJs5f%2F-M4S6_qa0bmwljCVD7nF%2F-M4S6ao9a8lQHXewjrtE%2FScreen%20Shot%202018-10-05%20at%204.32.49%20pm.png?generation=1586405214299448\&alt=media)

If you notice your phone, you would have got an alert saying "Allow USB Debugging".

![](https://2766960072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4S6_RrxngPvmkeJs5f%2F-M4S6_qa0bmwljCVD7nF%2F-M4S6aoBMSWEU_U9bgkH%2FUSB_Debugging.png?generation=1586405213478557\&alt=media)

Once you click OK, your device would get showed up in browser tab. Below is how it would show up:

![](https://2766960072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4S6_RrxngPvmkeJs5f%2F-M4S6_qa0bmwljCVD7nF%2F-M4S6aoD-4BjNPfVxLZK%2Fchrome-inspect-devices.png?generation=1586405219610348\&alt=media)

Once you click on **inspect**, you can see the locators as you have always done in web for Selenium.

![](https://2766960072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4S6_RrxngPvmkeJs5f%2F-M4S6_qa0bmwljCVD7nF%2F-M4S6aoFRxUKtg-Z1d-m%2Fremote-debug-banner.png?generation=1586405214127391\&alt=media)

You can also use Screen casting option by clicking the **Screencast** icon in the upper right corner of your remote debugging DevTools window.![](https://2766960072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4S6_RrxngPvmkeJs5f%2F-M4S6_qa0bmwljCVD7nF%2F-M4S6aoHaDiAQw_p_FY6%2Fscreencast-icon-location.png?generation=1586405213939322\&alt=media)

## *This method of finding locator is faster than using UIAutomatorviewer and would be highly recommended.*

> If the phone is NOT getting recognised while performing tests. Perform below commands to get started with the device

Try killing adb adb kill-server then disable usb debugging and then start adb by adb start-server then enable usb debugging and plug phone again and huh don't let phone sleep between process
