Classes
Methods
(async) shell(command) → {Promise.<string>}
Runs a shell command on the connected Android device. This method requires the Android device to be properly configured.
Parameters:
Name | Type | Description |
---|---|---|
command | string | The shell command to run on the Android device. |
Throws:
- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
- Type:
- Promise.<string>
Example
await commands.android.shell('');
(async) shellAsRoot(command) → {Promise.<string>}
Runs a shell command on the connected Android device as the root user. This method requires the Android device to be properly configured and that you rooted the device.
Parameters:
Name | Type | Description |
---|---|---|
command | string | The shell command to run on the Android device as root. |
Throws:
- Throws an error if Android is not configured or if the command fails.
- Type
- Error
Returns:
A promise that resolves with the result of the command or rejects if there's an error.
- Type:
- Promise.<string>
Example
await commands.android.shellAsRoot('');