Introduction
The CLI (Command Line Interface) provides a collection of commands used for creating, packaging, installing, and launching web apps in the command line environment. The CLI allows you to develop and test your app without having to use a specific IDE.
CLI Features
With the CLI, you can install your app on a target device, such as the emulator or webOS TV. Besides, you can retrieve, run, terminate, and remove the apps installed on the target device. You can use the CLI during any of the following stages of the development process:
Commands
The following shows the commands you could use:
Commands |
Descriptions |
---|---|
ares |
Provides the help menu for using the ares commands |
Creates a web app from a template. |
|
Creates and analyses an app package file. |
|
Manages the target devices. |
|
Installs an app on the target device. |
|
Runs or terminates the web app. |
|
Runs the Web Inspector for web app debugging. |
|
Runs the Web server for testing local app files. |
|
Gets a private key from webOS TV for the Developer Mode app. |
|
Retrieves a device's system information and monitors the device's resource usage. |
|
ares-extend-dev | Extends the session time of the developer mode for the Developer Mode app. |
-
Open All
-
- ares-package
-
Packages the app and JS service into a package file (.ipk) stored in a specified directory. With info or info-detail option, you can check the information of the package file.
The packaging process has two phases: minifying source code and creating a package file. The ares-package command reduces the size of source code by getting rid of as much redundant code as possible and merges it when creating a package file. The ares-package command adjusts and shrinks the variable names and line spacing. It also merges multiple files into a single file to reduce source code size and file load time. With info or info-detail option, shows the information of the package file (.ipk).
An error occurs if an app file name contains non-ASCII characters. App file names must contain Latin letters ONLY.
Usages
ares-package [OPTION...] APP_DIR [[SERVICE_DIR] [PKG_DIR][...]]
ares-package -i, --info PACKAGE_FILE
ares-package -I, --info-detail PACKAGE_FILE
ares-package --version
ares-package -help|-h
Options
Option
Parameter
Description
-o, --outdir
OUT_DIR
Specifies a directory where the package file is created.
-c, --check
None
Checks whether the application's appinfo.json file exists or not. This option does not make a package file. If the appinfo.json file does not exist, warning messages appear.
-e, --app-exclude
EX_DIR
Lists the directories to exclude in the package file.
-n, --no-minify
None
Skips the process of minifying the source code.
-r, --rom
None
Proceeds up to the stage just before creating a package file phase.
-i, --info
PACKAGE_FILE
Specifies the file with the .ipk extension to be analyzed.
-I, --info-detail
PACKAGE_FILE
Specifies the file with the .ipk extension to be analyzed in detail.
-v
None
Displays the execution log.
-V, --version
None
Displays the version of the ares-package command.
-h, --help
None
Displays the help of ares-package command.
Parameters
Parameter
Description
APP_DIR
Specifies the directory of the application to be packaged.
SERVICE_DIR
Specifies the directory where JS Service's package.json file is located.
PKG_DIR
Specifies the directory where the packageinfo.json file existed. The file is a metadata file that contains information used by the packaging tool and the system. In general, you do not need to create the packageinfo.json file unless you include JavaScript services into your app package. If there is no specified PKG_DIR, the ares-package command makes the packageinfo.json file from the appinfo.json file.
If you use your packageinfo.json file, keep the data rule, such as ID naming conventions in the appinfo.json file.OUT_DIR
Specifies the directory where the package file is to be created. If you do not enter the directory, the package file is created in the same directory as the command.
EX_DIR
Specifies the name of directories and files to exclude from the application when packaging the package file. You should enter the directories used for samples and tests. All subdirectories and files in the specified directory are excluded. Besides, specified files are excluded. Command finds directories and file recursively from the application directory that is matched. To exclude multiple directories, enter as "-e subdir -e filename.” you can also use a common pattern expression such as wildcard (*).
PACKAGE_FILE Specifies the file with the .ipk extension to be analyzed. The ares-package command recognizes SERVICE_DIR and PKG_DIR automatically by the configuration file. There is no order between the SERVICE_DIR and PKG_DIR.
Examples
Here are some examples of different uses:
Creating a package file from ./sampleApp directory and outputting it in the working directory
ares-package sampleApp
Creating a package file from the ./sampleApp directory and outputting it in ./output directory
ares-package -o output sampleApp
Creating a package file for debugging (without minifying source code)
ares-package --no-minify sampleApp
Creating a package file except for testCode1 sub-directory, README.md file and all text file (.txt)
ares-package -e "testCode1" -e "README.md" -e "*.txt" samplePrj
Creating a package file with external JS Service directory
ares-package sampleApp sampleService
Analyzing a package file
ares-package -i ./com.examples.app_1.0.0_all.ipk
Analyzing a package file in more detail
ares-package -I ./com.examples.app_1.0.0_all.ipk