Download Appium Log
Use this method to download Appium server logs for troubleshooting a session. The SDK returns binary data rather than parsed text.
Use the log when a session fails to start, an Appium command fails or the device behavior differs from the test result.
Before You Begin
Keep the sessionId returned by Start Session. Logs can be requested for the related session without manually creating a download URL.
SDK Method
Java | Node.js |
|---|---|
client.sessions().logs(sessionId) returns byte[] | await client.sessions().logs(sessionId) returns Buffer |
Request and Response Contract
Item | Contract |
|---|---|
Input | Required sessionId string |
Request body | None |
Customer-supplied headers | None |
Java result | Binary byte[] |
Node.js result | Binary Buffer |
The result is not a JSON model. Write the returned bytes directly to a log file or pass them to a binary-safe storage system.
Examples
byte[] logBytes = client.sessions().logs("session-123");
Files.write(Paths.get("appium.log"), logBytes);The log may not be available immediately while a session is still starting or finalizing. Preserve SDK error status and response body when reporting an unavailable artifact.
Do not render untrusted log content as HTML without escaping it.
Next Step
After collecting required artifacts, stop the session and release its allocation when no more sessions are planned.