Ionic-framework: Console logging is not visible when running in Android emulator

Created on 9 Mar 2017  路  3Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x
[ x] 2.x

I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

Create a new project using ionic start.
Run ionic emulate|run android -l -c -s
Edit page
Save

Android emulator reloads app, however there are no console logs.

If I connect ddms and run logcat I can see the log statements appearing.

Expected behavior:

Android emulator should reload and console logging should appear in terminal.

If I update the scripts section of the package.json to look like this:

"build": "ionic-app-scripts build --dev",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "build",
"deploy:before": "build",
"build:before": "build",
"run:before": "watch"

Then console logs appear and reloading works but is flakey and the app won't reload properly and hangs with white screen of death.

Steps to reproduce:

Related code:

ionic run android -l -c -s
ionic emulate android -l -c -s

ionic run android -l -c
ionic emulate android -l -c

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.5.0 
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.10.0
Xcode version: Not installed

Most helpful comment

I'm using Chrome -> Inspect Devices. It's way better for debugging on android than the standard console. But you're right - the standard console logs are not working here, too

All 3 comments

I'm using Chrome -> Inspect Devices. It's way better for debugging on android than the standard console. But you're right - the standard console logs are not working here, too

This issue was moved to driftyco/ionic-cli#1980

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings