appium_get_page_source
Retrieves current-screen XML from an Appium session and can save it to a file, returning a path or byte count for UI inspection and selector targeting.
Instructions
Get current-screen XML. saveToFile=true returns server-local path/bytes and enables selector/pattern summaries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | full (default): raw XML. compact: one line per actionable/readable element (about 90% smaller); use when you only need to act. | |
| pattern | No | Literal tag/attribute substring. | |
| selector | No | XPath selecting elements. | |
| sessionId | No | Session ID; defaults to the active session. | |
| saveToFile | No | Save fresh XML to a file; return path/bytes instead of XML. |