Debugging with PGB

  • 2
  • Question
  • Updated 5 years ago
  • Answered
I use PhoneGap Build, developing in a text editor like Brackets.

What's the best approach after compiling to debug javascript etc using this developing method?

I've used the PGB debug tool before, but in the past it usually just showed a white screen every 9 in 10 goes!...
Photo of Jon

Jon

  • 27 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 2
Photo of Caleb Pitman

Caleb Pitman

  • 22 Posts
  • 0 Reply Likes
The Debug has been blank in the past for me as well. I tried it today and it's working well. Make sure the app has "Debug" set in settings.

If you're desperate to fix a JS error and the debug app isnt working, you could use this:
Photo of Jon

Jon

  • 27 Posts
  • 0 Reply Likes
"use this:"... missing a link?
Photo of Krish

Krish

  • 8 Posts
  • 0 Reply Likes
I use GapDebug. Has worked fine so far. It allows you to change js code on the fly while debugging.
Photo of Gustter

Gustter

  • 44 Posts
  • 1 Reply Like
Krish.

Can I use GapDebug with Phonegap Build ?

Thanks
Photo of ullfindsmit

ullfindsmit

  • 20 Posts
  • 0 Reply Likes
My weinre is still down
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hey guys

Our debug server should be more stable nowadays.

FYI we have deployed few nodes to cater debugging needs during normal as well as peak hours.

Anyway let us know if it doesn't work well for you.

Thanks.
Photo of Caleb Pitman

Caleb Pitman

  • 22 Posts
  • 0 Reply Likes
I noticed I have to open the debug, then start my app. If i start my app then open weinre it doesn't always show.

Also, when I enter weinre, it seems to only show connections for that app build, so if you rebuild it you need to close that and open a new window.

The debug is pretty awesome. I've been using it without any problems this past week.
Photo of Jon

Jon

  • 27 Posts
  • 0 Reply Likes
Will keep this in mind with the current project when we start to build on PGB.
Photo of ullfindsmit

ullfindsmit

  • 20 Posts
  • 0 Reply Likes
I am clearly missing something here because

[!DOCTYPE html]
[html]
[head]
[meta charset="utf-8"]
[meta http-equiv="Content-Type" content="text/html; charset=utf-8" /]
[meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /]
[meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"]

[link rel="stylesheet" href="css/bootstrap.min.css" ]
[link rel="stylesheet" href="css/readable.bootstrap.min.css" ]
[link rel="stylesheet" href="css/bootstrap-datepicker3.min.css" ]

[link href="css/Site.css" rel="stylesheet"]

[/head]
[body]

Aloha
[script type="text/javascript" src="cordova.js"][/script]
[/body]
[/html]

Does not register on Weinre

Config xml has

[gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.1.0" /]

[access origin="*" /]
[allow-intent href="http://*/*" /]
[allow-intent href="https://*/*" /]

[allow-navigation href="http://*/*" /]
Photo of Slow Squirrel

Slow Squirrel

  • 32 Posts
  • 0 Reply Likes
We have used Chrome Debugger for both IOS and Android platforms since we have both devices in our lab.

https://developer.chrome.com/devtools...

Hope this helps or leads you in the right direction.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@ullfindsmit,
Please use some HTML. (see attached image)
Photo of ullfindsmit

ullfindsmit

  • 20 Posts
  • 0 Reply Likes
Yeah it didnt like the config xml elements so I had to replace the < with the [ and the > with the ]

Anyway, I found the issue
[meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"]
in my index.html was the root cause

Removed it and it worked