Search

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
Beginner Updated 8 min read
On this page
  1. The sidebar
  2. Open the Code Editor: a Python IDE for Android automation
  3. Run a script
  4. Read the logs
  5. Debug a Python macro
  6. The Claude Code terminal in the editor
  7. Asset Lab and UI Builder
  8. Files, folders and limits

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.

PageWhat it is for
MacrosYour projects. Create a project, open it in the Code Editor, delete it.
MarketplaceFree bots to download, and the place to publish your own. See Marketplace.
AgentDescribe a task and get a macro. See MAS Agent.
Device GroupsLocal emulators and cloud devices grouped for runs. Start and stop macros here. See Device groups.
Cloud DevicesCreate, start, stop and watch cloud devices. See Cloud devices.
SchedulerTimed runs on local devices. See Scheduler.
Port UsageWhich device ports are reserved right now, and by what.
ProxiesOne proxy per device. See Proxies.
RunsEvery run on your account with status, device, start, end and duration.
API KeysKeys for the REST API and the MCP server. See API keys.
Integrations (MCP)Connect Claude Code, Cursor or another MCP client. See MCP.
WebhooksEndpoints that receive run events. See Webhooks.
SubscriptionPlan, devices, credits and payment. See Billing.
HelpThe 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

  1. Open Macros and click a code project. New projects are created with Create New Project, as shown in Getting started.
  2. 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

  1. 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.
  2. 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.
  3. 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:

VariableValue
MAS_RPC_PORTThe port of the RPC server MAS opened for this run
MAS_RPC_HOSTlocalhost
MAS_DEVICE_IDThe target device
MAS_SESSION_TOKENA 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.

  1. Click in the gutter next to a line, or press F9, to set a breakpoint.
  2. Pick a local emulator and click Debug.
  3. The script pauses at the breakpoint. Use the controls to step, then Continue.

Each breakpoint has three optional fields in the Breakpoints list:

FieldWhat it does
WhenA Python expression. The breakpoint pauses only when it is true.
HitsA hit count: 5, == 5, >= 10 or % 5.
LogTurns the breakpoint into a logpoint: it prints the message to the Console and does not pause. Use {expression} placeholders.
ControlKey
Continue, PausePause pauses a running script
Step overF10
Step intoF11 (steps into mas calls as well)
Step outShift+F11
Run to cursorCtrl+F10
RerunCtrl+Shift+F5
Stop debuggerToolbar 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-form and generating-runtime-dashboard. They teach Claude the mas SDK, 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:

RuleLimit
File size5 MB per file
Extensions.py, .json, .txt, .md, .yaml, .yml, .toml, .ini, .cfg, .conf, .csv, .xml
File namesUp to 255 characters, no trailing dot or space, no Windows device names such as CON or COM1
PathsRelative, 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

Was this page helpful?

Questions? Ask in Discord