As developers, we often build scripts and tools to sharpen our workflow. One of the simple scripts that I am refining is palm-run, my swiss-army knive of a tool that deals with packaging, installing, launching, and tailing logs as I develop my application.
I put together a walk through of palm-run
in the context of creating a new webOS application from scratch. In the screencast below I cover:
- Generating your webOS application structure
- Implementing a one-scene application
- Packaging the application and running it in the emulator
- Running an IPK directly, no packaging here mate-y
- Setting up your application for development and production uses (more below)
- Using the Palm Inspector to take a peak at the structure of your app as it runs
(I recommend going full screen on this bad boy to help read the deets.)
Development vs. Production
I wanted to go into a bit of detail on this one. When you build an app you want to have different builds for development and production. In development, you want debugging turned on with verbose output. In production, you want to exclude all but the necessary files.
The latest version of palm-run
lets you tell it that you fancy production mode via -P
.
You can enhance your webOS application to do more in this world by doing the following:
- Create a config directory at the app root
- Create framework config files for the two use cases. Here are two common versions:
Development
{ "logLevel": 99, "debuggingEnabled": true, "timingEnabled": false, "logEvents": false }
Production
{ "logLevel": 0, "debuggingEnabled": false, "timingEnabled": false, "logEvents": false }
- Create exclude files for the two use cases (excludes_development.txt and excludes_production.txt)
Now you are set. To see a shell app that uses this, check out palmrun-configtest. If you build the app you will see that there isn’t console output if you palm-run with the -P option.
What else would you want a high level program like this to do for you?
March 19th, 2010 at 11:47 am
This is beautiful. Is palm-run a shell script? – Arunabh Das
April 29th, 2010 at 9:04 am
Very nice, but unfortunately it is useless for Windows users (it is a SH script).