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:
Response example:
3. API public parameters
3.1. Request parameters
The following table shows the description of public request parameters.
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.
4. API public response code
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.
5. API List Checklist
List all provided APIs
List Get device list
Get a list of all currently connected devices 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration. 3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
UpdateDevices Update device name and number
Update the name and number of the device 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
Execute ADB commands
Execute adb command 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
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
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
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
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
PushEvent Quick Operation
1 Task Management 2 Main Screen 3 Back 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
writeClipBoard Send to Clipboard
Paste the text to the phone clipboard (some models may not be compatible). 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
uploadFile file upload
Default upload directory:/storage/emulated/0/Download/ Album file upload directory:/storage/emulated/0/DCIM/Camera/ 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
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
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
apkList App List
Get the package name and installation path of the third-party app 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
InstallApk Installation APK
Install the app, some brands of phones may prompt for security verification 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
UninstallApk Uninstall APK
Uninstall apk 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
StartApk launches applications
Launch the app 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
stopApk stop application
Close the app 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
imeList Get a list of input methods
Get the list of input methods in the current phone 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
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
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
selectIme Select input method
Select the input method used by the mobile phone 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
inputText input text
It needs to be switched to a screen mirroring keyboard and called in an inputtable scene. 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
getTags Get all tags
Get all current tags and their device serial numbers. In the software, tags are groupings 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
addTag Create a tag
Create label groups 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
UpdateTag Modify the tag
Modify the tag name, "all phones" and "untagged phones" are the default groups and cannot be modified. 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
removeTag
Delete labels. "All phones" and "Unlabeled phones" are the default groups and cannot be deleted. 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
addTagDevice Add device to tag group
Add devices to the label 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
removeTagDevice Remove devices under the label
Remove device from label 1 Request parameters
2 Sample requests Here is an example of a request under a general configuration.
3 Return parameters
4 Return to example Here is an example of a request under a general configuration. Normal return example:
Exception return example 1:
Exception return example 2:
6. ADB command list
Use Ctrl + F shortcut to quickly find the command you need ^_^
7. Xiaomi MIUI ADB optimization command
Last updated