# API interface documentation

## 1. API request address

ws\://127.0.0.1:22222/\ <br>

## 2. API request structure

Both the request and response are JSON data structures, and the request parameters are of string type unless otherwise specified.

1. Request example:

```Plain
{
    "action":"pushEvent",
    "davices":"all",
    "data":{
        "type":"2"
    }
}
```

1. Response example:

```Plain
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

\ <br>

## 3. API public parameters

**3.1. Request parameters**

The following table shows the description of public request parameters.

<table><thead><tr><th>Parameter name</th><th width="118">type</th><th>Is it required?</th><th>Example value</th><th>illustrate</th></tr></thead><tbody><tr><td>action</td><td>string</td><td>YES</td><td>"pushEvent"</td><td>Request event type, case insensitive</td></tr><tr><td>devices</td><td>string</td><td>yes</td><td>"all"|"xxx,xxx"</td><td>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.</td></tr><tr><td>data</td><td>json</td><td>no</td><td>Request parameters</td><td>JSON, optional</td></tr></tbody></table>

<br>

**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.

| Parameter name | type   | Example value | illustrate                                                        |
| -------------- | ------ | ------------- | ----------------------------------------------------------------- |
| 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. |

\ <br>

## 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.

| status code     | error code                   | error message                                          | illustrate                                            |
| --------------- | ---------------------------- | ------------------------------------------------------ | ----------------------------------------------------- |
| 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.

<figure><img src="/files/8LBIZFHbjOuBDJJKPTQG" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="/files/z0oXveiSGwJn72QIJK3u" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/MpoL0Na5F9gFhbxgrDCm" alt=""><figcaption></figcaption></figure>

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

| serial number | API                             | ACTION          | illustrate                                                                                                                                                                                            |
| ------------- | ------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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**

| <p>Parameter name<br></p> | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |
| ------------------------- | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ |
| <p>action<br></p>         | <p>string<br></p> | <p>YES<br></p>             | <p>"list"<br></p>        | <p>Request event, case insensitive<br></p> |

**2 Sample requests** Here is an example of a request under a general configuration. **3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p>     | <p>illustrate<br></p>                                                                                                  |
| ------------------------- | ------------------------- | ----------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                        | <p>Return code, default 10000<br></p>                                                                                  |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>         | <p>Response message, default "SUCCESS"<br></p>                                                                         |
| <p>data<br></p>           |                           | <p>array<br></p>  |                              | <p>It is JSON when there is data, and null when there is no data.<br></p>                                              |
|                           | <p>width<br></p>          | <p>int<br></p>    | 272                          | <p>Width<br></p>                                                                                                       |
|                           | <p>height<br></p>         | <p>int<br></p>    | 480                          | <p>high<br></p>                                                                                                        |
|                           | <p>serial<br></p>         | <p>string<br></p> | <p>"ea85356a"<br></p>        | <p>The serial number of the current connection mode, in wifi, otg, and barrier-free connection modes, it is ip<br></p> |
|                           | <p>model<br></p>          | <p>string<br></p> | <p>"Redmi Note 3"<br></p>    | <p>Mobile phone model<br></p>                                                                                          |
|                           | <p>sort<br></p>           | <p>int<br></p>    | 1                            | <p>Mobile phone number<br></p>                                                                                         |
|                           | <p>name<br></p>           | <p>string<br></p> | <p>"Redmi Note 33"<br></p>   | <p>Mobile phone custom name<br></p>                                                                                    |
|                           | <p>onlySerial<br></p>     | <p>string<br></p> | <p>"ea85356a"<br></p>        | <p>Unique serial number, fixed serial number for mobile phone, not affected by connection mode<br></p>                 |
|                           | <p>hide<br></p>           | <p>bool<br></p>   | <p>false<br></p>             | <p>Whether to turn off screen status<br></p>                                                                           |
|                           | <p>mode<br></p>           | <p>int<br></p>    | 0                            | <p>Connection mode: 0: usb; 1: WIFI, 2. OTG; 3. Accessibility<br></p>                                                  |
|                           | <p>connectTime<br></p>    | <p>int<br></p>    | 1714294839013                | <p>connection timestamp<br></p>                                                                                        |
|                           | <p>intranetIp<br></p>     | <p>string<br></p> | <p>"192.168.111.103"<br></p> | <p>Intranet IP<br></p>                                                                                                 |
|                           | <p>sourceWidth<br></p>    | <p>int<br></p>    | 1080                         | <p>original width<br></p>                                                                                              |
|                           | <p>sourceHeight<br></p>   | <p>int<br></p>    | 1920                         | <p>original high<br></p>                                                                                               |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```Plain
{
    "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:

```Plain
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

Exception return example 2:

```Plain
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

### UpdateDevices Update device name and number

> Update the name and number of the device **1 Request parameters**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>   | <p>illustrate<br></p>                      |                                                                                                                                                                                                                   |
| ------------------------- | --------------- | ----------------- | -------------------------- | -------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>action<br></p>         |                 | <p>string<br></p> | yes                        | <p>"updateDevices"<br></p> | <p>Request event, case insensitive<br></p> |                                                                                                                                                                                                                   |
| <p>devices<br></p>        |                 | <p>string<br></p> | yes                        | <p>"all"                   | "xxx,xxx"<br></p>                          | <p>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.<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | yes                        |                            | <p>JSON<br></p>                            |                                                                                                                                                                                                                   |
|                           | <p>sort<br></p> | <p>int<br></p>    | no                         |                            | <p>sort number<br></p>                     |                                                                                                                                                                                                                   |
|                           | <p>name<br></p> | <p>string<br></p> | no                         |                            | <p>Device name<br></p>                     |                                                                                                                                                                                                                   |

**2 Sample requests** Here is an example of a request under a general configuration.

```Plain
{
    "action": "updateDevices",
    "devices":"ea85356a",
    "data": {
        "sort": 1,
        "name": "Group test number one"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```Plain
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### Execute ADB commands

> Execute adb command **1 Request parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>                        | <p>illustrate<br></p>                                                                            |                                                                                                        |
| ------------------------- | ------------------------- | ----------------- | -------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                           | <p>string<br></p> | yes                        | <p>"adb"<br></p>                                | <p>Request event, case insensitive<br></p>                                                       |                                                                                                        |
| <p>devices<br></p>        |                           | <p>string<br></p> | yes                        | <p>"all"                                        | "xxx,xxx"<br></p>                                                                                | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                           | <p>json<br></p>   | yes                        |                                                 | <p>JSON<br></p>                                                                                  |                                                                                                        |
|                           | <p>command<br></p>        | <p>string<br></p> | yes                        | <p>"input keyevent KEYCODE\_VOLUME\_UP"<br></p> | <p>To execute the adb shell command, you only need to pass the command after "adb shell"<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"adb",
    "devices":"all",
    "data":{
        "command":"am start -a android.intent.action.VIEW -d https://some3c.com"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "adb命令已执行",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                     | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                                                                                 |                                                                                                        |
| ------------------------- | ------------------- | ----------------- | -------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                     | <p>string<br></p> | yes                        | <p>"Screen"<br></p>      | <p>Request event, case insensitive<br></p>                                                            |                                                                                                        |
| <p>devices<br></p>        |                     | <p>string<br></p> | yes                        | <p>"all"                 | "xxx,xxx"<br></p>                                                                                     | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                     | <p>json<br></p>   | yes                        |                          | <p>JSON<br></p>                                                                                       |                                                                                                        |
|                           | <p>savePath<br></p> | <p>string<br></p> | no                         | <p>"D:\Pictures"<br></p> | <p>Save location. If not uploaded, it will be saved in the D drive picture folder by default.<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"Screen",
    "devices":"all",
    "data":{
        "savePath":"C:\\Users\\Administrator\\Desktop"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | Response message, default "SUCCESS"                                       |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>           | <p>illustrate<br></p>                                                                                                                                                       |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"pointerEvent"<br></p>          | <p>Request event, case insensitive<br></p>                                                                                                                                  |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                           | "xxx,xxx"<br></p>                                                                                                                                                           | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                                    | <p>JSON<br></p>                                                                                                                                                             |                                                                                                        |
|                           | <p>type<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"6"<br></p>                     | <p>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<br></p>                                                   |                                                                                                        |
|                           | <p>x<br></p>    | <p>string<br></p> | <p>NO<br></p>              | <p>x axis percentage：0-100<br></p> | <p>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<br></p>               |                                                                                                        |
|                           | <p>y<br></p>    | <p>string<br></p> | <p>NO<br></p>              | <p>y axis percentage：0-100<br></p> | <p>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.<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"pointerEvent",
    "devices":"all",
    "data":{
        "type":"6",
        "x":"20",
        "y":"70"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### PushEvent Quick Operation

> 1 Task Management 2 Main Screen 3 Back **1 Request parameters**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                          |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"pushEvent"<br></p>   | <p>Request event, case insensitive<br></p>     |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                 | "xxx,xxx"<br></p>                              | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                          | <p>JSON<br></p>                                |                                                                                                        |
|                           | <p>type<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"2"<br></p>           | <p>1Task Management 2Home Page 3Return<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"pushEvent",
    "devices":"all",
    "data":{
        "type":"2"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                    | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>    | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | ------------------ | ----------------- | -------------------------- | --------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                    | <p>string<br></p> | <p>YES<br></p>             | <p>"writeClipBoard"<br></p> | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                    | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                    | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                    | <p>json<br></p>   | <p>YES<br></p>             |                             | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>content<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"熊猫投屏"<br></p>           | <p>content<br></p>                         |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"writeClipBoard",
    "devices":"all",
    "data":{
        "content":"熊猫投屏"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                     | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>                                 | <p>illustrate<br></p>                                                                                                                                                                  |                                                                                                        |
| ------------------------- | ------------------- | ----------------- | -------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"writeClipBoard"<br></p>                              | <p>Request event, case insensitive<br></p>                                                                                                                                             |                                                                                                        |
| <p>devices<br></p>        |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                                                 | "xxx,xxx"<br></p>                                                                                                                                                                      | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                     | <p>json<br></p>   | <p>YES<br></p>             |                                                          | <p>JSON<br></p>                                                                                                                                                                        |                                                                                                        |
|                           | <p>filePath<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"C:\Users\Administrator\Desktop\upload.a.txt"<br></p> | <p>Local computer file path<br></p>                                                                                                                                                    |                                                                                                        |
|                           | <p>isMedia<br></p>  | <p>string<br></p> | <p>NO<br></p>              | <p>"0"<br></p>                                           | <p>YES NO Album file default 0NO 1YES<br>"0"Or not upload: upload to directory<br>/storage/emulated/0/Download/<br>"1":Upload to directory<br>/storage/emulated/0/DCIM/Camera/<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"uploadFile",
    "devices":"all",
    "data":{
        "filePath":"C:\\Users\\Administrator\\Desktop\\upload.a.txt",
        "isMedia":"0"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```Plain
{
    "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**

| <p>Parameter name<br></p> |                     | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>                  | <p>illustrate<br></p>                                                                                                                                                                                                 |                                                                                                        |
| ------------------------- | ------------------- | ----------------- | -------------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"pullFile"<br></p>                     | <p>Request event, case insensitive<br></p>                                                                                                                                                                            |                                                                                                        |
| <p>devices<br></p>        |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                                  | "xxx,xxx"<br></p>                                                                                                                                                                                                     | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                     | <p>json<br></p>   | <p>YES<br></p>             |                                           | <p>JSON<br></p>                                                                                                                                                                                                       |                                                                                                        |
|                           | <p>filePath<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"/sdcard/Download/ad-link.txt"<br></p> | <p>Resource file path on mobile phone<br></p>                                                                                                                                                                         |                                                                                                        |
|                           | <p>savePath<br></p> | <p>string<br></p> | <p>NO<br></p>              | <p>"D:\Downloads\ad-link.txt"<br></p>     | <p>The computer path to save the file. The directory must exist. Multiple files with the same name will be overwritten.<br>The default value if no parameters are passed is"D:\Downloads\serial number\_name"<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"pullFile",
    "devices":"all",
    "data":{
        "filePath":"/sdcard/Download/ad-link.txt",
        "savePath":"D:\\Downloads\\ad-link.txt"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |   | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | - | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |   | <p>string<br></p> | <p>YES<br></p>             | <p>"pullFile"<br></p>    | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |   | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |   | <p>json<br></p>   | <p>NO<br></p>              |                          | <p>JSON<br></p>                            |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"apkList",
    "devices":"all"
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p>     | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ------------------------- | ----------------- | ---------------------------- | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           |                           | <p>int<br></p>    | 10000                        | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>         | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           |                           | <p>map<br></p>    |                              | <p>It is JSON when there is data, and null when there is no data.<br></p> |
|                           | <p>"ea85356a"<br></p>     | <p>apk<br></p>            | <p>string<br></p> |                              | <p>apk package name<br></p>                                               |
|                           | <p>package<br></p>        | <p>string<br></p>         |                   | <p>Installation path<br></p> |                                                                           |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "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:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                     | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>                 | <p>illustrate<br></p>                                    |                                                                                                        |
| ------------------------- | ------------------- | ----------------- | -------------------------- | ---------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"installApk"<br></p>                  | <p>Request event, case insensitive<br></p>               |                                                                                                        |
| <p>devices<br></p>        |                     | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                                 | "xxx,xxx"<br></p>                                        | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                     | <p>json<br></p>   | <p>YES<br></p>             |                                          | <p>JSON<br></p>                                          |                                                                                                        |
|                           | <p>filePath<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"D:\Downloads\tqyyapkazb.apk"<br></p> | <p>Local computer installation package file path<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"installApk",
    "devices":"all",
    "data":{
        "filePath":"D:\\Downloads\\tqyyapkazb.apk"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Find local file error",
    "data": null
}
```

### UninstallApk Uninstall APK

Uninstall apk **1 Request parameters**

| <p>Parameter name<br></p> |                | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>            | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | -------------- | ----------------- | -------------------------- | ----------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                | <p>string<br></p> | <p>YES<br></p>             | <p>"uninstallApk"<br></p>           | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                            | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                | <p>json<br></p>   | <p>YES<br></p>             |                                     | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>apk<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"cn.androidfun.apkfetch"<br></p> | <p>package name<br></p>                    |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"uninstallApk",
    "devices":"d609ef41",
    "data":{
        "apk":"cn.androidfun.apkfetch"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### StartApk launches applications

Launch the app **1 Request parameters**

| <p>Parameter name<br></p> |                | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>         | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | -------------- | ----------------- | -------------------------- | -------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                | <p>string<br></p> | <p>YES<br></p>             | <p>"startApk"<br></p>            | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                         | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                | <p>json<br></p>   | <p>YES<br></p>             |                                  | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>apk<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"com.coloros.weather"<br></p> | <p>package name<br></p>                    |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"startApk",
    "devices":"d609ef41",
    "data":{
        "apk":"com.coloros.weather"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### stopApk stop application

Close the app **1 Request parameters**

| <p>Parameter name<br></p> |                | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>         | <p>illustrate<br></p>                                        |                                                                                                        |
| ------------------------- | -------------- | ----------------- | -------------------------- | -------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                | <p>string<br></p> | <p>YES<br></p>             | <p>"stopApk"<br></p>             | <p>Request event, case insensitive<br></p>                   |                                                                                                        |
| <p>devices<br></p>        |                | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                         | "xxx,xxx"<br></p>                                            | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                | <p>json<br></p>   | <p>YES<br></p>             |                                  | <p>JSON<br></p>                                              |                                                                                                        |
|                           | <p>apk<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"com.coloros.weather"<br></p> | <p>The name of the application package to be stopped<br></p> |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"stopApk",
    "devices":"d609ef41",
    "data":{
        "apk":"com.coloros.weather"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>null<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |   | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | - | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |   | <p>string<br></p> | <p>YES<br></p>             | <p>"imeList"<br></p>     | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |   | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |   | <p>json<br></p>   | <p>NO<br></p>              |                          | <p>JSON<br></p>                            |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"imeList",
    "devices":"all"
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |
|                           | <p>"ea85356a"<br></p>     | <p>map<br></p>    |                          | <p>return"serial":\["package"] map data<br></p>                           |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "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:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |   | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>     | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | - | ----------------- | -------------------------- | ---------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |   | <p>string<br></p> | <p>YES<br></p>             | <p>"installInputIme"<br></p> | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |   | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                     | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |   | <p>json<br></p>   | <p>NO<br></p>              |                              | <p>JSON<br></p>                            |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"installInputIme",
    "devices":"all"
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### selectIme Select input method

Select the input method used by the mobile phone **1 Request parameters**

| <p>Parameter name<br></p> |                | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>                                 | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | -------------- | ----------------- | -------------------------- | -------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                | <p>string<br></p> | <p>YES<br></p>             | <p>"selectIme"<br></p>                                   | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                                                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                | <p>json<br></p>   | <p>YES<br></p>             |                                                          | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>ime<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"com.sohu.inputmethod.sogou.xiaomi/.SogouIME"<br></p> | <p>input method package name<br></p>       |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"selectIme",
    "devices":"ea85356a",
    "data":{
        "ime":"com.sohu.inputmethod.sogou.xiaomi/.SogouIME"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                    | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | ------------------ | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                    | <p>string<br></p> | <p>YES<br></p>             | <p>"inputText"<br></p>   | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                    | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                    | <p>json<br></p>   | <p>YES<br></p>             |                          | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>content<br></p> | <p>string<br></p> | <p>YES<br></p>             | "熊猫投屏"                   | <p>Enter content<br></p>                   |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"inputText",
    "devices":"ea85356a",
    "data":{
        "content":"熊猫投屏"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |   | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | - | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |   | <p>string<br></p> | <p>YES<br></p>             | <p>"getTags"<br></p>     | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |   | <p>string<br></p> | <p>NO<br></p>              | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |   | <p>json<br></p>   | <p>NO<br></p>              |                          | <p>JSON<br></p>                            |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"getTags"
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>array<br></p>  |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |
|                           | <p>name<br></p>           | <p>string<br></p> |                          | <p>Tag name<br></p>                                                       |
|                           | <p>ids<br></p>            | <p>array<br></p>  |                          | <p>Device serial number list<br></p>                                      |
|                           | <p>ident<br></p>          | <p>string<br></p> |                          |                                                                           |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "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:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### addTag Create a tag

Create label groups **1 Request parameters**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"addTag"<br></p>      | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>NO<br></p>              | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                          | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>name<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"测试一组"<br></p>        | <p>Tag name<br></p>                        |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"addTag",
    "data":{
        "name":"测试一组"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                    | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | ------------------ | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                    | <p>string<br></p> | <p>YES<br></p>             | <p>"updateTag"<br></p>   | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                    | <p>string<br></p> | <p>NO<br></p>              | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                    | <p>json<br></p>   | <p>YES<br></p>             |                          | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>oldName<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"测试一组"<br></p>        | <p>Original label name<br></p>             |                                                                                                        |
|                           | <p>name<br></p>    | <p>string<br></p> | <p>YES<br></p>             | <p>"开发一组"<br></p>        | <p>New label name<br></p>                  |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"updateTag",
    "data":{
        "oldName":"测试一组",
        "name":"开发一组"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p> | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"removeTag"<br></p>   | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>NO<br></p>              | <p>"all"                 | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                          | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>name<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"测试一组"<br></p>        | <p>Tag name<br></p>                        |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"removeTag",
    "data":{
        "name":"测试一组"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### addTagDevice Add device to tag group

Add devices to the label **1 Request parameters**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>  | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"addTagDevice"<br></p> | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                  | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                           | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>name<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"测试一组"<br></p>         | <p>Tag name<br></p>                        |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"addTagDevice",
    "devices":"ea85356a",
    "data":{
        "name":"测试一组"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "code": 10001,
    "message": "Request parameter error",
    "data": null
}
```

### removeTagDevice Remove devices under the label

Remove device from label **1 Request parameters**

| <p>Parameter name<br></p> |                 | <p>type<br></p>   | <p>Is it required?<br></p> | <p>Example value<br></p>     | <p>illustrate<br></p>                      |                                                                                                        |
| ------------------------- | --------------- | ----------------- | -------------------------- | ---------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| <p>action<br></p>         |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"removeTagDevice"<br></p> | <p>Request event, case insensitive<br></p> |                                                                                                        |
| <p>devices<br></p>        |                 | <p>string<br></p> | <p>YES<br></p>             | <p>"all"                     | "xxx,xxx"<br></p>                          | <p>Device serial number, all means all, multiple device serial numbers are separated by commas<br></p> |
| <p>data<br></p>           |                 | <p>json<br></p>   | <p>YES<br></p>             |                              | <p>JSON<br></p>                            |                                                                                                        |
|                           | <p>name<br></p> | <p>string<br></p> | <p>YES<br></p>             | <p>"测试一组"<br></p>            | <p>Tag name<br></p>                        |                                                                                                        |

**2 Sample requests** Here is an example of a request under a general configuration.

```JSON
{
    "action":"removeTagDevice",
    "devices":"ea85356a",
    "data":{
        "name":"测试一组"
    }
}
```

**3 Return parameters**

| <p>Parameter name<br></p> | <p>Parameter name<br></p> | <p>type<br></p>   | <p>Example value<br></p> | <p>illustrate<br></p>                                                     |
| ------------------------- | ------------------------- | ----------------- | ------------------------ | ------------------------------------------------------------------------- |
| <p>code<br></p>           |                           | <p>int<br></p>    | 10000                    | <p>Return code, default 10000<br></p>                                     |
| <p>message<br></p>        |                           | <p>string<br></p> | <p>"SUCCESS"<br></p>     | <p>Response message, default "SUCCESS"<br></p>                            |
| <p>data<br></p>           |                           | <p>json<br></p>   |                          | <p>It is JSON when there is data, and null when there is no data.<br></p> |

**4 Return to example** Here is an example of a request under a general configuration. Normal return example:

```JSON
{
    "code": 10000,
    "message": "SUCCESS",
    "data": null
}
```

Exception return example 1:

```JSON
{
    "code": 10001,
    "message": "Invalid action",
    "data": null
}
```

Exception return example 2:

```JSON
{
    "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
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.some3c.com/panda-manual/api-interface-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
