tutorials | galaxy watch

Installing .NET Diagnostic Tools on Tizen Devices

writer img alt

Swift Kim

Engineer

Tizen 5.5 comes with support for a new sdb shell CLI command called dotnet. The command is for use by application and platform developers for advanced testing and debugging scenarios.

Note: You cannot use the dotnet command when developing for TV devices (missing sdb shell support).

Tip: To see which version of Tizen your device runs on, enter sdb capability and find the platform_version value.

Note: If you have ever installed the .NET SDK on Windows or macOS/Linux, you may have some knowledge about the dotnet command provided by the SDK. However, dotnet on Tizen is not a variant of the .NET SDK CLI and has a smaller number of supported features.

The following options are currently available with the dotnet command on Tizen 5.5.

sh-3.2$ dotnet -h
Execute a .NET application or command.

Usage: dotnet [options] [path-to-executable] [arguments]
Usage: dotnet [command] [arguments]

Options:
-h, --help                         show this help message
--clr-path <path>                  path to libcoreclr.so and runtime assemblies
--tool-path <path>                 path to the tool installation directory
--additionalprobingpath <path>     path containing assemblies to probe for
--globalizationinvariant           run in globalization invariant mode

Commands:
counters       monitor or collect performance counters
dump           capture or analyze a coredump
gcdump         capture a heapdump
trace          collect or convert a diagnostic event trace

Running a console application

To execute a .NET application from the command line, use dotnet or dotnet exec with an assembly (.dll) name.

Note: .runtimeconfig.json and .deps.json files are not required. dotnet automatically resolves dependencies from the executing directory.

$ sdb push MyAssembly.dll /home/owner/share
$ sdb shell
sh-3.2$ cd /home/owner/share
sh-3.2$ dotnet MyAssembly.dll

Installing and invoking a global tool

A tool is a special kind of console application which can be installed as a development add-on. Most tools use the dotnet-* prefix as a naming convention.

Microsoft has developed a set of tools which can be used for runtime diagnostics (for example, performance evaluation and problem analysis). The tools are maintained and published through the dotnet/diagnostics repo in GitHub. The currently available tools include:

To install the above tools on Tizen, follow these steps:

  1. Download the latest release of pre-built diagnostics tools (.tar.gz) from the tizendotnet/diagnostics repo.

  2. Copy the files to your device's /home/owner/share/.dotnet/tools directory.

    $ sdb push [.tar.gz] /home/owner/share
    $ sdb shell
    sh-3.2$ cd /home/owner/share
    sh-3.2$ mkdir -p .dotnet/tools
    sh-3.2$ tar -zxvf [.tar.gz] -C .dotnet/tools
    

Note: The dotnet tool install command is not supported by dotnet on Tizen.

If you have installed the tools successfully, launch them using the dotnet [name] command (omit - in the name).

sh-3.2$ dotnet dump -h
Usage:
  dotnet-dump [options] [command]

Options:
  --version    Display version information

Commands:
  collect                Capture dumps from a process
  analyze <dump_path>    Starts an interactive shell with debugging commands to explore a dump
  ps                     Lists the dotnet processes that dumps can be collected

Otherwise, you will see the following error message.

sh-3.2$ dotnet hello
Could not execute because dotnet-hello does not exist.
Go to https://developer.samsung.com/tizen to learn how to install tools.

For more usage and examples, click on the links in the Installing an invoking a global tool section.