Use default shell instance to execute input text
command, simulate inputting text.
Default shell instance will be created automatically when using Tap, Swipe, SendKey, InputText etc. If you want to use adb permission or specific shell options, you should use setDefaultShellOptions before using these functions.
These functions start with uppercase letter, which means they require root or adb permission, otherwise they only work in this app.
Text to input, only support ASCII characters
Use default shell instance to execute input keyevent key
command, simulate sending key.
Default shell instance will be created automatically when using Tap, Swipe, SendKey, InputText etc. If you want to use adb permission or specific shell options, you should use setDefaultShellOptions before using these functions.
These functions start with uppercase letter, which means they require root or adb permission, otherwise they only work in this app.
Key name or key code, like "HOME" or 3, see KeyEvent
Use default shell instance to execute input swipe x1 y1 x2 y2 duration
command, simulate sliding from position (x1, y1) to position (x2, y2).
Default shell instance will be created automatically when using Tap, Swipe, SendKey, InputText etc. If you want to use adb permission or specific shell options, you should use setDefaultShellOptions before using these functions.
These functions start with uppercase letter, which means they require root or adb permission, otherwise they only work in this app.
Swipe duration, unit is millisecond
Use default shell instance to execute input tab
command, simulate clicking position (x, y).
Default shell instance will be created automatically when using Tap, Swipe, SendKey, InputText etc. If you want to use adb permission or specific shell options, you should use setDefaultShellOptions before using these functions.
These functions start with uppercase letter, which means they require root or adb permission, otherwise they only work in this app.
Check if there is a specific privilege, such as whether there is root permission.
Privilege type, such as "root" or "adb"
Whether there is a specific privilege
Create a Shell instance.
We usually use exec function to execute a single command and get the result, but if there are multiple commands to execute, the efficiency of Shell object is higher. This is because we don't need to create a new shell process every time we execute.
We can also listen to Shell's output by using Shell object.
Shell options, will override default options
New shell instance
Create a new shell process, and execute a command, return the result asynchronously.
Command to execute
Shell options, will override default options
Promise of execution result
Get default options for Shell.
Check if device is rooted. Note that device is rooted does not mean this app has root permission.
Set default options for Shell. These options include whether to use Root permission, adb permission, environment variables, etc. They will be used when creating new Shell or RootAutomator instance.
Shell options
Generated using TypeDoc
Shell is Unix shell, which provides a set of commands for interacting with the operating system. Many programs can use shell to execute shell commands, such as terminal emulator.
Auto.js Pro 9 also includes a terminal emulator for executing npm, node commands. This module creates a Shell object or executes a shell command using exec function, which supports
node
andnpm
commands unless you modify thePATH
environment variable.This module provides functions createShell to create a new Shell object and exec function to execute a shell command once.