public static class 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 the given factory shellProcessFactoryBlock.

Summary

Nested types

public final class Shell.CommandOutput

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

Public fields

static @NonNull Shell

Public methods

final @NonNull ApplicationCommands
application(@NonNull String packageName)

Commands for application.

final @NonNull Shell.CommandOutput

Executes a given command and returns the ongoing CommandOutput.

final @NonNull PermissionCommands
permission(@NonNull String packageName)

Commands for permissions.

final @NonNull ProcessCommands

Commands for processes.

final @NonNull RecorderCommands

Commands for screen recorder.

final @NonNull ScreenCommands

Commands for screen.

final void

Allows configuring the underlying ShellProcess utilized to execute the commands.

final @NonNull WifiCommands

Commands for wifi.

Public fields

INSTANCE

Added in 1.0.0-alpha01
public static @NonNull Shell INSTANCE

Public methods

application

Added in 1.0.0-alpha01
public final @NonNull ApplicationCommands application(@NonNull String packageName)

Commands for application.

command

Added in 1.0.0-alpha01
public final @NonNull Shell.CommandOutput command(@NonNull String command)

Executes a given command and returns the ongoing CommandOutput.

permission

Added in 1.0.0-alpha01
public final @NonNull PermissionCommands permission(@NonNull String packageName)

Commands for permissions.

process

Added in 1.0.0-alpha01
public final @NonNull ProcessCommands process()

Commands for processes.

recorder

Added in 1.0.0-alpha01
public final @NonNull RecorderCommands recorder()

Commands for screen recorder.

screen

Added in 1.0.0-alpha01
public final @NonNull ScreenCommands screen()

Commands for screen.

setShellProcessFactory

Added in 1.0.0-alpha01
public final void setShellProcessFactory(@NonNull Function0<@NonNull ShellProcess> factory)

Allows configuring the underlying ShellProcess utilized to execute the commands.

wifi

Added in 1.0.0-alpha01
public final @NonNull WifiCommands wifi()

Commands for wifi.