Skip to content

Execute ADB Shell Command

Request

Run a shell command on a Cloud Phone and return its output.

  • Preconditions: the phone must be powered on and not held by another member.
  • Effect: entirely determined by the command. MoreLogin stores nothing and applies no command allow-list and no length limit; the privileges the command runs with are set by the device service. Enable global root separately if a command needs it.
  • Completion: synchronous — data is the command output, not a task id.
  • Retry: there is no execution record to consult, so a timeout leaves the outcome unknown. Only retry commands you know are safe to run twice.

Documented business errors: 33300, 33301. See Error Codes for what each code means. Any operation can additionally return the common codes.

Bodyapplication/jsonrequired
idstringrequired

Cloud phone ID

commandstringrequired

Shell command to execute

curl -i -X POST \
  http://127.0.0.1:40000/api/cloudphone/exeCommand \
  -H 'Content-Type: application/json' \
  -d '{
    "command": "am start -n com.android.chrome/com.google.android.apps.chrome.Main",
    "id": "1674153897828425"
  }'

Responses

OK

Bodyapplication/json
codeintegerrequired

Response code: 0 indicates success, >0 indicates failure

datastringrequired

Response Information

msgstring or nullrequired

Response message:An error message will be returned when code is greater than 0

requestIdstring

Unique request identifier; include it when contacting support

Response
{ "code": 0, "data": "string", "msg": null, "requestId": "0d8b6f1c-9f4e-4d02-9d1a-7c3f5a1b2c3d" }