Saturday, May 28, 2016

Debug Ionic Android / iOS Application On Mobile Devices or Emulators

This is most exiting article for the ionic developer  because in general developer build apk the copy it from system to mobile then install and execute the program but after this article developer can save there valuable time and make more fun with android or iOS Application . Keep reading this blog for latest technology and knowledge .

Most of ionic Android developers get stuck at a phase when they are testing their application on real device, which is: how to debug or see console logs of application, particularly, those who are not from cordova or phonegap background.

Methods to Debug Application

The simplest method is to run application in your device is with the following command:
ionic run android -l -c

When you run your ionic application in your device with the above command, it acts in the same way as when you run application on browser with ionic serve. It runs application in your device but all resources are loaded from computer with liver reload. And all console logs are shown in command line window while application is running in device, as you can see -c parameter in command, that is to show consoles while -l reloads application on any change in source. 




See the following screenshot for visual understanding.


Note: Your device and computer should be on the same network, plus keep mobile connected with computer via USB port.

No comments:

Post a Comment

Dharamart.blogspot.in