API interface documentation
1. API request address
ws://127.0.0.1:22222/
2. API request structure
Both the request and response are JSON data structures, and the request parameters are of string type unless otherwise specified.
Request example:
{
"action":"pushEvent",
"davices":"all",
"data":{
"type":"2"
}
}Response example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}
3. API public parameters
3.1. Request parameters
The following table shows the description of public request parameters.
action
string
YES
"pushEvent"
Request event type, case insensitive
devices
string
yes
"all"|"xxx,xxx"
Device serial number/serial number, all means all, multiple device serial numbers are separated by English commas, if there is no serial number, you can use [IP:port] to pass the value. You can view it in the device list-serial number, or use [Get Device List] to obtain it.
data
json
no
Request parameters
JSON, optional
3.2. Return parameters
Explain the criteria for determining success and exception returns. Also, explain the format of the returned data (such as JSON/XML).The following table shows the description of public return parameters.
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
null
It is JSON when there is data, and null when there is no content.
4. API public response code
1.This article lists and explains the common response codes. If you want to know the error codes related to the business logic of a certain interface, please refer to the documentation of the interface.
For example:400
For example:InvalidParameter
For example:The request contains an invalid parameter.
For example: the request contains invalid parameters。
10000
10000
Request successful
10001
10001
Request failed
2.How to test the API interface functions? Search for "websecoket online testing tool" in your computer browser and go to https://websocketking.com/.
1.Panda software needs to be kept running.
1.Enter the server address and click Connect.
2.Enter the API statement and click send to execute.

3.What to do if the API interface is unusable?
Cause Analysis
1.The devices field was not entered correctly. 2.The client has enabled safe mode or accessibility mode.
1.When the device is connected via USB, the device serial number should be entered in the devices field.

2.When the device is connected via WiFi or OTG mode, the device should be filled with the IP address and port number.

3.Safe mode and accessibility mode disable USB debugging on the phone, preventing the execution of interface commands.
5. API List Checklist
List all provided APIs
1
Get device list
list
Get the list of currently connected devices
2
Update device name and number
updateDevices
Modify the name and sorting number of the device
3
Execute adb command
adb
To execute the adb shell command, you only need to pass the command after [adb shell], there is no need to pass [adb shell]
4
screenshot
screen
Capture the picture of the current frame of the mobile phone and save it in the [D:\Pictures] directory of the computer by default.
5
screen control
pointerEvent
Screen control operations 0 press 1 lift 2 move 4 scroll wheel up 5 scroll wheel down 6 slide up 7 slide down 8 slide left 9 slide right
6
Quick operation
pushEvent
Shortcut operations of mobile phone buttons 1Task management 2Home screen 3Return
7
Send to clipboard
writeClipBoard
Send text to phone clipboard
8
File upload
uploadFile
Upload files to mobile phone
9
Download files to computer
pullFile
Download the mobile phone files to the computer and save them in the [D:\Downloads] directory of the computer by default.
10
Application list
apkList
Get mobile application list
11
Install APK
installApk
Install the app on your phone
12
Uninstall APK
uninstallApk
Uninstall app
13
Start application
startApk
Launch the mobile app
14
Stop application
stopApk
Close mobile app
15
Get input method list
imeList
Get the input method currently installed on the phone
16
Install screencast input method
installInputIme
Silently install the screen projection input method (the screen projection input method will be automatically installed when the mobile phone is connected, and there is no need to call it normally)
17
Select input method
selectIme
Select current input method
18
Enter text
inputText
To enter text, the current mobile phone needs to be on the input page, and the current input method is the screen projection input method.
19
Get all tags
getTags
Get all current group labels
20
Create tags
addTag
Create group labels
21
Modify label
updateTag
Modify group label name
22
Delete tag
removeTag
Delete group label name
23
Add device to label group
addtagdevice
Add device to group label
24
Delete devices under label
removeTagDevice
Remove devices from group labels
List Get device list
Get a list of all currently connected devices 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"list"
Request event, case insensitive
2 Sample requests Here is an example of a request under a general configuration. 3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
array
It is JSON when there is data, and null when there is no data.
width
int
272
Width
height
int
480
high
serial
string
"ea85356a"
The serial number of the current connection mode, in wifi, otg, and barrier-free connection modes, it is ip
model
string
"Redmi Note 3"
Mobile phone model
sort
int
1
Mobile phone number
name
string
"Redmi Note 33"
Mobile phone custom name
onlySerial
string
"ea85356a"
Unique serial number, fixed serial number for mobile phone, not affected by connection mode
hide
bool
false
Whether to turn off screen status
mode
int
0
Connection mode: 0: usb; 1: WIFI, 2. OTG; 3. Accessibility
connectTime
int
1714294839013
connection timestamp
intranetIp
string
"192.168.111.103"
Intranet IP
sourceWidth
int
1080
original width
sourceHeight
int
1920
original high
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": [
{
"width": 272,
"height": 480,
"serial": "ea85356a",
"model": "Redmi Note 3",
"sort": 1,
"name": "Redmi Note 33",
"onlySerial": "ea85356a",
"hide": false,
"mode": 0,
"status": "online",
"connectTime": 1714294839013,
"intranetIp": "192.168.111.143",
"sourceWidth": 1080,
"sourceHeight": 1920
}
]
}Exception return example 1:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Invalid action",
"data": null
}UpdateDevices Update device name and number
Update the name and number of the device 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
yes
"updateDevices"
Request event, case insensitive
devices
string
yes
"all"|"xxx,xxx"
It is recommended to set the device serial number one at a time. Setting multiple numbers and names will result in duplication. all means all, multiple device serial numbers are separated by commas.
data
json
yes
JSON
sort
int
no
sort number
name
string
no
Device name
2 Sample requests Here is an example of a request under a general configuration.
{
"action": "updateDevices",
"devices":"ea85356a",
"data": {
"sort": 1,
"name": "Group test number one"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}Execute ADB commands
Execute adb command 1 Request parameters
Parameter name
Parameter name
type
Is it required?
Example value
illustrate
action
string
yes
"adb"
Request event, case insensitive
devices
string
yes
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
yes
JSON
command
string
yes
"input keyevent KEYCODE_VOLUME_UP"
To execute the adb shell command, you only need to pass the command after "adb shell"
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"adb",
"devices":"all",
"data":{
"command":"am start -a android.intent.action.VIEW -d https://some3c.com"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "adb命令已执行",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}Screen capture
Screenshots are saved by default in the "D:\\ Pictures" directory on the computer and the "/sdcard/" directory on the phone 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
yes
"Screen"
Request event, case insensitive
devices
string
yes
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
yes
JSON
savePath
string
no
"D:\\Pictures"
Save location. If not uploaded, it will be saved in the D drive picture folder by default.
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"Screen",
"devices":"all",
"data":{
"savePath":"C:\\Users\\Administrator\\Desktop"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}pointerEvent Screen Control
0 Press 1 Lift 2 Move 4 Roller up 5 Roller down 6 Slide up 7 Slide down 8 Slide left 9 Slide right 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"pointerEvent"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
type
string
YES
"6"
0 press 1 lift 2 move 4 scroll wheel up 5 scroll wheel down 6 slide up 7 slide down 8 slide left 9 slide right
x
string
NO
x axis percentage:0-100
The x-axis coordinate percentage of the starting point, not required for 6/7/8/9 sliding operations, other operations need to pass the coordinates
y
string
NO
y axis percentage:0-100
The percentage of the y-axis coordinate of the starting point. It is not required for 6/7/8/9 sliding operations. Other operations need to pass the coordinates.
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"pointerEvent",
"devices":"all",
"data":{
"type":"6",
"x":"20",
"y":"70"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}PushEvent Quick Operation
1 Task Management 2 Main Screen 3 Back 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"pushEvent"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
type
string
YES
"2"
1Task Management 2Home Page 3Return
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"pushEvent",
"devices":"all",
"data":{
"type":"2"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}writeClipBoard Send to Clipboard
Paste the text to the phone clipboard (some models may not be compatible). 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"writeClipBoard"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
content
string
YES
"熊猫投屏"
content
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"writeClipBoard",
"devices":"all",
"data":{
"content":"熊猫投屏"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}uploadFile file upload
Default upload directory:/storage/emulated/0/Download/ Album file upload directory:/storage/emulated/0/DCIM/Camera/ 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"writeClipBoard"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
filePath
string
YES
"C:\\Users\\Administrator\\Desktop\\upload.a.txt"
Local computer file path
isMedia
string
NO
"0"
YES NO Album file default 0NO 1YES "0"Or not upload: upload to directory /storage/emulated/0/Download/ "1":Upload to directory /storage/emulated/0/DCIM/Camera/
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"uploadFile",
"devices":"all",
"data":{
"filePath":"C:\\Users\\Administrator\\Desktop\\upload.a.txt",
"isMedia":"0"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Find local file error",
"data": null
}PullFile Download files to computer
The save file path (parameter savePath) is defaulted to [D:\\ Downloads\\ serial number _ file name] when not passed. 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"pullFile"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
filePath
string
YES
"/sdcard/Download/ad-link.txt"
Resource file path on mobile phone
savePath
string
NO
"D:\\Downloads\\ad-link.txt"
The computer path to save the file. The directory must exist. Multiple files with the same name will be overwritten. The default value if no parameters are passed is"D:\\Downloads\\serial number_name"
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"pullFile",
"devices":"all",
"data":{
"filePath":"/sdcard/Download/ad-link.txt",
"savePath":"D:\\Downloads\\ad-link.txt"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}apkList App List
Get the package name and installation path of the third-party app 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"pullFile"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
NO
JSON
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"apkList",
"devices":"all"
}3 Return parameters
Parameter name
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
map
It is JSON when there is data, and null when there is no data.
"ea85356a"
apk
string
apk package name
package
string
Installation path
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": {
"ea85356a": [
{
"package": "/data/app/com.panda.assistant-1",
"apk": "com.panda.assistant"
},
{
"apk": "com.baidu.input_mi",
"package": "/data/app/BaiduIME/BaiduIME"
},
{
"package": "/data/app/talkback/talkback",
"apk": "com.google.android.marvin.talkback"
}
],
"d609ef41": [
{
"package": "/data/app/OneKeyLockScreen/OneKeyLockScreen",
"apk": "com.coloros.onekeylockscreen"
},
{
"package": "/data/app/com.nearme.note-UKiAh14ZDIXnoci_NYkTcQ==",
"apk": "com.nearme.note"
},
{
"apk": "com.nearme.play",
"package": "/data/app/com.nearme.play-9ci1OrRtCU7bK659l64Pyw=="
}
]
}
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}InstallApk Installation APK
Install the app, some brands of phones may prompt for security verification 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"installApk"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
filePath
string
YES
"D:\\Downloads\\tqyyapkazb.apk"
Local computer installation package file path
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"installApk",
"devices":"all",
"data":{
"filePath":"D:\\Downloads\\tqyyapkazb.apk"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Find local file error",
"data": null
}UninstallApk Uninstall APK
Uninstall apk 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"uninstallApk"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
apk
string
YES
"cn.androidfun.apkfetch"
package name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"uninstallApk",
"devices":"d609ef41",
"data":{
"apk":"cn.androidfun.apkfetch"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}StartApk launches applications
Launch the app 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"startApk"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
apk
string
YES
"com.coloros.weather"
package name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"startApk",
"devices":"d609ef41",
"data":{
"apk":"com.coloros.weather"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}stopApk stop application
Close the app 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"stopApk"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
apk
string
YES
"com.coloros.weather"
The name of the application package to be stopped
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"stopApk",
"devices":"d609ef41",
"data":{
"apk":"com.coloros.weather"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
null
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}imeList Get a list of input methods
Get the list of input methods in the current phone 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"imeList"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
NO
JSON
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"imeList",
"devices":"all"
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
"ea85356a"
map
return"serial":["package"] map data
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": {
"ea85356a": [
"com.sohu.inputmethod.sogou.xiaomi/.SogouIME",
"com.baidu.input_mi/.ImeService",
"com.panda.assistant/.keyboard.XwIME",
"com.android.xwkeyboard/.XwIME"
],
"d609ef41": [
"com.sohu.inputmethod.sogouoem/.SogouIME",
"com.android.xwkeyboard/.XwIME"
]
}
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}installInputIme Install the projection input method
Install the projection keyboard. This input method is required for text input. Generally, it will be automatically installed after connecting to a mobile phone and does not need to be called. Installation is silent, but some brands of mobile phones may pop up installation verification, which needs to be completed before installation. 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"installInputIme"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
NO
JSON
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"installInputIme",
"devices":"all"
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}selectIme Select input method
Select the input method used by the mobile phone 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"selectIme"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
ime
string
YES
"com.sohu.inputmethod.sogou.xiaomi/.SogouIME"
input method package name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"selectIme",
"devices":"ea85356a",
"data":{
"ime":"com.sohu.inputmethod.sogou.xiaomi/.SogouIME"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}inputText input text
It needs to be switched to a screen mirroring keyboard and called in an inputtable scene. 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"inputText"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
content
string
YES
"熊猫投屏"
Enter content
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"inputText",
"devices":"ea85356a",
"data":{
"content":"熊猫投屏"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}getTags Get all tags
Get all current tags and their device serial numbers. In the software, tags are groupings 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"getTags"
Request event, case insensitive
devices
string
NO
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
NO
JSON
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"getTags"
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
array
It is JSON when there is data, and null when there is no data.
name
string
Tag name
ids
array
Device serial number list
ident
string
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": [
{
"name": "全部手机",
"ids": [
"d609ef41",
"ea85356a"
],
"ident": "all"
},
{
"name": "未标签手机",
"ids": [
"abec10cd",
"d609ef41"
],
"ident": "notTag"
},
{
"name": "大话西游功能测试",
"ids": []
},
{
"name": "应用启停测试",
"ids": []
}
]
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}addTag Create a tag
Create label groups 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"addTag"
Request event, case insensitive
devices
string
NO
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
name
string
YES
"测试一组"
Tag name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"addTag",
"data":{
"name":"测试一组"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}UpdateTag Modify the tag
Modify the tag name, "all phones" and "untagged phones" are the default groups and cannot be modified. 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"updateTag"
Request event, case insensitive
devices
string
NO
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
oldName
string
YES
"测试一组"
Original label name
name
string
YES
"开发一组"
New label name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"updateTag",
"data":{
"oldName":"测试一组",
"name":"开发一组"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}removeTag
Delete labels. "All phones" and "Unlabeled phones" are the default groups and cannot be deleted. 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"removeTag"
Request event, case insensitive
devices
string
NO
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
name
string
YES
"测试一组"
Tag name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"removeTag",
"data":{
"name":"测试一组"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}addTagDevice Add device to tag group
Add devices to the label 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"addTagDevice"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
name
string
YES
"测试一组"
Tag name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"addTagDevice",
"devices":"ea85356a",
"data":{
"name":"测试一组"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}removeTagDevice Remove devices under the label
Remove device from label 1 Request parameters
Parameter name
type
Is it required?
Example value
illustrate
action
string
YES
"removeTagDevice"
Request event, case insensitive
devices
string
YES
"all"|"xxx,xxx"
Device serial number, all means all, multiple device serial numbers are separated by commas
data
json
YES
JSON
name
string
YES
"测试一组"
Tag name
2 Sample requests Here is an example of a request under a general configuration.
{
"action":"removeTagDevice",
"devices":"ea85356a",
"data":{
"name":"测试一组"
}
}3 Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Return code, default 10000
message
string
"SUCCESS"
Response message, default "SUCCESS"
data
json
It is JSON when there is data, and null when there is no data.
4 Return to example Here is an example of a request under a general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Exception return example 1:
{
"code": 10001,
"message": "Invalid action",
"data": null
}Exception return example 2:
{
"code": 10001,
"message": "Request parameter error",
"data": null
}6.Executing ADB shell commands
Execute the adb_shell command
1.Request parameters
Parameter Name
Parameter Name
type
Is it mandatory?
Example values
illustrate
action
string
yes
"adb_shell"
Request events, case insensitive
devices
string
yes
"all"|"xxx,xxx"
Device serial numbers, all is all, and multiple device serial numbers are separated by English commas
data
json
yes
JSON
command
string
yes
"input keyevent KEYCODE_VOLUME_UP"
To execute the adb shell command, you only need to pass the command after "adb shell"
2.Request Example
This is a request example under the general configuration.
{
"action":"adb_shell",
"devices":"all",
"data":{
"command":"am start -a android.intent.action.VIEW -d https://some3c.com"
}
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
null
Returns JSON if data is available, otherwise returns null.
4.Return to example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "adb_shell The command was executed",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "Ineffective action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "The request parameter is incorrect",
"data": null
}7.Retrieve Action List
Get the list of created actions Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"actionTasks"
Request events are case-insensitive.
2.Request Example
This is a request example under the general configuration.
{
"action":"actionTasks"
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
Array
Returns JSON if data is available, otherwise returns null.
id
int
877092
Action ID
name
string
"Action 1"
Action Name
createTime
string
"2025-10-21 09:42:03"
Creation time
durationSecond
int
11
Recording duration unit: seconds
showSecond
string
"00:11"
Recording duration (time format)
type
string
"local"
Device type: local (local mobile phone); virtual (cloud mobile phone)
4.Return to Example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": [
{
"createTime": "2025-10-21 09:42:03",
"duration": 74,
"durationSecond": 11,
"id": 877092,
"name": "动作1",
"showSecond": "00:11",
"type": "local"
},
{
"createTime": "2025-10-21 11:57:34",
"duration": 9294,
"durationSecond": 14,
"id": 4550234,
"name": "动作2",
"showSecond": "00:14",
"type": "local"
}
]
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}8.Execution of Actions
Create a task to perform an action Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"actionCreate"
Request events are case-insensitive.
devices
string
yes
"all"|"xxx,xxx"
Device serial number, "all" means all, multiple device serial numbers are separated by commas.
data
Array
actionName
string
yes
"Action 2"
Action Name
startTimes
Array
no
[]
The start time for scheduled execution can be specified. Multiple times can be passed; it is not required if it is not a scheduled task. The format is YYYY-MM-DD HH:mm:ss
count
int
yes
2
Execution count
taskInterval
Array
yes
[1000, 5000]
Task interval (must be 2, with the random interval between them), unit: milliseconds.
deviceInterval
string
yes
1000
Device interval, unit: milliseconds
2.Request Example
This is a request example under the general configuration.
{
"action": "actionCreate",
"devices": "all",
"data": [
{
"actionName": "动作2",
"count": 2,
"startTimes": ["2025-10-10 13:25:10"],
"taskInterval": [1000, 5000],
"deviceInterval": 1000
}
]
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
null
Returns JSON if data is available, otherwise returns null.
4.Return to Example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}9.Stop Action
Stop the action being performed Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"actionRemove"
Request events are case-insensitive.
devices
string
yes
"all"|"xxx,xxx"
Device serial number, "all" means all, multiple device serial numbers are separated by commas.
data
Array
name
string
yes
"Action 2"
Action name or ID
2.Request Example
This is a request example under the general configuration.
{
"action": "actionRemove",
"devices": "all",
"data": {
"name": "动作2"
}
}3. Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
null
Returns JSON if data is available, otherwise returns null.
4. Return to Example
This is a request example under the general configuration.
Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}10.Retrieve Task List
Get Task List Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"autojsTasks"
Request events are case-insensitive.
2.Request Example
This is a request example under the general configuration.
{
"action":"autojsTasks"
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
Array
Returns JSON if data is available, otherwise returns null.
isOk
bool
TRUE
Is it available (does it contain JS and BAT files)?
label
string
"Autox_test.js"
file name
value
string
"D:\\code\\script\\Autox_test.js"
File path
4.Return to Example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": [
{
"isOk": true,
"label": "666.js",
"value": "D:\\code\\script\\666.js"
},
{
"isOk": true,
"label": "Autox_test.js",
"value": "D:\\code\\script\\Autox_test.js"
},
{
"isOk": true,
"label": "tt.js",
"value": "D:\\code\\script\\tt.js"
},
{
"isOk": true,
"label": "贪吃蛇.js",
"value": "D:\\code\\script\\贪吃蛇.js"
}
]
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}11.Execute the task
Select an existing task to execute. Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"autojsCreate"
Request events are case-insensitive.
devices
string
yes
"all"|"xxx,xxx"
Device serial number, "all" means all, multiple device serial numbers are separated by commas.
data
Array
path
string
yes
"D:\\code\\script\\666.js"
Task file path
startTimes
Array
no
[]
The start time for scheduled execution can be specified. Multiple times can be passed; it is not required if it is not a scheduled task. The format is YYYY-MM-DD HH:mm:ss
count
int
yes
2
Execution count
taskInterval
Array
yes
[1000, 5000]
Task interval (must be 2, with the random interval between them), unit: milliseconds.
deviceInterval
string
yes
1000
Device interval, unit: milliseconds
2.Request Example
This is a request example under the general configuration.
{
"action": "autojsCreate",
"devices": "all",
"data": [
{
"path": "D:\\code\\script\\666.js",
"count": 2,
"startTimes": ["2025-10-10 13:25:10"],
"taskInterval": [1000, 5000],
"deviceInterval": 1000
}
]
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
null
Returns JSON if data is available, otherwise returns null.
4.Return to Example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}12.Stop the task
Stop the currently executing task Client version: 8.288
1.Request parameters
Parameter name
Parameter name
type
Is it mandatory?
Example value
illustrate
action
string
yes
"actionRemove"
Request events are case-insensitive.
devices
string
yes
"all"|"xxx,xxx"
Device serial number, "all" means all, multiple device serial numbers are separated by commas.
data
Array
name
string
yes
"Snake.js"
The task name is retrieved from the label returned by the task list.
2.Request Example
This is a request example under the general configuration.
{
"action": "autojsRemove",
"devices": "all",
"data": {
"name": "贪吃蛇.js"
}
}3.Return parameters
Parameter name
Parameter name
type
Example value
illustrate
code
int
10000
Returns a code, defaulting to 10000.
message
string
"SUCCESS"
The default response message is "SUCCESS".
data
null
Returns JSON if data is available, otherwise returns null.
4.Return to Example
This is a request example under the general configuration. Normal return example:
{
"code": 10000,
"message": "SUCCESS",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "无效的action",
"data": null
}Example of an exception return:
{
"code": 10001,
"message": "请求参数错误",
"data": null
}Last updated