问题
I want to remote debug an Android app on Chrome. My device is Qmobile A11 Note with Android v4.0.4, Google Chrome v42 and Cordova v3.7.
I have enabled USB debuging on my device.
I was following this article. My problem is when I open this link in chrome chrome://inspect/#devices it show my device but with no inspect link. Here is the screenshot
How can I inspect or remote debug, what's missing? I have worked with this before and Chrome was showing the Inspect link at that time.
回答1:
For application debugging you need android 4.4+ OS device. OS version of your Qmobile A11 is 4.0. For more info please refer : https://developer.chrome.com/devtools/docs/remote-debugging
For browser debugging(if you host your app as webapp) Android 4.0+ is enough.
If you are using cordova 4.0+ then you can add crosswalk(https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview) as a plugin by which you can bundle chromium instance in the apk so with Andorid 4.0+ device also you can use device inspector.
回答2:
If you app is signed-released version then you can't be able to see under chrome://inspect. Because released version are disable the debugging mode.
Use only debug version apk for chrome://inspect.
回答3:
Your project must be enable WebContentsDebugging, it will work fine on android 4.4 or above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
WebView.setWebContentsDebuggingEnabled(true);
}
回答4:
If you are using production build apk which doesnt have any debugging info, you might be getting this issue. If that is the case, inspect would show the device listed but not the app inspect link.
Use the debuggable apk.
回答5:
try this :
- Go to http://adbdriver.com/downloads/ download and check if your adb driver is install right or not ? If wrong , please reinstall it.
- Access to C:\Users\NAME\AppData\Local\Android\android-sdk\platform-tools , open cmd from here ( Shift + right click) and type : adb devices . You should see a device in the list.
- Back to your chrome://inspect/#devices and you will see your devices ready for inspect .
回答6:
For me the problem was a missing step from the Remote debugging guide:
- Go to Chrome on Android's Settings -> Developer tools
- 'Enable USB Web debugging'
回答7:
For those who are using Intel XDK to build hybrid apps, add <preference name="debuggable" value="true" />
to intelxdk.config.additions.xml file. In general, you must set debuggable property true if you want to use this functionality. Note that XDK set debuggable to false by default.
回答8:
just try to kill the adb server and start again.
adb kill-server
adb start-server
this can help to show the inspect button in the remote debugging
回答9:
REMOTE DEVICE DEBUGGING WON'T WORK IF THE APP ON YOUR PHONE IS PRODUCTION BUILD AND SIGNED.
DEPLOY THE APP TO YOUR PHONE DIRECTLY AND TRY IT.
来源:https://stackoverflow.com/questions/29942627/chrome-remote-debugging-shows-device-but-not-inspect-link