Device API / API reference
Control a device
Send a command to one active cloud phone by its Appcloud device ID.
POST
/api/v1/devices/{id}/actionsRequest body
Send JSON with an action and its string value. Reboot takes only the action name and disconnects the live session.
| Action | Purpose | Example value |
|---|---|---|
startApp | Start an installed app | com.android.chrome |
stopApp | Stop an installed app | com.android.chrome |
restartApp | Restart an installed app | com.android.chrome |
inputText | Type into the focused field | Hello from Appcloud |
updateLanguage | Set the Android language | en-US |
updateTimeZone | Set the time zone | America/New_York |
restart | Reboot the phone | Omit |
tap | Tap at screen coordinates | 120 240 |
swipe | Swipe between two points over a duration in milliseconds | 100 500 100 100 350 |
longPress | Hold a point for a duration in milliseconds | 120 240 800 |
adbKey | Press an Android navigation or volume key | home |
uploadFile | Copy a staged file to the phone | FILE_ID |
installApp | Install a staged APK | FILE_ID |
uninstallApp | Remove an installed package | com.example.app |
setKeepAliveApp | Keep an Android service running | com.example.app/com.example.app.SyncService |
reset | Erase the device and restore its factory settings | ERASE |
disconnect | End the streaming session | Omit |
clearApps | Close apps and return to the home screen | Omit |
Terminal
curl -X POST "$APPCLOUD_BASE/api/v1/devices/$DEVICE_ID/actions" -H "Authorization: Bearer $APPCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"startApp","value":"com.android.chrome"}'Submission result
202 · JSON
{
"deviceId": "phone_123",
"action": "startApp",
"status": "submitted"
}submitted means the command was accepted for processing. already pending means an earlier task is still queued. Open the phone in My devices to verify the effect.