0

I have built an ionic app. When I serve it via ionic serve (on browser), everything runs as expected. But when I do build it for android the app loads, shows the splash-screen and then just a blank white screen.

I have built the same app as configured (the cordova part) and replaced the src folder with the boilerplate that comes when you initialize a new app with ionic start and it runs just fine. Leading me to conclude that the problem is in my javascript code.

I would like to know how to debug this and how to find the console output when the device is running on an actual device. Is it possible to view the errors via adb and specifically when running on android? Any Help please

My system information:

Cordova CLI: 6.5.0 Ionic Framework Version: 2.0.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.1.7 Ionic App Scripts Version: 1.0.0 OS: Linux 4.8 Node Version: v7.6.0

davejoem
  • 4,902
  • 4
  • 22
  • 31
  • Possible duplicate of [Is there a real solution to debug cordova apps](http://stackoverflow.com/questions/21332853/is-there-a-real-solution-to-debug-cordova-apps) – e666 Mar 02 '17 at 13:40
  • A pint to note; Setting the `` in the _index.html_ will probably be chaotic and result in a "white screen of death". This was my issue that I managed to solve. – davejoem Mar 03 '17 at 06:05
  • There's a hack I have found using [appetize.io](http://appetize.io). They have a feature for running an `adb` tunnel that works pretty fine with _chrome://inspect_. Unfortunately this is for android – davejoem Mar 03 '17 at 06:17
  • @e666 Kinda the same problem. But I'm being specific to android. – davejoem Mar 03 '17 at 06:22

1 Answers1

1

You can do through 2 ways:

1. IONIC RUN COMMAND

Run your application with the following command:

ionic run ios --livereload --consolelogs

this let you see the errors at the console and fix them up.

Here there is more documentation

http://gonehybrid.com/how-to-debug-the-white-screen-of-death-in-your-ionic-app/

2. CHROME

Additionally you can debug your app with Chrome, if you're running your app into an ADV or compiling in a device connect to your PC, open your browser and type in navbar chrome://inspect/ here will appear the list of webviews, here must appear your app and you can launch the Debug tools.

Jose Rojas
  • 3,490
  • 3
  • 26
  • 40