2

I'm starting with phonegap development (Using phonegap build to port a HTML5 app) and came across weinre which is great. I was able to debug the HTML5 app from my PC (Chrome browser) without an issue using the phonegap weinre server (debug.phonegap.com).

However when I deployed the app to the device (starting with Android), it is not hitting the debug server. The android log gives me the following error;

06-06 05:19:51.526  4594  4594 D CordovaLog: Uncaught SyntaxError: Unexpected token function
06-06 05:19:51.526  4594  4594 E Web Console: Uncaught SyntaxError: Unexpected token function at http://debug.phonegap.com/target/target-script-min.js:2
06-06 05:19:51.546  4594  4594 D CordovaLog: Uncaught SyntaxError: Unexpected token function
06-06 05:19:51.546  4594  4594 E Web Console: Uncaught SyntaxError: Unexpected token function at http://debug.phonegap.com/target/target-script-min.js:2

My include script tag is as follows;

<script src="http://debug.phonegap.com/target/target-script-min.js#uchitha"></script>

I have given full network access to the app as well;

Any assistance is highly appreciated.

Uchitha
  • 998
  • 8
  • 24

2 Answers2

2

If you are using PGB, you do not need to add the JS script for debug, it does that for you at "compile time."

So:

  1. Remove that script to the debug
  2. Rebuild the App in PGB and make sure you have the "debug" option checked in the app's settings
  3. When done building, OPEN THE DEBUG WINDOW FIRST before you open the app by clicking the "debug button" in the PGB app's settings
  4. Open your app and you should see your device listed as "Active" in the console
Red2678
  • 3,177
  • 2
  • 29
  • 43
  • 1
    Hi, Thank you for the answer. I have tried including the script my self only after following the standard procedure which you have described above. In both instances I get the above mentioned error in the Android log. Also it's useful to know that when manually inserted and run from desktop browser, the deubugging works. I'm still to see my device being listed in debug.phonegap.com – Uchitha Jun 11 '13 at 06:31
0

You can debug your phone gap android application using Google Chrome :-

Remote Debugging on Android with Chrome

  1. Android Phone enable "USB Debugging"
  2. Connect android phone with your PC.
  3. Open you Phone gap application in your device.
  4. Open "More Tools " in Google Chrome then open "Inspect Devices" here the demo screen :-

Inspect Phonegap app page

  1. for more information visit Here

You can debug your phone gap IOS application using Safari :-

Remote Debugging with Safari Web Inspector in iOS 6

NOTE: You will need to upgrade to Safari version 6.0 to enable this functionality.

  1. On your device, go to Settings > Safari > Advanced and enable "WEB INSPECOTR"
  2. Connect I-Phone with your MAC PC.
  3. Open you Phone gap application in your device.
  4. go to In Safari’s Preferences pane under Advanced, check the Show Develop menu in the menu bar
  5. open your html page and inspect.
  6. for more information visit here