LinuxCommandLibrary

sfdk-emulator-exec

Run SmartDeviceLink core in an emulator

TLDR

Execute a command on an emulator

$ sfdk emulator exec [emulator] [command]
copy

Run an interactive shell on an emulator
$ sfdk emulator exec [emulator]
copy

SYNOPSIS

sfdk-emulator-exec [SFDK_OPTIONS] [--] COMMAND [COMMAND_ARGS...]

PARAMETERS

COMMAND
    The specific command to be executed inside the Sailfish OS emulator instance.

COMMAND_ARGS...
    Optional arguments that are passed directly to the command being executed inside the emulator.

--emulator-id
    Specifies the unique ID of the emulator instance to connect to. If omitted, the command typically targets the default or only currently running emulator instance.

--root
    Executes the specified command with root (superuser) privileges inside the emulator. Use with caution as this can make system-wide changes.

--help
    Displays a brief help message and usage information for the sfdk-emulator-exec command.

--
    A special separator used to indicate that all subsequent arguments on the command line are to be interpreted as part of the COMMAND and its COMMAND_ARGS, rather than as options for sfdk-emulator-exec itself. This is particularly useful when the command or its arguments might conflict with sfdk-emulator-exec's own options.

DESCRIPTION

The sfdk-emulator-exec command is a utility provided by the Sailfish OS SDK (SFDK) that allows developers to execute commands directly within a running Sailfish OS emulator instance. It acts as a bridge, enabling remote shell access to the emulated environment without needing to manually set up SSH connections or other complex network configurations. This tool is indispensable for debugging applications, inspecting the emulator's filesystem, managing processes, and performing various administrative tasks inside the virtual Sailfish OS device during development. It streamlines the testing process by providing a direct way to interact with the emulator's operating system, facilitating rapid iteration and troubleshooting.

CAVEATS

Successful execution of sfdk-emulator-exec relies on the Sailfish OS SDK being properly installed and configured on the host system. Furthermore, the target Sailfish OS emulator instance must be actively running and accessible for the command to establish a connection and execute the desired operations. Commands run inside the emulator will operate within its specific environment, including its own PATH, user permissions (defaulting to 'nemo' unless --root is used), and filesystem structure, which may differ from the host system.

USAGE EXAMPLES

Here are some common usage examples of sfdk-emulator-exec:

Listing files in the emulator's root directory:
sfdk-emulator-exec ls /

Checking disk usage as root within the emulator:
sfdk-emulator-exec --root df -h

Executing a command with arguments containing spaces using the separator:
sfdk-emulator-exec -- find /usr/share -name '*desktop*'

Running a custom script located in the emulator's home directory:
sfdk-emulator-exec /home/nemo/myscript.sh

HISTORY

sfdk-emulator-exec is a core component of the Sailfish OS SDK, which was developed by Jolla to facilitate application development for the Sailfish OS platform. It emerged as an essential tool early in the SDK's lifecycle, providing developers with direct shell access to the evolving emulator environment. Its design and functionality have been continuously refined alongside updates to Sailfish OS and its underlying virtualization technologies, ensuring it remains a robust utility for developers across various SDK versions.

SEE ALSO

sfdk(1), ssh(1), adb(1)

Copied to clipboard