Search code examples
debuggingcordovaphonegap-buildweinre

Remote device not recognized by debug.phonegap.com


I am encountering a problem when I try to debug my phonegap app using debug.phonegap.com.

I put this vode inside the head of the HTML document

 <script src="http://debug.phonegap.com/target/target-script-min.js#[guide goes here]"></script>

Prior to launching the app I run the debugger from build.phonegap.com, and then launch the app.

The Phonegap debugger doesn't recognize my Android device.

config.xml files:

<access origin="debug.phonegap.com" subdomains="true" /> 
<access origin="*" />

Any idea what should I do to make it work?


Solution

  • You don't need to add that code to your app if you're using http://build.phonegap.com. When you build your app there with the Enable debugging option checked in Settings, that line is automatically added. So when you open it it sends the ID to weinre and the debug session starts.

    The method described by Dom is how it is supposed to work.

    Alternatively, you can do what http://build.phonegap.com does for you but manually, and see if that makes any difference. I've tried this for an Android PhoneGap app and it works:

    1. Add this code to the head of your index.html: <script src="http://debug.build.phonegap.com/target/target-script-min.js#[id]"></script> replacing [id] with a random string of your choice.
    2. Build the app (from the command line: $ phonegap local build android) and install the .apk manually or with ADT or however you want.
    3. Go to http://debug.build.phonegap.com/client/#[id] replacing [id] as before.
    4. Open your app. It should come up in your list of Targets and turn green when it's ready for debugging.

    Make sure your app is set as debuggable. It's the default for Android PhoneGap apps.