Debugging Typescript in Safari and Cordova

Posted on 10/16/2016 @ 3:25 AM in #Apple by | Feedback | 1973 views

If you write cordova projects all the time, you would have noted that you can’t debug Typescript code in iOS projects using Safari. That sucks because if you are writing Javascript by hand and not using Typescript, you are .. well stupid. Sorry but there is no reason to not use Typescript.

But it all breaks down when you try debugging iOS apps in Safari because well, safari, the new IE6, cannot understand sourcemaps.

Fear not. VSCode has a workaround.
Here is what you do,

Step #1 – Use VSCode LOL
Step #2 – Install the “Cordova Tools” extension.
Step #3 – brew install ideviceinstaller ios-webkit-debug-proxy
Step #4 – Go to the debug tab, the one that looks like a bug with an X through it. Choose this to be a Cordova project, and set breakpoint and debug typescript.

NEAT! Seriously, this is crazy sweet!

Sound off but keep it civil:

Older comments..