lito
lito

Reputation: 3125

how to debug Sencha Touch 2 apps?

How to debug Sencha touch 2? I have been using Sencha Designer to create Sencha Touch 2 projects. I use Chrome for testing and now I want to breakpointing some of my code, how can I do that? Every time I refresh the page the break points are gone. I read something that I need to use the "?breakpoint" in the URL but I have no idea why is not working so far:

http://localhost/googlemaps/app.html?breakpoint

Also I realized the files i want to debug has a "_dc" parameter:

http://localhost/googlemaps/app/view/detalleMapa.js?_dc=1334242199729

Thanks!

Upvotes: 1

Views: 6561

Answers (4)

Roberto Rodriguez
Roberto Rodriguez

Reputation: 3347

Connect your phone to your PC and put this in hte browser:

chrome://inspect/#devices

Upvotes: 0

Kiran Kumar
Kiran Kumar

Reputation: 59

With chrome we get an extension for sencha, called "App Inspector for sencha, using that extension you can view the components and do the debugging.

Upvotes: 0

poqeteer
poqeteer

Reputation: 11

So just an FYI... I found (search for "How to debug Sencha Touch 2 applications? - Part 1") that you can simply add "debugger;" to your script to get the Chrome debugger to break at that point.

Upvotes: 0

Gaëtan Frenoy
Gaëtan Frenoy

Reputation: 480

With Chrome, you can start the "Developer Tools" window from the Wrench menu > Tools > Developer tools (keyboard shortcut is "Ctrl+Shift+I").

From there, you can select the "Scripts" tab and select your script in the list of all javascript files of your page.

Once you javascript file is shown, click on the line number to add a breakpoint.

If you want to debug dynamically loaded code (see Ext.Loader for details), you should add something like the following in your application:

Ext.Loader.setConfig({disableCaching: false});

Finally, reload your page and if the same file is loaded again, Chrome shall break the execution when executing that line.

Happy debugging!

Upvotes: 6

Related Questions