Smartface provides application debugging feature for Android devices. In this guide we will learn how to use debug features.
- Android device ( phone or tablet )
- Decent & reliable internet connection
- Application is loaded
- Debugger connects
- app.js is loaded and executed
- Application.onStart is fired
- Asynchronous tasks:
- First Page’s onShow event is fired
Network Object events are fired if they run at startup
Until the debugger is connected, the debugging of the previous steps is not possible with the conventional methods.
In order to start debugging, you need to open "Debugger panel" and enable "Run in Debug Mode" as shown in the screenshot;
After that you can start debugging with pressing "Run on Device" module which is same as testing an application on real device.
After scan, your Smartface App will download the application with debug features.
After a successful connection, Cloud IDE debugger panel will opened automatically (if it is closed) and debugger functionalites will be available.
Also, breakpoints are listed at the debugger panel. When you right click the breakpoint section you will see an action list menu for it which are;
- Remove Breakpoints
- Remove All Breakpoints
- Deactivate Breakpoints
- Enable All Breakpoints
- Disable All Breakpoints
To track the value of a variables, it has to be added to watch. Adding to watch can be done in several ways:
- On the script editor, highlight a text, right click on menu and click "Add as Watch Expression".
- On Watch Expressions section, the value to be watched can be written to the given text area.
The Local Variables panel displays all variables in global scope and the current function scope. All parent scope items are displayed in the global scope. The properties of objects are displayed in tree mode which can be expanded.
Smartface supports basic stepping functions:
- Step over (F10) : The currently-selected line is executed and suspends on the next executable line
- Step into (F11) : The next expression on the currently-selected line to be executed is invoked, and the execution suspends at the next executable line in the method that is invoked.
- Step out (Shift + F11) : The execution resumes until the next return statement in the current method is executed or execution reaches the end of the current function, and execution suspends on the next executable line.
Immediate panel allows you to insert codes into your running application. Written immediate commands directly run on the working application.