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.
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
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
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
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
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.
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
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
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.
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:
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
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.
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:
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
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.
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:
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
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.
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
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
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.
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
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
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.
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
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
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.
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:
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
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
Exception return example 1:
Exception return example 2:
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.
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:
Exception return example 1:
Exception return example 2:
6. ADB command list
Use Ctrl + F shortcut to quickly find the command you need ^_^
Name
Command
Remarks
Restart
adb reboot
Restart the phone to recovery flash mode
adb reboot recovery
Restart the phone to the bootloader interface
adb reboot bootloader
Shut down
adb shell reboot -p
Restore Device DPI
adb shell wm density reset
Modify Device DPI
adb shell wm density 320
320 (custom dpi)
View Device DPI
adb shell wm density
Restore device resolution
adb shell wm size reset
Modify device resolution
adb shell wm size 1080x1920
1080X1920 (custom resolution)
View device resolution
adb shell wm size
View device serial number
adb get-serialno
View device details list
adb devices -l
View the third-party app package name
adb shell pm list packages -3
View all package names of system applications
adb shell pm list packages -s
View all app package names
adb shell pm list packages
View memory usage
adb shell dumpsys meminfo
Clear application data and cache, package needs to be specified
adb shell pm clear cn.com.test.mobile
cn.com . test.mobile (Custom package name)
Uninstall the application, you need to specify the package.
adb uninstall cn.com.test.mobile
cn.com . test.mobile (Custom package name)
Uninstall the application, but keep the data, you need to specify the package
adb uninstall -k cn.com.test.mobile
cn.com . test.mobile (Custom package name)
Force stop application
adb shell am force-stop cn.com.test.mobile
cn.com . test.mobile (Custom package name)
Screenshot
adb shell screencap -p /sdcard/01.png
01.Png (Custom screenshot name)
Install apk
adb install d:/temp/1.apk
D:/temp/1.apk (apk absolute path)
Set battery percentage
adb shell dumpsys battery set level 100
100 (custom battery percentage)
Launch the app
adb shell am start -ncn.com.test.mobile/.ui.SplashActivity
ncn.com .Ui. SplashActivity (package name)
Check the Android system version
adb shell getprop ro.build.version.release
Check the top 10 apps that occupy memory
adb shell top -s 10
View equipment brand
adb shell getprop ro.product.brand
Turn on WiFi
adb shell svc wifi enable
Turn off WiFi
adb shell svc wifi disable
Enable pointer display
adb shell settings put system pointer_location 1
Turn off pointer display
adb shell settings put system pointer_location 0
Simulated click
Adb shell input tap x coordinate y coordinate
Turn off updates
adb shell pm disable-user com.wssyncmldm
Execute when the screen is black
adb shell settings put system screen_off_timeout 2147483647
Execute once every time the software is restarted (not in black screen state).
Name
Command
Remarks
Power button
adb shell input keyevent 26
Menu key
adb shell input keyevent 82
HOME key
adb shell input keyevent 3
Return key
adb shell input keyevent 4
Increase volume
adb shell input keyevent 24
Lower the volume
adb shell input keyevent 25
Mute
adb shell input keyevent 164
Play/Pause
adb shell input keyevent 85
Stop playing
adb shell input keyevent 86
Play the next song
adb shell input keyevent 87
Play the previous song
adb shell input keyevent 88
Resume playback
adb shell input keyevent 126
Pause playback
adb shell input keyevent 127
Light up the screen
adb shell input keyevent 224
Turn off the screen
adb shell input keyevent 223
Slide to unlock, swipe up gesture to unlock
adb shell input swipe 300 1000 300 500
Parameters 300, 1000, 300, and 500 respectively represent the starting point x coordinate, starting point y coordinate, ending point x coordinate, and ending point y coordinate
Enter text when the focus is on a text box
adb shell input text hello
7. Xiaomi MIUI ADB optimization command
Disable smart services
adb shell pm disable-user com.miui.systemAdSolution
Disable Xiaomi e-commerce
adb shell pm disable-user com.xiaomi.ab
Disable user feedback
adb shell pm disable-user com.miui.bugreport
Disable system cancer
adb shell pm disable-user com.miui.analytics
Delete open screen ads
adb shell rm -f -r /sdcard/Android/data/com.miui.systemAdSolution/files
Prevent the reappearance of open-screen ads
adb shell touch /sdcard/Android/data/com.miui.systemAdSolution/files
Last updated