Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Enyo App WebOS 3.0?

Tags:

webos

enyo

i am nooby to WebOS3.0 (also in Mojo). And now days i am working on palm pad apps dev. and i want to know how to debug enyo apps?

like image 580
Ajay Patel Avatar asked Jun 29 '11 13:06

Ajay Patel


4 Answers

You can run enyo apps in a webkit browser with mock services. Then just use the Chrome debugging tools.

Note that you'll have to start Chrome with the necessary command line switches to allow for file access or cross domain xhr.

If you need to debug against your app in the emulator or a device you can use the Ares debugger. https://ares.palm.com/AresDebug/

like image 155
Ryan Watkins Avatar answered Sep 23 '22 02:09

Ryan Watkins


For most of your debugging, you should be able to use Chrome with the " --allow-file-access-from-files" switch. However, as I have been working with saving user preferences, developing services, etc, I have found that running the emulator and using palm-run from inside the project directory is the easiest way to debug some of the more in-depth items.

There are some cool web-based loggers out there, but if you configure Console2 with an extra-wide setting, and stick with that, your logging from the emulator is easy enough to read off of the command line (or powershell).

like image 23
Joe Avatar answered Sep 21 '22 02:09

Joe


If you want to print to a log, from the device, put one of the following in your code:

  • enyo.Log("...");
  • enyo.Warn("...");
  • enyo.Error("...");

Then, with your device in developer mode, run "palm-log -f your.app.id". The -f flag makes the log follow the app, instead of printing once and quitting. Note that this requires the log level to be set high enough to print. To set log level on the touchpad, run the device info app. Select "custom application" from he app menu, and enter "##logs#". Keep in mind that running the device with logging enabled (not at minimum) can slow it down.

like image 45
Chris Avatar answered Sep 21 '22 02:09

Chris


If you use localstorage.getItem() and localStorage.setItem() that will work in both Chrome and on the device, meaning you can test the saving and restoring of preferences and settings etc without having to leave Chrome (and keep re-packaging and installing the app). You can also use the Chrome dev tools then to inspect these methods and the local storage section of the resources tab.

like image 35
LDJ Avatar answered Sep 23 '22 02:09

LDJ