1. Home
  2. Resources
  3. Command Line Tools

Command Line Tools

Command Line Tools

The HP webOS SDK includes the following command-line development tools:

  • palm-generate —Generates basic applications and scenes
  • palm-package —Packages a Palm application before installation on the emulator or a device
  • palm-install —Installs a packaged application on the emulator or a device
  • palm-launch —Launches an installed application on the emulator or a device

Figure: Application Development Workflow

Note:

Information about application signing will be available at a later date.

These tools run on any supported development platforms. To view a list of the tools installed on a Mac or Linux system (or Windows, with cygwin installed):

  1. Open a Command Prompt window.
  2. Type palm- and press TAB twice.

palm-generate

You can use the application generator palm-generate to create applications and scenes.

Syntax

The syntax is: palm-generate options

Options

These are the options for this tool.

Option Effect
-f
--overwrite
Overwrites existing files.
-l
--list
Lists the available templates.
-p {property}
--property= {property}
Defines properties to be used during generation. The {property} parameter contains a JSON object or key-value pairs in the format "key=value". In both cases, surrounding double quotation marks are required. In addition, single quotation marks are required around any value that contains a space character.
-t {template}
--template= {template}
Uses the template {template}. If not specified, the default template new{{_app}} is used.
--help Displays help information.

Examples

The following are examples of the palm-generate command-line tool:

  • Create a new application in ~/projects/Ticker and set the application title to "Stock Ticker":

palm-generate -p "title=Stock Ticker" ~/projects/Ticker 
  • Create a new application in ~/projects/Hello and set the title, id, and version:

palm-generate -p "{title:'Hello There', id:com.mystuff.hello, version:'2.1'}" ~/projects/Hello 
  • Add a new scene named "First" to the application in ~/projects/Ticker :

palm-generate -t new_scene -p "name=First" ~/projects/Ticker 

palm-package

The application packager palm-package prepares an application for installation by converting the files in the application directory to an .ipkg file that can be consumed by the emulator.

Syntax

The syntax is: palm-package [ options ] application-directory

Where:

  • application-directory must be specified. It must exist, and must contain a valid webOS application.

Options

These are the options for this tool. The package filename is automatically generated from the id and version properties in the application's appinfo.json file.

Option Effect
-o {directory}
--outdir= {directory}
Specifies the output directory where the package will be created. If not specified, the current directory is used.
--exclude= {pattern} Excludes files with names matching {pattern}. The {pattern} is a name-matching string, and may contain the wildcards * and ?. Matching is case-sensitive unless the --ignore-case option is used.
-X {pattern_file}
--exclude-from= {pattern_file}
Excludes patterns listed in {pattern_file}. The {pattern_file} contains one name-matching string per line. Each string may contain the wildcards * and ?. Matching is case-sensitive unless the --ignore-case option is used.
--ignore-case Ignore case when matching names against patterns.
--no-exclude-eclipse By default, palm-package will exclude meta-data files used by Eclipse plug-ins.
Use the --no-exclude-eclipse option to include these files.
--no-exclude-hidden By default, palm-package will exclude hidden files.
Use the --no-exclude-hidden option to include these files.
--no-exclude-vcs By default, palm-package will exclude meta-data files used by following version control systems: CVS, RCS, SCCS, SVN, Arch, Bazaar, Mercurial, and Darcs.
Use the --no-exclude-vcs option to include these files.
--help Displays help information.

Examples

The following are examples of the palm-package command-line tool:

  • Create a package for the application in ~/projects/Ticker :

palm-package ~/projects/Ticker 
  • Create a package for the application in ~/projects/Ticker and set the output directory to ~/packages :

palm-package -o ~/packages ~/projects/Ticker 
  • Create a package for the application in ~/projects/Ticker, and exclude all text files and the tests directory:

palm-package --exclude="*.txt" --exclude="tests" ~/projects/Ticker 

Top

palm-install

The palm-install tool installs a packaged application on the device or emulator.

Note:

You cannot install an application when the device is in USB mode or Media Sync mode. The device must be in Developer mode; see Enabling Developer Mode.

Syntax

The syntax is: palm-install [options] [package]

Where:

  • [package] is the full path to the package ( .ipkg) file.

Options

These are the options for this tool.

Option Effect
-d {device}
--device= {device}
Specifies the device:
  • tcp for the emulator.
  • usb for a connected device.
    If not specified, the first device found is used.
-l
--list
Lists the application IDs of the installed applications on the specified device.
-r {application}

--remove {application}
Removes the application with the application ID {application}, which corresponds to the id property in the application's appinfo.json file.
--help Displays help information.

Examples

The following are examples of the palm-install command-line tool:

  • Install the package (on the default device):

palm-install ~/projects/packages/com.example.app_1.0_all.ipk 
  • Remove the application (from the default device):

palm-install -r com.example.app 
  • List the applications (on the default device):

palm-install -l 
  • List the applications on the usb-connected device:

palm-install -d usb -l 
  • List the applications on the emulator:

palm-install -d tcp -l 

palm-launch

The palm-launch tool launches (or closes) an application on the emulator or device.

Syntax

The syntax is: palm-launch [options] {application}

Where:

  • {application} is the application ID, which corresponds to the id property in the application's appinfo.json file.

Options

These are the options for this tool.

Option Effect
-c
--close
Closes the application instead of launching it.
-d {device}
--device= {device}
Specifies the device:
  • tcp for the emulator.
  • usb for a connected device.
    If not specified, the first device found is used.
-f
--relaunch
Closes and relaunches the application.
-i Runs the application with the Inspector.
-l
--list
Lists the application IDs of the installed applications on the specified device.
-p {parameters}

--params= {parameters}
Specifies launch parameters. The {parameters} parameter contains
a JSON object or key-value pairs in the format key:value. In both cases, quotation
marks are required.
--help Displays help text.

Examples

The following are examples of the palm-launch command-line tool:

  • Launch the application (on the default device):

palm-launch com.example.app
  • Launch the application with debugging options:

$ palm-launch -p "{mojoConfig: {debuggingEnabled:true}}" com.example.app
  • Close the application (on the default device):

palm-launch -c com.example.app
  • List the applications (on the default device):

palm-launch -l
  • List the applications on the usb-connected device:

palm-launch -d usb -l
  • List the applications on the emulator:

palm-launch -d tcp -l

Top

Enabling Developer Mode

To install and test applications on a HP webOS device, you need to enable Developer mode on the device.

Note:

Locking the phone with a PIN does not protect data on the device in Developer mode. When Developer mode is enabled, it is possible to use tools such as novaterm to access the device through the USB even if the phone is locked.

Enable Developer mode, webOS 1.0-1.4.5

  1. In Card view or in the Launcher application, type the following:
    upupdowndownleftrightleftrightbastart
  2. Tap the resulting Developer Mode Enabler icon.
  3. In the application, move the Developer Mode slider to the On position.
  4. Tap Reset the Device .
    When reset is complete, Developer mode is enabled.

Enable Developer mode, webOS 2.0

  1. Go to the phone app. 
  2. On a GSM phone, press "#*DEVMODE#", followed by the call button. On a CDMA phone, press "##DEVMODE#". (If the device is GSM, and there is no SIM card, a screen may be displayed instructing you to install one. Just begin typing the "#*" and the phone app will appear.)
  3. The Developer Mode scene will be displayed.
  4. Select "On". You will be prompted to re-boot the device.