object Shell


Allows to execute commands. This class builds on top of ShellProcess and abstracts the shell streams to focus on the output of a single command execution. A ShellProcess is created for each executed command, using a ShellServer that can be reset by Shell.setShellServer.

Summary

Nested types

The output of a shell command executed via Shell.command.

Public functions

Shell.CommandOutput
command(command: String)

Executes a given command and returns the ongoing CommandOutput.

PermissionCommands
permission(packageName: String)

Commands for permissions.

Unit

Allows configuring the underlying ShellProcess utilized to execute the commands.

Public properties

ApplicationCommands

Commands for application.

ProcessCommands

Commands for processes.

RecorderCommands

Commands for screen recorder.

ScreenCommands

Commands for screen.

WifiCommands

Commands for controlling Wi-Fi.

Public functions

command

Added in 2.4.0-beta01
fun command(command: String): Shell.CommandOutput

Executes a given command and returns the ongoing CommandOutput.

Parameters
command: String

a string containing the command to launch.

Returns
Shell.CommandOutput

a CommandOutput that allows to access the stream of the command output.

permission

Added in 2.4.0-beta01
fun permission(packageName: String): PermissionCommands

Commands for permissions.

Parameters
packageName: String

the application package name

Returns
PermissionCommands

an instance of PermissionCommands.

setShellServer

Added in 2.4.0-beta01
fun setShellServer(shellServer: ShellServer): Unit

Allows configuring the underlying ShellProcess utilized to execute the commands. The current ShellServer backing Shell is always closed when setting a new one.

Parameters
shellServer: ShellServer

The new shell server to produce ShellProcess to launch commands.

Public properties

application

Added in 2.4.0-beta01
val applicationApplicationCommands

Commands for application.

Returns
ApplicationCommands

an instance of ApplicationCommands.

process

Added in 2.4.0-beta01
val processProcessCommands

Commands for processes.

Returns
ProcessCommands

an instance of ProcessCommands.

recorder

Added in 2.4.0-beta01
val recorderRecorderCommands

Commands for screen recorder.

Returns
RecorderCommands

an instance of RecorderCommands.

screen

Added in 2.4.0-beta01
val screenScreenCommands

Commands for screen.

wifi

Added in 2.4.0-beta01
val wifiWifiCommands

Commands for controlling Wi-Fi.

Returns
WifiCommands

an instance of WifiCommands.