Reputation: 9371
My HTML5 app is packaged by Ionic (using Cordova) and loads onto my iPhone like a normal app.
Can I debug whilst connected to the device? I know with Android you have logcat and in the browser I have dev tools but there are differences between the app on device and the browser and I want to know why.
Any help appreciated.
Thanks
Upvotes: 49
Views: 70874
Reputation: 6819
i'm using ionic 2 and typescript.
you can use debugger
keyword to debug on ios like this:
then open safari -> developer -> simulate -> index.html, good luck
Upvotes: 7
Reputation: 329
Similar to the first answer, here's how I debug on iOS.
ionic emulate ios -lc
Which runs app using simulator and outputs console logs and errors to terminal with live reloading.
Upvotes: 11
Reputation: 1569
You can use Visual Studio Code with the following extension: https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools
Regards, Nicholls
Upvotes: 3
Reputation: 10857
I'd also add that in Ionic 1.2, you can get console/error output right in Terminal via ionic serve
or ionic emulate
.
Upvotes: 0
Reputation: 6976
There are three primary options.
ionic run ios -l -c -s
with the flags will use live reload and print the logs to the console. http://ionicframework.com/blog/live-reload-all-things-ionic-cli/Upvotes: 85