This is a migrated thread and some comments may be shown as answers.

Debugging

15 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 09 Mar 2015, 07:25 PM
https://github.com/NativeScript/docs/blob/master/ApiReference/console/HOW-TO.md

Where do I get at this console data (assuming I have the windows client and an Android native Emulator and iOS device connected)?

15 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 10 Mar 2015, 07:51 AM
Hi Steve,

The information, output through the console.log statement can be viewed in either logcat (android), or in the all output window of xCode if you have opened the ios-specific xCode project (the xcodeproj is located under the platforms/ios folder of your NativeScript project).

Kind regards,
Erjan Gavalji
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 10 Mar 2015, 11:54 AM
Don't have a mac, just windows and the android emulator :/

Is there any way that NativeScript would be able to log anything to the UI or the builder? Is this at all planned?
0
Alexandre
Top achievements
Rank 2
answered on 10 Mar 2015, 01:03 PM
+1 on this. I would like to have the option to look at those logs from the companion app.

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 10 Mar 2015, 05:07 PM
I find debugging problems the hardest part right now...I think I'll do something fairly simple like wire up a tab event from a sample.  Then my previously working app just outright crashes now on companion, depoly and the emulator...and I spend the next ton of time trying to figure out why.

I wish the analysis engine could detect and predict issues I might encounter like a typo on an event function binding in the XML->js or maybe invalid javascript outside of basic syntax.

...I dunno, only real pain point for me so far.
0
Pana
Telerik team
answered on 13 Mar 2015, 08:47 AM
Hi,

We will try to provide these logs in the companion app but it will take time to implement and pass the AppStore.

Also we are already working on an XSD schema to validate the XML and integrate it in the AB.

Also we have planned better error handling. At least we will try to provide the stack trace along the error message in the crash alert.

Thank you for your feedback.

Regards,
Pana
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Avi
Top achievements
Rank 1
answered on 16 Mar 2015, 07:58 AM
How about debugging the javascript code? I tried running the debug command with the cli, but couldn't figure out how to actually do anything with that. I attempted the blink based v8 debugging client that comes with node-inspector, but it didn't load the code.
0
Richard
Top achievements
Rank 1
answered on 16 Mar 2015, 09:13 AM
I'm able to run in debug mode using
    tns debug android --debug-brk

For the javascript, I put the code below for force the system to break at the line
    debugger; //put this before the line you want to break on.

Not sure of any other way though.
0
Avi
Top achievements
Rank 1
answered on 16 Mar 2015, 09:16 AM
What tool do you use to do the actual debugging?
0
Richard
Top achievements
Rank 1
answered on 16 Mar 2015, 09:41 AM
Nothing really. When I run the debug command, it opens chrome and I can debug from there. I've attached a screenshot
0
Avi
Top achievements
Rank 1
answered on 16 Mar 2015, 01:17 PM
Strange...chrome does not popup for me (I'm on linux by the way...wonder if that makes a difference) and the application does not seem to break anywhere...even with a debugger statement.
0
Avi
Top achievements
Rank 1
answered on 18 Mar 2015, 07:21 AM
I figured out that by passing in  --log trace the random port that is assigned gets revealed.
0
Richard
Top achievements
Rank 1
answered on 18 Mar 2015, 08:48 PM
Ok. And using that port in chrome shows the node inspector?
0
Avi
Top achievements
Rank 1
answered on 18 Mar 2015, 08:48 PM
Yes
0
Richard
Top achievements
Rank 1
answered on 18 Mar 2015, 08:54 PM
Great. Breakpoints work fine for me but console.log does not output anything. Is yours working?
0
Avi
Top achievements
Rank 1
answered on 18 Mar 2015, 08:56 PM
I didn't try that...no need once I can step through.
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Erjan Gavalji
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Alexandre
Top achievements
Rank 2
Pana
Telerik team
Avi
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or