Skip to main content

Terminal Logs for Appium Tests

Real Device Virtual Device

TestMu AI lets you attach your own terminal logs (Appium server logs, test-runner output, or CI logs) to any app automation session through a single REST API. Once uploaded, you can view or download them directly from the TestMu AI Automation dashboard under Logs › Terminal.

This keeps your own diagnostic logs next to the session they belong to, so you can correlate them with the session's native logs (Appium, device, network, crash) in one place, without jumping between your CI system, local files, and the dashboard.


How it works

  • One log per session A session holds at most one terminal log at a time.
  • Latest upload Every upload replaces the existing log, regardless of the filename.
  • No special capability is required. Any valid session can receive a terminal log. There is no opt-in flag to set in your test capabilities.
  • Retention follows the session's normal artifact retention. The log is kept and expires on the same schedule as the session's other logs.

Upload a terminal log

Use the upload endpoint to attach a log file to a session. The file is sent as a multipart form field named file. Uploading again replaces the previous file.

curl -u "undefined:undefined" -X POST "https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/<YOUR_SESSION_ID>/log/terminallog" --form "file=@/path/to/appium.log"

Replace <YOUR_SESSION_ID> with your actual session ID and /path/to/appium.log with the path to your log file.

On success, the API returns:

{ "status": "success", "message": "File has been uploaded successfully!" }

View terminal logs in the dashboard


Open the session on the TestMu AI Automation dashboard. The Terminal sub-tab is always available under Logs (next to Crash). Once you upload a log file, it starts showing up in this tab, where you can view the file and read its contents in the browser.

note

The Terminal tab is always present. It stays empty until a terminal log is uploaded for the session.

Download a terminal log


To download the uploaded log, add the download=true query parameter to the view endpoint:

curl -u "undefined:undefined" -X GET "https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/<YOUR_SESSION_ID>/log/terminallog?download=true" --output terminal-logs.log
info

The downloaded file is always named terminal-logs.<ext>, where <ext> is your original file extension. The original base filename is not retained.

Delete a terminal log


To remove the attached log from a session, use the delete endpoint:

curl -u "undefined:undefined" -X DELETE "https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/<YOUR_SESSION_ID>/log/terminallog"

Supported formats and limits


Value
Maximum file size5 MB
Allowed file types.txt, .json, .xml, .log, .csv, .html, .yaml, .yml, .har, .gz
Files per session1 (each upload replaces the previous file)
Empty (0-byte) fileNot allowed

FAQ


Can I upload more than one file to a session? No. A session holds one terminal log at a time, and each new upload replaces the previous one.

How long are terminal logs kept? They follow the session's normal artifact retention, on the same schedule as the session's other logs. There is no separate retention setting.

Do I need a special capability to use this? No. Any valid app automation session can receive a terminal log; there is no opt-in flag to set in your test capabilities.

If you still have any questions for us, please feel free to let us know via our 24X7 Chat Portal or mail us to [email protected]

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles