10-12-2020, 03:20 AM
(10-11-2020, 07:27 AM)Igor7 Wrote: Hi, Daniel! Thank you. You have done a great job. I started making my first application for wasp-os and ran into several problems. I run the application as described in the documentation
tools/wasptool \\
--exec myapp.py \\
--eval "wasp.system.register(MyApp())"
then do it again, several shortcuts appear on the watch. How to remove app? And is it possible reboot the watch?
Also, I don't understand how to debug the application.
Long press (5 seconds) on the power button reboots the watch and removes applications that have not been permanently enabled.
For debugging, firstly be aware that any uncaught exception provokes the crash handler. This will display a bomb icon and then show the stack trace in a pager before switching back to the default application (the digital clock unless you have changed the default). Providing clear indication of exceptions means most of the rest of the debugging can be done with simple tools such as drawing on the screen or using the print() funciton.
Personally I do most of the initial debugging on the simulator and rely on the print() function as needed. By the time I test on a real device most of the basic problems are fixed anyway so I remove any remaining print() calls and rely on the crash handler for things I didn't think of. Note that print() statements do work on the device as well but they can cause some interesting problems if your console program doesn't exit cleanly so they are always stripped out of any application shipped with my repo..