Shell
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 |
|---|
class Shell.CommandOutputThe output of a shell command executed via |
Public functions |
|
|---|---|
Shell.CommandOutput |
Executes a given command and returns the ongoing |
PermissionCommands |
permission(packageName: String)Commands for permissions. |
Unit |
setShellServer(shellServer: ShellServer)Allows configuring the underlying |
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
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 |
permission
fun permission(packageName: String): PermissionCommands
Commands for permissions.
| Parameters | |
|---|---|
packageName: String |
the application package name |
| Returns | |
|---|---|
PermissionCommands |
an instance of |
setShellServer
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 |
Public properties
application
val application: ApplicationCommands
Commands for application.
| Returns | |
|---|---|
ApplicationCommands |
an instance of |
process
val process: ProcessCommands
Commands for processes.
| Returns | |
|---|---|
ProcessCommands |
an instance of |
recorder
val recorder: RecorderCommands
Commands for screen recorder.
| Returns | |
|---|---|
RecorderCommands |
an instance of |
wifi
val wifi: WifiCommands
Commands for controlling Wi-Fi.
| Returns | |
|---|---|
WifiCommands |
an instance of |