执行同步adb shell命令
功能介绍
URI
POST /v1/{project_id}/cloud-phone/phones/sync-commands
请求消息
- 参数说明
参数
是否必选
参数类型
描述
command
是
String
当前仅支持填写shell。
content
是
String
待执行的命令
最大长度为1024字节,只支持大小写字母、数字、下划线(_)、点(.)、斜线(/)、冒号(:)、中划线(-)。
server_ids
否
phone_ids参数不存在时必选
Array of strings
云手机服务器ID列表
可通过查询云手机服务器列表获取。
phone_ids
否
server_ids参数不存在时必选
Array of strings
云手机ID列表
可通过查询云手机列表获取。
- 请求样例
POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/sync-commands { "command": "shell", "content": "ls -l /system", "phone_ids": [ "1234567b8bab40ffb711234cb80d0234", "1678567b8bab40f93711234cb80d0764" ] }
响应消息
- 响应参数
参数
参数类型
描述
request_id
String
请求的唯一标识ID
jobs
Array of objects
任务信息,详情请参见表2。
- 响应样例
{ "request_id": "6837531fd3f54550927b930180a706bf", "jobs": [{ "phone_id": "1234567b8bab40ffb711234cb80d0234", "job_id": "3fc17538866a4ff3a014d8bc6aaa4b69", "status": -1 "error_code": "CPS.0191", "error_msg": "Run command failed.", "execute_msg": "ls: cannot access '/system': No such file or directory" }, { "phone_id": "1678567b8bab40f93711234cb80d0764", "job_id": "1564567b8bab40f34711234cb80d5678", "status": 2 "error_code": "", "error_msg": "", "execute_msg": "xxxxx" }] }
返回值
请参考返回值。
错误码
请参考错误码。
