Testing WebOS, PhoneGap and Services

I wrote earlier about creating a WebOS app that called a node.js service that also was written with PhoneGap.  However I did not go into how to test it.  I know this information is all over the place on the web, however I posted it here so that I know where it is at and so that anybody else that is trying to develop for WebOS can also find it in one spot.

What I found that worked was to open 3 terminal windows, I should say that I am also using a Mac with lion.  Each of the windows are defined below.

  1. Terminal Window 1 – Change to the project directory where the Makefile is located.  In this window we will be running the command “Make” to compile, and deploy the app. to either the device or the emulator.
  2. Terminal Window 2 – Change to the project directory.
    1. Entered the command  -> novaterm
    2. Entered the command  -> tail –f /var/log/messages   or tail –f /var/log/messages | grep <packageid>     What this command does is return all of the log messages to this terminal window, if you use the second  option with the grep command plus the package id it will only return the log message for this package id only
  3. Terminal Window 3 – Change to project directory.
    1. Entered the command –> novaterm
    2. Entered the command –> luna-send -P -n 1 –f palm://com.waterhobo.cancolor.service//sayhello ‘{“path”:”test”}’    In this example it has the name of your service (com.waterhobo.cancolor.service), the service id with the method (sayhello) and finally with the parameters (parm “name” and value “test”).  By using this command you can test the service without having the app loaded.

It is really simple to see what is happening both your app and services with these commands, being new to WebOS or a Unix/Linux environment I felt pretty helpless trying to debug the services or app until I found these.

Posted in PhoneGap | Tagged | Leave a comment