Overview
This API retrieves an archived log file from a device using an ADB pull command. Once the file is successfully retrieved, the API returns a downloadable URL that can be used to access the archived log file.
This API is commonly used after creating an archive using the Archive Logs on Device API.
Endpoint
URL: https://{your_base_url}.testgrid.io/api/execute-shell-adb-native/{device_id}
Method: POST
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| device_id | Integer | Yes | Unique identifier of the target device |
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_token | String | Yes | User authentication token |
| command | String | Yes | ADB pull command used to retrieve the archived log file |
Example Request
curl --location 'https://{your_base_url}.testgrid.io/api/execute-shell-adb-native/1'
--form 'user_token="YOUR_USER_TOKEN"'
--form 'command="pull /sdcard/Android/data/com.android.numeracle.screencapture/files/CallCapture/CallCaptureLogs/mylogs_archive.tar.gz TGFileName=mylogs_archive.tar.gz"'
Example Response
{
"success": true,
"message": "Command executed successfully.",
"output": "/sdcard/Android/data/com.android.numeracle.screencapture/files/CallCapture/CallCaptureLogs/mylogs_archive.tar.gz: 1 file pulled, 0 skipped. 0.8 MB/s (997 bytes in 0.001s)",
"file_url": "https://{your_base_url}.testgrid.io/device-cloud/ADBFiles/Download/DEVICE_ID/mylogs_archive.tar.gz"
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Indicates whether the command executed successfully |
| message | String | Status message returned after command execution |
| output | String | Output generated by the ADB pull command |
| file_url | String | Download URL for the retrieved archive file |
Notes
Replace
{device_id}with the target device ID.The
user_tokenmust be valid and associated with the environment.The API returns a downloadable URL only when the file is successfully retrieved.
Verify the file path in the command before execution.
Outcome
The API retrieves the specified archived log file from the target device and returns a downloadable URL, enabling users to collect and analyze device logs for troubleshooting, debugging, and automation reporting purposes.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article