APP应用操作

ws://127.0.0.1:33332/

接口描述

APP应用操作

请求参数

application/json
参数名
类型
描述
必填
id
String
自定义传入一个ID 响应数据也会返回相同ID
可选
type
String
例子:appaction
必填
serial
array
必须要包含:[] ---- 全部设备=[] 指定单个设备=["qeh8ea1s"] 指定多个设备=["qeh8ea1s","r515aaa"] 序列号通过【获取序列号】接口获取
必填
Action
int
0启动 1关闭 2卸载 3清除缓存
必填
data
json
例子:{"Info":"com.android.settings/com.android.settings.Settings"}
必填
Info
String
包名类名 例子:com.android.settings/com.android.settings.Settings 只有(启动)需要包名+类名 包名:com.android.settings 类名:/com.android.settings.Settings
必填

响应参数

参数名
类型
描述
必填
state
int
0=成功 非0=失败
必填
message
String
返回错误信息
必填
data
json
{"172.16.0.180:5555":"Starting: Intent { cmp=com.android.settings/.Settings }\n","172.16.0.53:5555":"Starting: Intent { cmp=com.android.settings/.Settings }\nWarning: Activity not started, its current task has been brought to the front\n"}
必填

说明 / 示例

**请求示例 启动APP**:`{"id":"abc123456","type":"appaction","serial":[],"Action":0,"data":{"Info":"com.android.settings/com.android.settings.Settings"}}` **请求示例 关闭APP**:`{"id":"abc123456","type":"appaction","serial":[],"Action":1,"data":{"Info":"com.android.settings"}}` **请求示例 卸载APP**:`{"id":"abc123456","type":"appaction","serial":[],"Action":2,"data":{"Info":"com.android.settings"}}` **请求示例 清除APP缓存**:`{"id":"abc123456","type":"appaction","serial":[],"Action":3,"data":{"Info":"com.android.settings"}}` **温馨提示**:关闭APP 卸载APP 清除APP缓存 也可以带上类名:`{"type":"appaction","serial":[],"Action":1,"data":{"id":"abc123456","Info":"com.android.settings/com.android.settings.Settings"}}`**也能执行成功的** **返回数据**:`{"id":"abc123456","state":0,"message":"","data":{"172.16.0.180:5555":"Starting: Intent { cmp=com.android.settings/.Settings }\n","172.16.0.53:5555":"Starting: Intent { cmp=com.android.settings/.Settings }\nWarning: Activity not started, its current task has been brought to the front\n"}}`