Skip to content

Unable to debug at all on Android #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brianchirls opened this issue Mar 26, 2015 · 8 comments
Closed

Unable to debug at all on Android #386

brianchirls opened this issue Mar 26, 2015 · 8 comments

Comments

@brianchirls
Copy link

When I run tns debug android --debug-brk --log trace, the build process runs and the app is launched on the device (or emulator if no device is plugged in), and then it immediately crashes (presumably because of a bug in my code somewhere). Chrome is not launched, and there is nothing listening on port 8080.

Output is here: https://gist.github.com/brianchirls/60b4fc05e225ace40f38

Possibly related to #359, but probably not the same thing, since that guy can get it working on his device and I can't.

Also, in all the commands in the debugger documentation, "android" is misspelled as "andorid."

tns debug andorid --debug-brk
@teobugslayer
Copy link
Contributor

Hi @brianchirls,
Indeed, looking at the supplied log it seems that the 30-second timeout is insufficient. Could you follow the advice from #359 (comment)

@brianchirls
Copy link
Author

Thanks @teobugslayer. That kind of works a little. It doesn't launch Chrome, but it does pause the application and set up the debugger But once the app stops (usually because it crashes), there doesn't seem to be any way to debug it again, unless I find the node process that's listening on 8080 and kill that first. It makes for a very slow debugging process.

The bigger problem is that if there is an uncaught exception in Javascript, the app dies, and the debugger disconnects. So there's no way to find out what the error was. For some code, I can just wrap everything in a try...catch, which is far from idea. But sometimes the app crashes right as it starts, and Io can't seem to catch it. Is there a way around this? Node Inspector doesn't seem to have an option to pause on uncaught exceptions.

Also, not sure if this is helpful, but I'm seeing this error in the debugger console:

Page.getResourceTree failed.
ReferenceError: process is not defined

@teobugslayer
Copy link
Contributor

Hello @brianchirls ,

Thank you for feedback.
We will significantly improve the debugging experience for the upcoming 1.0 release. We aim to resolve the underlying issue and allow debugging of startup crashes.

@getsetbro
Copy link

+1
tns debug android --debug-brk
results in:
"Page.getResourceTree failed. ReferenceError: process is not defined"

@dtopuzov
Copy link
Contributor

Closing this issue, see #661

@mhh1422
Copy link

mhh1422 commented May 2, 2016

Any update on this issue? I am getting same error mentioned in by getsetbro and can not debug yet!

@sushruth
Copy link

Please give more information about why an issue has been closed. I went looking through all the related issues about this and could not find any useful information.

I still see this issue.

@WagnerSilveira
Copy link

WagnerSilveira commented Jun 12, 2016

@sushruth

Close you application, and launch it again in your phone and then refresh your dbug page http://127.0.0.1:8080/debug?port=40000
It is not a solution, but someway you can test your aplication
dtopuzov commented on 21 Jul 2015 "Closing this issue, see #661"
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants