Command Line Interface

The Command Line Interface (CLI) provides functionalities for developing Tizen applications without the Tizen Studio. This topic describes the Tizen Studio CLI commands for packaging, installing, and running applications, and how they are used when working with TV applications.


Related Info


If you prefer a command line interface to the graphical Tizen Studio window, you can use the Command Line Interface (CLI) tool during the entire development process.

The Tizen Studio TV Extension supports all of the Tizen Studio common CLI commands, but some commands are used differently when working with TV applications than with mobile or wearable applications.

Prerequisites

To use the Tizen Studio CLI for developing TV applications, you need:

  • Tizen Studio 1.1 or higher

  • "Web CLI" package installed from the Tizen SDK tools in Package Manager
    Figure 1. Web CLI package in Package Manager

  • Valid certificate profile

    If you do not have one already, create a certificate profile.

  • To allow installing your applications on the test emulator or device

    In the Tizen Studio Device Manager, right-click the connected emulator or device and select "Permit to install applications".

    Figure 2. Allow installing applications

Setting Configuration Options

Example:

Set the default certificate profile directory:

tizen cli-config -g "default.profiles.path=C:\Users\User\my_workspace\.metadata\.plugins\org.tizen.common.sign\profiles.xml"

Options:

  • <key>=<value>: CLI configuration key and value to set.

    For example:

    • default.profiles.path=<profiles.xml file path>: Default certificate profile path
    • default.sdb.timeout=<timeout value>: Default SDB connection timeout. The default is 60000 milliseconds.
  • -d, --delete <key>: CLI configuration key and value to remove

  • -g, --global: Sets the specified option globally (for all installed SDKs on your computer).

  • -l, --list: Lists all CLI configuration keys and values.

For more information, see Setting Configuration Options for the common Tizen CLI.

Building Projects

Example:

Before you can create an application package from a project, build the project:

tizen build-web -- D:\CLI_TEST\BasicProject

Options:

  • -out, --output <directory name>: Output directory name.

    By default, the build result is placed in the <project path="">/.buildResult directory.
  • -- <project path>: Project directory

For more information, see Building the Project for the common Tizen CLI.

Packaging Applications

Example:

To package the “BasicProject” project into the “BasicProject.buildResult” directory:

tizen package -t wgt -s myCert -- D:\CLI_TEST\BasicProject\.buildResult

Options:

  • -t, --type wgt: Tizen Web package
  • -s, --sign <certificate profile>: Certificate profile name
  • -- <output path>: Package output path

To find your certificate profile name, in the Tizen Studio menu, select "Tools > Certificate Manager", and find the name of the active profile in the "Certificate Profile" panel.

Figure 3. Certificate profile name

Differences from Tizen Studio common CLI:

  • Only ".wgt" files can be installed on a TV.

For more information, see Packaging an Application with Signing for the common Tizen CLI.

Installing Applications

Example:

You can install the "BasicProject.wgt" application on a TV emulator in 2 ways:

tizen install -s emulator-26101 --name BasicProject.wgt -- D:\BasicProject 
tizen install -t t-1031-1 --name BasicProject.wgt -- D:\BasicProject 

Options:

  • -n, --name <package name>: Application package file name
  • -s, --serial <serial number> : Device serial number
  • -t, --target <target name>: Target device name
  • -- <file path>: Package file path

You can retrieve the serial number and target name using the sdb devices command. In the following example, the serial number of the connected device is "emulator-26101" and the target name is "t-1031-1".

Figure 4. "sdb devices" command example

Differences from Tizen Studio common CLI:

  • Only ".wgt" files can be installed on a TV.

Figure 5. Application and package ID in "config.xml" file

For more information, see Installing the Application on a Target for the common Tizen CLI.

Running Applications

Example:

You can run the "0ifISz74ep.BasicProject" application on a TV emulator in 2 ways:

tizen run -s emulator-26101 -p 0ifISz74ep.BasicProject 
 tizen run -t t-1031-1 -p 0ifISz74ep.BasicProject 

Options:

  • -p, --pkgid <application id>: Application ID
  • -s, --serial <serial number> : Device serial number
  • -t, --target <target name>: Target device name

Differences from Tizen Studio common CLI:

  • To run TV applications, the -p option requires the application ID instead of the package ID.

    You can find the application ID in the "config.xml" file.

    Figure 6. Application ID in "config.xml" file

For more information, see Running the Application on a Target for the common Tizen CLI.

Uninstalling Applications

Example:

You can uninstall the "0ifISz74ep.BasicProject" application from a TV emulator in 2 ways:

tizen uninstall -s emulator-26101 -p 0ifISz74ep.BasicProject 
 tizen uninstall -t t-1031-1 -p 0ifISz74ep.BasicProject 

Options:

  • -p, --pkgid <application id>: Application ID
  • -s, --serial <serial number> : Device serial number
  • -t, --target <target name>: Target device name

Differences from Tizen Studio common CLI:

  • To uninstall TV applications, the -p option requires the application ID instead of the package ID.

    You can find the application ID in the "config.xml" file.

For more information, see Uninstalling the Application on a Target for the common Tizen CLI.

Repackaging Applications with a New Certificate

You can repackage an existing ".wgt" file using your own certificate profile:

  1. Extract the content of the ".wgt" file using a compressed file management application, such as 7-Zip.

  2. In the unzipped content, delete the "author-signature.xml" and "signature1.xml" files.

    Figure 7. Delete signature files

  3. Build the project.

  4. Package the application using your certificate profile.