Studio
Python IDE for Android Automation: Studio Tour
Tour the Python IDE inside Macro Automation Studio: run an Android macro on an emulator or cloud device, read the console, and debug with breakpoints.
- Windows
- Mac
- Emulator
- Cloud device
- Studio
On this page
Macro Automation Studio (MAS) is a desktop app with a sidebar of pages and a Code Editor, a Python IDE for Android automation. This page walks through both, then covers running a script, reading logs, the debugger, the Claude Code terminal and the file rules.
The sidebar
The sidebar has three groups. Build pages create macros, Run pages execute them, Account pages manage your account.
| Page | What it is for |
|---|---|
| Macros | Your projects. Create a project, open it in the Code Editor, delete it. |
| Marketplace | Free bots to download, and the place to publish your own. See Marketplace. |
| Agent | Describe a task and get a macro. See MAS Agent. |
| Device Groups | Local emulators and cloud devices grouped for runs. Start and stop macros here. See Device groups. |
| Cloud Devices | Create, start, stop and watch cloud devices. See Cloud devices. |
| Scheduler | Timed runs on local devices. See Scheduler. |
| Port Usage | Which device ports are reserved right now, and by what. |
| Proxies | One proxy per device. See Proxies. |
| Runs | Every run on your account with status, device, start, end and duration. |
| API Keys | Keys for the REST API and the MCP server. See API keys. |
| Integrations (MCP) | Connect Claude Code, Cursor or another MCP client. See MCP. |
| Webhooks | Endpoints that receive run events. See Webhooks. |
| Subscription | Plan, devices, credits and payment. See Billing. |
| Help | The in-app help center. |
New to Python? MAS Agent writes the macro for you from a plain description, and the result is a normal project you open in the Code Editor.
Open the Code Editor: a Python IDE for Android automation
- Open Macros and click a code project. New projects are created with Create New Project, as shown in Getting started.
- The editor opens on
src/app.py.
The layout: a toolbar across the top, the Explorer on the left with Code Files and Assets, editor tabs in the middle, the Console below, and the Git view and Debugger panel on demand.
The editor is Monaco with a Python language server (basedpyright) running against MAS’s own Python environment. You get completion and hover text for the mas package, diagnostics as you type, and Go to Definition, which opens the SDK source for reading. The language server starts once the Python environment is ready.
Toolbar essentials: Save (Ctrl+S), Open in editor for an external editor installed on your computer, Show in File Explorer, and Publish to send the project to the Marketplace.
Run a script
- Pick a device from the device list. Local emulators are listed by port; Cloud devices by name. A stopped cloud device starts when you click Run.
- Click Run (F5). If the project has an argument form or argparse arguments, the “Run” dialog opens with the fields. Fill them in and click Run Script.
- Follow the Console. Click Stop (Shift+F5) to end the run.
On a local device MAS launches the script from its own Python environment as python -u -m src.app, with the project root as the working directory and on PYTHONPATH. Arguments from the dialog are appended. The script finds MAS through environment variables:
| Variable | Value |
|---|---|
MAS_RPC_PORT | The port of the RPC server MAS opened for this run |
MAS_RPC_HOST | localhost |
MAS_DEVICE_ID | The target device |
MAS_SESSION_TOKEN | A token for this run |
import mas reads these, which is why a script started from a plain terminal reports “Could not discover RPC port”.
On a cloud device the run happens server-side. MAS first uploads a snapshot of your working tree, then the Console shows “Syncing code” lines and the run’s output. The Device button opens a live view of the cloud device next to the code. Details are on Git projects and code sync.
Read the logs
The Console has a filter: All, Output (stdout, including print), Errors (stderr), System (messages from MAS about the run) and Engine (the device layer). Clear console empties it. mas.log("text", level="warning") writes a leveled line. Lines longer than 64 KB are split rather than dropped.
The Console is per session. For history, open Runs: it keeps every run on your account with the macro, the device, timestamps, duration and the exit IP when a proxy was used. Scheduled runs also save their output to a file; see Scheduler.
Debug a Python macro
The debugger runs on local emulators. It is not offered for cloud devices.
- Click in the gutter next to a line, or press F9, to set a breakpoint.
- Pick a local emulator and click Debug.
- The script pauses at the breakpoint. Use the controls to step, then Continue.
Each breakpoint has three optional fields in the Breakpoints list:
| Field | What it does |
|---|---|
| When | A Python expression. The breakpoint pauses only when it is true. |
| Hits | A hit count: 5, == 5, >= 10 or % 5. |
| Log | Turns the breakpoint into a logpoint: it prints the message to the Console and does not pause. Use {expression} placeholders. |
| Control | Key |
|---|---|
| Continue, Pause | Pause pauses a running script |
| Step over | F10 |
| Step into | F11 (steps into mas calls as well) |
| Step out | Shift+F11 |
| Run to cursor | Ctrl+F10 |
| Rerun | Ctrl+Shift+F5 |
| Stop debugger | Toolbar button |
While paused, the panel shows the Call Stack, a Watch list (Add watch), the Variables of the selected frame, and an Evaluate expression box. A variable’s value can be copied or replaced with Set value. Two toggles change when the session pauses: Pause on entry and Pause on uncaught exceptions.
Variable inspection has limits: 200 variables per scope, 50 children per expanded value, two levels of nesting, and values cut at 500 characters. Names that start with an underscore are hidden.
The Claude Code terminal in the editor
The Claude button opens a terminal that runs Claude Code inside the project folder. MAS does not ship Claude Code; it looks for your own claude command on the PATH, in the usual install folders and in your login shell. If it is missing, the panel says “Claude Code was not found” with a link to the installer.
- New starts a fresh session, Continue resumes the latest one, and the project history lists earlier sessions to resume or rename.
- The terminal has MAS’s Python environment on its PATH, and pasting an image attaches it to the conversation.
- MAS places three skills in
.claude/skills/inside the project:writing-macro-script,generating-args-formandgenerating-runtime-dashboard. They teach Claude themasSDK, argument forms and runtime dashboards, and they stay out of git through.git/info/exclude. - Marketplace scripts are read-only, so the terminal is disabled for them.
Asset Lab and UI Builder
Two helper apps open from the editor.
- In the Assets panel, Open Asset Helper launches Asset Lab. The same panel lists your Image Library: search by name or ID, Upload images, create folders, and Copy ID for use in
mas.images. - Add Args UI and Add Runtime UI launch UI Builder with a new argument form or runtime dashboard. Once a project has one, the buttons read Edit Args UI and Edit Runtime UI.
Files, folders and limits
Projects live under C:\ProgramData\MacroAutomationStudio\projects on Windows and ~/Library/Application Support/MacroAutomationStudio/projects on a Mac, one folder per project named <id>_<name>. Each project is a git repository; see Git projects and code sync.
Scripts run in a Python 3.13 environment that MAS creates with uv, separate from any Python on your computer, with the mas package installed. The same environment powers the language server and the Claude terminal.
The editor writes only inside the project folder and enforces these rules:
| Rule | Limit |
|---|---|
| File size | 5 MB per file |
| Extensions | .py, .json, .txt, .md, .yaml, .yml, .toml, .ini, .cfg, .conf, .csv, .xml |
| File names | Up to 255 characters, no trailing dot or space, no Windows device names such as CON or COM1 |
| Paths | Relative, up to 1024 characters, no .. |
Images are not project files. They go to the Image Library (10 MB each; jpg, jpeg, png, gif or webp) and are referenced by ID.
Next steps
Related pages
Thanks. If something is wrong, tell us in Discord.
Questions? Ask in Discord