Hi I am trying to debug my phonegap app on my device via Chrome I have followed all the steps and my phone is recognized by adb devices command,
Then I go to chrome://inspect/#devices and I can see my phone but this message appears on the browser:
Offline
Pending authentication: please accept debugging session on the device.
The thing is that there is no such message in my phone, I have a Sansumg Galaxy S2 with kitkat. I updated the version from 4.1 to 4.4 because I thought that was the issue but after updgrading to 4.4 same problem.
Has anyone faced this problem before??
The problem is that remote debugging used to only work for the Chrome browser on Android, but not in webviews inside of apps like phonegap uses. But with Android 4.4 (Kitkat) and Phonegap 3.3, this is now supported.
I wrote a blog post about it here:
http://adamwadeharris.com/remote-debugging-in-phonegap-with-chrome-devtools/
Basically you need to enable webview debugging in the app's main Java file, and make sure your app is targeting API version 19 (Kitkat). If you don't have a device with Kitkat, you could use an emulator instead.
Here's how you enable webview debugging:
In platforms/android/src/com/yourAppName/YourAppName.java add the following lines under the other import statements
import android.os.Build;
import android.webkit.WebView;
And add the following inside the onCreate method:
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}