Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug Ionic app on IOS?

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

like image 601
Ben Taliadoros Avatar asked Sep 05 '14 15:09

Ben Taliadoros


People also ask

How do I debug an Ionic iOS app?

First, on the iOS device, enable Web Inspector from Settings > Safari > Advanced. Next, open Safari on a Mac then enable Show Develop menu in menu bar under Safari > Preferences > Advanced. Run the iOS simulator or connect your iOS device to your Mac, then run the Ionic app that you want to debug.

How do you debug an Ionic device?

You can use remote debugging with an actual device or simulator. If you use a real device, ensure that debugging is enabled both from the device and on the remote browser. In Android, you need to go to the settings and enable developer mode first and then USB Debugging under the developer options menu.


1 Answers

There are three primary options.

  1. Debug using Safari. This is good for debugging a hybrid app, but cannot tell you output related to native plugins. http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787
  2. Open the project and build to device in Xcode. This shows the output of the entire device http://cordova.apache.org/docs/en/3.5.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide
  3. Debug with Ionic CLI. Using 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/
like image 170
Jeremy Wilken Avatar answered Oct 11 '22 13:10

Jeremy Wilken