| nav-title | title | description | position |
|---|---|---|---|
Debug |
Debug |
Debugging NativeScript for Android |
1 |
NativeScript for Android provides support for JavaScript debugging. The current implentation supports two major scenarios.
- Start debugging - starts an application with debugger enabled
- Attach/Detach debugger - attach/detach debuggger to a running application
Please note that the current implementation requires Chrome browser installed.
The following command with build, deploy and run the application with attached debugger. This will allow you to debug your application from the first JavaScript statement.
tns debug andorid --debug-brkBehind the scenes debug command together with --debug-brk option will build and start the application, then it will find available port and enable V8 debugger on that port. Finally, it will start Node Inspector and launch Chrome browser.
If you have a running application you can attach/detach debugger with the following commands.
tns debug andorid --starttns debug andorid --stopAs in the previous scenario, debug command with configure V8 debugger port, forward the port, starts Node Inspector and launch Chrome browser.
You can check whether a debugger is enabled with the following command.
tns debug andorid --get-portIt will return the current debugger port, 0 otherwise.
Current implementation has hard-coded 30 seconds timeout for establishing connection between the commnad line tool and the device/emulator.
