1
votes

I am having an unexpected result with my hybrid app(ionic framework) and the problem only replicates it self when i deploy the apk on an android phone. It works perfectly in a browser.

Is there a way i can see the logs when it is running on the phone? so i can try to understand what the problem is and where its coming from.

I have tried to run the app on my phone using ionic run android -l -c. But when i do that the app works perfectly like it does on the browser. i realised it basically just plugs itself to my local server and serves it on my phone from there (i alerted the index url. as an app it shows android_assets/www/index.html but when running with the above commant it shows http://192.168.XX.XXX/#/index)

How can i see logs when installed as an apk? Please Help

PS: im a newbie at ionic/AngularJS.

1

1 Answers

3
votes

Here is a life saver for you and many others.

  1. Install the app on the device.
  2. Make sure you have USB debugging on on the real device.
  3. On your desktop open Chrome, and in the URL address bar type chrome://inspect

Here you'll be able to see the list of devices that are connected and are using WebView. Click on inspect and you will be able to use Chrome Dev Tools on your running APK.