Code debugging best practices

Hi All,

I’m fairly new to Zapworks Studio, but i’m keen to know an ideal setup for easy code debugging.

Situation:
Say you are making an experience using an image marker and some button interactions, what’s the easiest way to test these interactions? I can’t seem to be able to test buttons (or code logs for instance) in the main studio scene.

Is scanning the tracker with your phone and taking a look at your console through Chrome dev-tools the only real option of debugging your code? Or can you do this directly in studio?

Thanks in advance,

Tom

1 Like

Hi All,

Just wanted to check up if anyone could help me figure out the best way to test my scripts.
Surely there is a way to live preview without having to publish or upload everytime you make a new code commit?

Any input is very welcome

Thanks in advance,

With kind regards,

Tom

1 Like

Anybody?
Any feedback, even negative, is welcome.

Thanks in advance

1 Like

Hi @tom.geurts,

The two ways of debugging an experience created in ZapWorks Studio are:

  1. Launching into Zappar desktop and clicking on the setting cog. This will bring up the developer tools, where you can see a live console on runtime and any potential errors.

debug

  1. Sometimes the Zappar for desktop debugger isn’t quite enough. As you have explained you can also use Google developer tools to debug your experience. Here are some steps below to help set this up.

** Please not, this is for Android only.

  • First make sure that your device has developer mode enabled. For most android devices this is activated by going to settings → About Phone → Software Information and then tapping Build Number several times. If that doesn’t work, Google’ll know.
  • Inside Developer Options tap USB debugging . Your device may ask you to confirm this.
  • Plug your device into your laptop
  • Go to chrome://inspect in chrome
  • Tap Allow USB Debugging again if it comes up on your device
  • Open Zappar
  • Tap Inspect, and enjoy your USB debugging capabilities

At the moment there is no way to debug on a live preview window. You must first preview/publish the project. This not as bad as it sounds because with the speed of our instant preview/publishing, you can be debugging in seconds.

I will pass on the feature request of having a live preview and live debugging console to the platform team and see what they say.

Hope this helps.

George

2 Likes

Thanks for this, George.

I was already using the android/Chrome debugging option.
A live preview window with debugging would be awesome, and would really make a difference in AR development.

Instant preview/publishing is pretty quick but still takes about 20+ seconds (start to finish) to get a preview live on your phone. Get’s annoying when you are working on a bigger project with custom code and want to test with quick iterating.

3 Likes