Mobile Wearable

Smart Development Bridge

The Smart Development Bridge (SDB) is a device management tool included in the Tizen SDK:

  • The SDB manages multiple device connections. You can list connected devices and send a command to a specific device with a serial number that is created by the SDB.
  • The SDB supplies basic commands for application development, such as file transfer, remote shell command, port forwarding for a debugger, viewing, filtering, and controlling device log output.
  • The SDB also includes the Emulator.

To use the SDB:

  1. To use the SDB in a target device, set the device to the SDB mode by going to Settings > More system settings > Developer options > USB debugging in the device menu.
  2. Run the SDB with a shell using the following command:
    $ sdb [option] <command> [parameters]

    Where [option] can be:

    • -d: Directs the command to the only connected USB device and return an error if more than one USB device is present.
    • -e: Direct the command to the only running Emulator and return an error if more than one Emulator is present.
    • -s <serial number>: Direct the command to the USB device or Emulator with the defined serial number.

      If multiple Emulator or device instances are running, you need to specify a target instance in the SDB command.

    • devices: List all connected devices.

      Before issuing SDB commands, it is helpful to know which Emulator or device instances are connected to the SDB server. In response to this command option, the SDB prints the serial number (a string created by the SDB to uniquely identify an Emulator or device instance) and connection status for each connected device. The connection status can be offline (the instance is not connected to the SDB or is not responding) or device (the instance is connected to the SDB server).

      The following snippet shows an example of the command output:

      $ sdb devices
      List of devices attached 
      emulator-26100 device myemulator1
      emulator-26200 device myemulator2

    For more information about the available commands and their parameters (<command> [parameters]), see SDB Commands.

  3. To stop the SDB server, use the kill-server command.

    If the SDB does not respond to a command, try to terminate and restart it to resolve the problem. You can restart the server after stopping it by issuing any SDB command.

SDB Commands

The following table lists the commands available for the Smart Development Bridge (SDB).

Table: SDB commands
Command Description
sdb devices List all connected devices.
sdb connect <host>[:<port>] Connect to a device through TCP/IP.
sdb disconnect <host>[:<port>] Disconnect from a TCP/IP device.

Port 26101 is used by default if no port number is specified. Using this command with no additional arguments disconnects from all connected TCP/IP devices.

sdb push <local> <remote> [-with-utf8] Copy a file or directory recursively to the device's data file.

The <local> and <remote> parameters refer to the paths to the target files or directories on the development machine (local) and the device instance (remote). The following command shows an example:

The [-with-utf8] parameter creates the remote file with the UTF-8 character encoding.

$ sdb push data.txt /opt/apps/org.tizen.hellotizen/data/data.txt
sdb pull <remote> [<local>] Copy a file or directory recursively from the device's data file.

The <remote> and <local> parameters refer to the paths to the target files or directories on the device instance (remote) and the development machine (local). The following command shows an example:

$ sdb pull /opt/apps/org.tizen.hellotizen/data/data.txt data.txt
sdb shell Run a remote shell interactively by dropping into a remote shell on an Emulator or device instance.

To exit the remote shell, press Ctrl+D or use the exit command to end the shell session.

sdb shell <command> Run a remote shell command without entering the SDB remote shell on the device. The following commands are available:

ls, rm, mv, cd, mkdir, cp, touch, echo, tar, grep, cat, chmod, rpm, find, uname, netstat, and killall

sdb dlog [option] [<filter-spec>] View and follow the content of the device log buffers.

To view the log output in your development computer or from a remote SDB shell, use the sdb dlog or dlogutil command, respectively.

The [<filter-spec>] parameter defines the tag of interest (the system component from which the message originates) and the minimum level of priority to report for that tag. The format is tag:priority, and multiple filters must be separated with a space. The available priorities (from lowest to highest) are V (Verbose), D (Debug), I (Info), W (Warning), E (Error), and F (Fatal).

For example, to view all log messages of the info priority in addition to the MyApp tag messages of the debug priority, use the following command:

$ sdb dlog MyApp:D *:E

For more information about the command options, see Controlling Log Output.

sdb install <path_to_tpk>

Push the tpk package file to the device and install it.

The <path_to_tpk> parameter defines to the path to the tpk file. The following command shows an example:

$ sdb install /home/tizen/ko983dw33q-1.0.0-i386.tpk
sdb uninstall <appid>

Uninstall the application from the device.

The <appid> parameter defines the application ID of the application. The following command shows an example:

$ sdb uninstall ko983dw33q
sdb forward <local> <remote> Set up arbitrary port forwarding of requests from a specific host port to a different port on a device instance.

The format for the <local> and <remote> parameters is tcp:<port>. The following example shows how to forward requests from host port 26102 to device port 9999:

$ sdb forward tcp:26102 tcp:9999

After setting up port forwarding, development tools between the device and host can work remotely. For example, gdb in a host/gdbserver in a device, and gdbserver in a device open with the tcp:9999 port:

$ sdb shell gdbserver:9999 hellotizen

gdb in a host connects to localhost:26102

$ gdb hellotizen ... (gdb) target remote localhost:26102
sdb help Show the help message.
sdb version Show the version number.
sdb start-server Start the server if it is not running.
sdb kill-server Stop the server if it is running.
sdb get-state Print the target device connection status: device of offline.
sdb get-serialno Print the serial number of the target device.
sdb status-window Continuously print the connection status for a specified device.
sdb root <on|off> Switch between the root and developer account mode.

The on value sets the root mode and the off value sets the developer account mode.

Controlling Log Output

The following list defines the available options for the sdb dlog and logutil commands:

  • -b <buffer>

    Alternate log buffer. The main buffer is used as a default buffer.

  • -c

    Clear the entire log and exit.

  • -d

    Dump the log and exit.

  • -f <filename>

    Write the log to the <filename> file. The default file is stdout.

  • -g

    Print the size of the specified log buffer and exit.

  • -n <count>

    Set the maximum number of rotated logs to <count>. The default value is 4. This option also requires the -r option.

  • -r <Kbytes>

    Rotate the log file every <Kbytes> of output. The default value is 16. This option also requires the -f option.

  • -s

    Set the default filter to silent.

  • -v <format>

    Set the output format for log messages.

    You can define which metadata fields (such as tag and priority) are included in log messages by setting one of the following output formats:

    • brief: Displays the priority/tag and PID of the originating process. This is the default format.
    • process: Displays the PID only.
    • tag: Displays the priority/tag only.
    • thread: Displays the process:thread and priority/tag only.
    • raw: Displays the raw log message, with no other metadata fields.
    • time: Displays the date, invocation time, priority/tag, and PID of the originating process.
    • long: Displays all metadata fields and separate messages with a blank line.
Go to top