| java.lang.Object |
| ↳ |
android.support.test.services.shellexecutor.ShellCommandClient |
Class Overview
Client for the ShellCommandExecutor service, to allow an instrumentation to executes a shell
command in a similar manner and environment as ERROR(/@UiAutomation.executeShellCommand()) (i.e.
as either root or shell)
To use this method while running from the shell, you must prefix am instrument with: CLASSPATH=$(pm path com.google.android.apps.common.testing.services) app_process /
com.google.android.apps.common.testing.services.exec.ShellMain to start the ShellCommandExecutor
service.
Summary
| Nested Classes |
|
class |
ShellCommandClient.ClientNotConnected |
Indicates that the ShellCommandClient got an I/O error trying to reach the remote server. |
| Public Methods |
|
static
InputStream
|
execOnServer(Context context, String secret, String command, List<String> parameters, Map<String, String> shellEnv, boolean executeThroughShell)
Execute a command with elevated permissions and return immediately.
|
|
static
String
|
execOnServerSync(Context context, String secret, String command, List<String> parameters, Map<String, String> shellEnv, boolean executeThroughShell)
Execute a command with elevated permissions and block.
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
final
void
|
wait()
|
|
Public Methods
public
static
InputStream
execOnServer
(Context context, String secret, String command, List<String> parameters, Map<String, String> shellEnv, boolean executeThroughShell)
Execute a command with elevated permissions and return immediately.
| Parameters |
context |
Context: A context |
secret |
String: A string representing the speakeasy binder key |
command |
String: The shell command to be executed. |
parameters |
List: A Map parameters to be given to the shell command |
shellEnv |
Map: A Map of shell environment variables to be set |
executeThroughShell |
boolean: If set to true, the command string will be executed through the
shell with parameters given as additional shell arguments. |
public
static
String
execOnServerSync
(Context context, String secret, String command, List<String> parameters, Map<String, String> shellEnv, boolean executeThroughShell)
Execute a command with elevated permissions and block.
| Parameters |
context |
Context: A context |
secret |
String: A string representing the speakeasy binder key |
command |
String: The shell command to be executed. |
parameters |
List: A Map parameters to be given to the shell command |
shellEnv |
Map: A Map of shell environment variables to be set |
executeThroughShell |
boolean: If set to true, the command string will be executed through the
shell with parameters given as additional shell arguments. |