1.

How to debug the Ionic app on a real device (Both Android and iOS)

Answer»

Debugging is one of the crucial parts of any development. W.r.t to Ionic We can debug Android and IOS apps on Chrome or Safari Browser.

  • Android: To debug an Android app in real time, we need to follow below steps.
    • Enable developer mode on Android Mobile.
    • Run the app on the real device either by running ionic CORDOVA run android or build the apk by running ionic Cordova build android and transfer it to the PHONE.
    • Connect device to your COMPUTER with a USB cable and lunch Google Chrome browser and open URL chrome://inspect/#devices which will display your phone and app name. Click on inspect there.
    • Now you will be able to inspect the app and check the logs.
  • iOS: To debug the iOS app in real-time, we need to follow below steps
    • Run the app on the device by executing command ionic Cordova run-ios or build the app with ionic Cordova build ios and Xcode to launch the app on the phone.
    • Now open safari browser -> windows -> Enable developer options.
    • Now open developer -> Your phone -> localhost, now you will be able to debug the app in real-time.


Discussion

No Comment Found