12
votes

I am developing an app for a new Android device (on all other I've never had this issue).

It's running 4.2.2 I have enabled developer mode and allowed usb debugging (I receive the status notification that usb debugging enabled)

However, in chrome://inspect the screen keeps alternating between the below two messages, seems it can't make up it's mind!

  1. ratech72_wet_rlk_lca #0123456789ABCDEF
  2. Offline #00180123456789ABCDEF Pending authentication: please accept debugging session on the device.

I've tried unplugging and restarting everything to no avail

When I plug in the device I see the following status messages on the device systray, in this order

  1. Connected as USB Storage
  2. USB Debugging Connected
  3. USB Connected

How can I access chrome inspect on this device? I am using logcat for now but it's far less powerful than chrome dev tools.

5
are you debugging an application with a Webview or are you debugging a website on mobile?kandroidj
It's a Cordova application... so an application with a WebviewJoshua Ohana
Ah, i think your issue is 4.2.2 then not the actual device from the guidelines "For app debugging: Android 4.4+ and a WebView configured for debugging." developer.chrome.com/devtools/docs/remote-debuggingkandroidj

5 Answers

29
votes

This is a known issue.

The answer in the link (changing USB mode from MTP to PTP) did work for me for some time, however others have had less success, and my setup has now regressed to the erratic connection you are seeing.

Personally, I just try to play quick draw and click on the device when it's listed before it disconnects again, which after a bit of practice doesn't take too long, and once you've done that, the actual inspect tools don't have the same erratic connect/disconnect problem so you should be fine until you physically disconnect the device.

This should be resolved in a future version of Chrome.

5
votes

You will need to check out the Facebook Stetho debugging tool:

http://facebook.github.io/stetho/

It is pretty easy to get up and running. And it works well if you are using OkHttp developed by square to debug networking tools.

add to gradle:

dependencies { 
  implementation 'com.facebook.stetho:stetho:1.5.0' 
} 

then in your application class:

  Stetho.initializeWithDefaults(this);

and then go to chrome://inspect in your browser and you should see your device

3
votes

I know this is an old question, but nonetheless, this is what helped me:

  • while in Chrome chrome://inspect/#devices page is opened
  • turn off USB Debugging,
  • turn on USB Debugging again

The phone will ask me if I trust the connection...

1
votes

In the virtual Device Manager I selected Wipe Data from the Actions. Then I started the virtual device. Then I ran the app and it worked in the emulator.

0
votes

This is what I did in Android 10 (Oneplus 7t pro), to make it to work(in addition to @gordan.sikic answer).

  1. While in Chrome, keep chrome://inspect/#devices page opened
  2. Click and accept, Android Phone -> Settings -> Developer Options -> Revoke USB debugging authorizations
  3. Turn off USB debugging
  4. Turn on USB debugging, accept Allow USB debugging.

Then you 'll see Always allow from this computer Notification