nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Console.log has no output on terminal

Open NickIliev opened this issue 9 years ago • 14 comments

From @bigradish on September 13, 2017 2:41

When I follow the steps in the "Debugging apps" section of your tutorial https://docs.nativescript.org/tutorial/chapter-1 , both console.log and console.dir have no output on the terminal.

More info:

  1. development machine: Windows 10 64bit
  2. target platform: android
  3. cli version: 3.2.0
  4. Cross-platform modules: 3.1.1
  5. Runtime: 3.2.0
  6. Plugin: no plugin used, just the HelloWorld project in the tutorial.

Thank you.

Copied from original issue: NativeScript/NativeScript#4835

NickIliev avatar Sep 13 '17 06:09 NickIliev

I have the same issue on the same CLI and runtime version but on Mac and with iOS as target platform.

christian-kolb avatar Sep 20 '17 13:09 christian-kolb

If I run the app with tns debug ios --watch I get console output in the Nativescript Inspector. But only there and this seems to be the only way to get to the logging. The problem is for all logging information including errors.

christian-kolb avatar Sep 20 '17 13:09 christian-kolb

@bigradish and @NickIliev Did one of you try to use an older version of the CLI yet? I first thought it might be related to the XCode update and the new iOS 11, but as you're using Android on Windows those two things don't seem to be related.

christian-kolb avatar Sep 20 '17 15:09 christian-kolb

@christian-kolb I just upgraded to XCode 9 and iOS 11 and my console.log quit outputting to the terminal. Was working fine previous to updating XCode. Have not been able to get it working again. tns debug ios --watch does output to the nativescript console, but not the terminal. Any help or suggestions would be awesome!

glen-stephens avatar Sep 27 '17 22:09 glen-stephens

Same as glen-stephens

thegermin8er avatar Sep 28 '17 00:09 thegermin8er

Hey guys, Regarding the problem with the missing logs with XCode9 / iOS 11, this is caused by changes in the latest iOS and how event logging is handled. We are working on resolution and it should be available in the next minor release.

Regarding the problem with Windows and Android - this is not related to the above issue. We will take a look and let you know.

etabakov avatar Sep 28 '17 07:09 etabakov

For those who need logging back; here is the way I'm doing it now... fluentreports.com/blog/?p=545

NathanaelA avatar Sep 29 '17 02:09 NathanaelA

@etabakov If it helps, console.log does work to the terminal when running on an actual device, just not from the simulator.

glen-stephens avatar Sep 29 '17 02:09 glen-stephens

Here is a separate issue for iOS11 Simulator and Xcode9: https://github.com/NativeScript/nativescript-cli/issues/3141. Lets continue the discussion there.

KristianDD avatar Sep 29 '17 08:09 KristianDD

Why this issue has not received any process till now?

bigradish avatar Nov 19 '17 01:11 bigradish

Can confirm that console.log() and console.dir() work on mac Xcode 9.2 simulator and device and on Windows - emulator and device. using current rc versions of nativescript and runtimes. All related fixes will be available in next official release.

You can test it out too in rc --> npm i -g nativescript@rc tns platform add ios@rc and please share if you still encounter the same problems.

Natalia-Hristova avatar Apr 04 '18 14:04 Natalia-Hristova

I am still facing the same issue? ios12 and xcode 9.4

dexter2019 avatar Sep 23 '18 15:09 dexter2019

Same issue here. ios12 and xcode 9.4. tns run ios stops at refreshing application, won't refresh the application and won't log to the console.

socalrunner avatar Oct 03 '18 15:10 socalrunner

Hey guys, you need to update your Xcode in order to make tns run ios working on the new iOS version. Reference: https://github.com/NativeScript/nativescript-cli/issues/3940

rosen-vladimirov avatar Oct 03 '18 22:10 rosen-vladimirov