Mobile native Wearable native

Command Line Interface

The native CLI (command line interface) provides the functional tools for developing Tizen native applications without the Tizen IDE. It includes the entire developing process from creating to running and debugging the project. The CLI is located in the $<TIZEN_SDK_HOME>/tools/ide/bin directory. For developing an application using the CLI, add the CLI directory path to $PATH using the following command:

export PATH=$PATH:$<TIZEN_SDK_HOME>/tools/ide/bin

The CLI in the IDE provides functional commands for:

Note
To use the CLI, you need the Java Runtime Environment version 6 or higher.

The following table lists the available CLI commands.

Table: CLI commands
Command Options Description Example
tizen cli-config
tizen cli-config [-g|--global] <key>=<value>
tizen cli-config -l | --list
  • -l, --list:

    Shows the list of all CLI configuration keys and values.

  • -g, --global:

    Sets the CLI configuration key and value as global.

Queries, sets, replaces, and unsets CLI setting options.

The key and the name are separated by an equal sign.

The CLI configuration keys are:

  • default.build.architecture=<x86|arm>

    Sets the default executable architecture type: x86 or arm.

  • default.build.compiler=<llvm|gcc>

    Sets the default compiler. The default is llvm.

  • default.build.configuration=<Debug | Release>

    Sets the default build configuration. The default is the debug mode.

  • default.profiles.path=<path of profile.xml>

    Sets the path to the profile.xml file.

  • default.sdb.timeout=<timeout value>

    Sets the default connection timeout value. The default is 60000 milliseconds.

  • Set the profile.xml path globally:

    $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
    
  • List all options for which values are set:

    $ tizen cli-config –l
    default.build.architecture=x86
    default.build.compiler=llvm
    default.build.configuration=Debug
    default.profiles.path=/home/mustafa/workspace/0904/.metadata/.plugins/org.tizen.common.sign/profiles.xml
    default.sdb.timeout=60000
    
tizen list
tizen list native-project
Shows what kind of template each profile supports, and the list corresponding with the given sub-command.
  • List all templates:

    $ tizen list native-project
       [PROFILE]           [TEMPLATE]
       mobile-2.3           service_app
       mobile-2.3           static_library
       mobile-2.3           basic_edc_ui
       mobile-2.3           shared_library
       mobile-2.3           basic_ui
       wearable-2.3         service_app
       wearable-2.3         static_library
       wearable-2.3         shared_library
       wearable-2.3         basic_ui
       wearable-2.3         basic_edc_ui
    
tizen create
tizen create native-project [-p|--profile <profile name>] [-t|--template <predefined template>] 
                            [-n|--name <project name>] [-- <project location>]
  • -p, --profile:

    Sets the profile name.

  • -t, --template:

    Sets the template name.

  • -n, --name:

    Sets the project name.

  • --:

    Sets the project destination directory.

Creates a Tizen native project. If an option is empty, the default project is generated from the default template.
  • Create the template project based on the basic Tizen mobile UI project:

    $ tizen create native-project –p mobile-2.3 –t basic_ui –n basic -- /home/workspace
    $ cd /home/workspace/basic
    
tizen build-native
tizen build-native [-a|--arch <architecture name>] [-c|--compiler <compiler name>] 
                   [-C|--configuration <configuration name>] [--]
  • -a, --arch, <x86|arm>:

    Determines the architecture type for the rootstrap.

  • -c, --compiler <llvm|gcc>:

    Sets the compiler to the native project.

  • -C, --configuration <Debug|Release>:

    Selects the build configuration to build the native project.

  • --:

    Sets the project path.

Builds the Tizen native project with the default values (if you do not set the options).

There are 3 options: architecture, compiler, and configuration. All the options are required and the default values are described in the CLI configuration file.

  • Build the project with the llvm compiler and the debug mode. The x86 executable named basic is generated, if the project is built successfully:

    $ tizen build-native -–arch x86 –-compiler llvm –-configuration Debug -- /home/workspace/basic
    $ ls /home/workspace/basic/Debug/
    
  • Build the project with the default options:

    $ tizen cli-config –l
    default.build.architecture=x86
    default.build.compiler=llvm
    default.build.configuration=Debug
    $ tizen build-native -- /home/workspace/basic
    $ ls /home/workspace/basic/Debug/
    
tizen package
tizen package [-t | --type <package type>] [-s | --sign <security profile name>] [-S, --strip <on|off>] [--]
  • -t, --type <tpk | wgt>:

    Sets the package type.

  • -s, --sign:

    Sets the profile name to use for signing.

  • -S, --strip:

    Determines whether to strip the native binary.

    The default value is off. This option only works when the native binary is based on the arm architecture and release build configuration.

  • --:

    Sets the project's build configuration path or package file path with a file name.

Packages the Tizen application with signing. If there is a package file path in the options, the package is re-signed.

The Tizen application is signed with a certified profile named profiles.xml. You can create the default profile from the Tizen IDE, which generates the file in a hidden directory in your workspace (<Your workspace directory>/.metadata/.plugins/org.tizen.common.sign/profiles.xml). Set the path of the profile.xml file once before packaging the Tizen application (you can use the tizen cli-config command).

  • Set up the path of the profile.xml file that you already have:

    $ tizen cli-config –g default.profiles.path=/home/workspace/profiles.xml
    
  • Set up the path of the profile.xml file that is created from the IDE:

    $ tizen cli-config –g default.profiles.path=/home/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
    
  • Package the profile:

    $ tizen package –-type tpk –-sign myprofile -- /home/workspace/basic/Debug
    
    $ ls /home/workspace/basic/Debug
    
    org.tizen.basic-1.0.0-i386.tpk
    
  • Re-sign the package:

    $ tizen package --type tpk --sign myprofile2 -- /home/workspace/basic/Debug/org.tizen.basic-1.0.0-i386.tpk
    
tizen install
tizen install <-t | -target <target name>> <-n | --name <package name>> [--]
  • -t, --target:

    Sets the target, which installs the Tizen package.

  • -n, --name:

    Sets the Tizen package file name, which is going to be installed on the target.

  • --:

    Sets the path where the package is.

Installs a Tizen application to a Tizen device.
  • Install a basic application named org.tizen.basic-1.0.0-i386.tpk to the emulator-26101:

    $ tizen install -–target emulator-26101 –-name org.tizen.basic-1.0.0-i386.tpk -- /home/workspace/basic/Debug
    
tizen uninstall
tizen uninstall <-t | --target <target name>> <-p | --pkgid <package id>>
  • -t, --target:

    Sets the target, which uninstalls the Tizen package.

  • -p, --pkgid:

    Sets the installed Tizen package ID on the target.

Uninstalls a Tizen application from a Tizen device.
  • Uninstall a basic application whose pkgid is org.tizen.basic from the emulator-26101:

    $ tizen uninstall -–target emulator-26101 -–pkgid org.tizen.basic
    
tizen run
tizen run <-t | --target <target name>> <-p | --pkgid <package id>>
  • -t, --target:

    Sets the target, which runs the Tizen package.

  • -p, --pkgid:

    Sets the installed Tizen package ID on the target.

Runs the Tizen application.
  • Run the basic application whose pkgid is org.tizen.basic on an emulator-26101:

    $ tizen run -–target emulator-26101 –-pkgid org.tizen.basic
    
tizen version
tizen version
Prints the CLI version number of the executable and exits.
  • Show the version:

    $ tizen version
    Tizen CLI 1.0.0
Go to top