This content originally appeared on DEV Community and was authored by Tiago Danin
Automating Android app documentation and testing with artificial intelligence
The Initial Challenge
I was facing a specific challenge: I needed to automatically document various flows of an Android application. That's when I started exploring ways to accomplish this process, and one of the tools I decided to test was Claude Code.
Initially, Claude Code didn't adapt very well. However, as an Android developer, during a chat conversation, it was demonstrated how to use ADB commands to simulate user actions like clicks, typing, and other interactions, so that the AI could control my smartphone.
I thought about looking for an MCP (Model Context Protocol) that already implemented this functionality, but I couldn't find any suitable one, so I decided to build my own: Android-Debug-Bridge-MCP.
The Power of ADB UI Automator
One of the most valuable features of ADB is the UI Automator, which returns a detailed XML of the current interface. This makes the use of the adb shell tap x y
command much more precise for clicking on specific screen elements, for example, since it shows exactly their positions and the LLM understands the XML format better than an image.
What I needed to organize was:
- What types of elements to detect in the interface
- How to show the content and position of each element
- How to allow Claude Code to execute the correct action at the exact position
Evolving the Agent
After integrating Claude Code with my MCP, I rewrote the agent and gradually improved it until I reached an efficient flow. My AI agent follows a simple but effective pattern:
- Visualize the current screen content
- Execute a specific action
- Repeat the process
- Generate a complete test report
Real Example: Testing Stock Pulse App
I'll show how the agent automatically tested the process of adding a stock (NVDA) within an app I helped develop called StockPulse:
Command Used
@agent-app-tester Open br.com.idopterlabs.Tickerapp, add an Nvidia stock to the portfolio, click Save, and I expect the stock's current data to be displayed on the screen.
The agent then executed the entire flow automatically. It created a test folder called tickerapp_nvda_test
, opened the StockPulse app, and began its work. First, it captured an initial screenshot showing the empty portfolio screen. Then it navigated to add a new stock by tapping the "+" button and captured the stock selection screen.
Next, the agent selected NVIDIA (NVDA) from the list, verified the stock details were properly displayed, and generated a complete report with all screenshots and results documented.
Final Result
The agent automatically generated:
- Organized screenshots
- Complete markdown report
- Documentation of each step
- Success/failure status for each stage
All of this in less than 2 minutes, without manual intervention!
Use Cases and Possibilities
The combination of MCP with Claude Code opens up various possibilities:
Test Automation becomes incredibly powerful with this approach. You can execute automated regression tests for critical flows without any manual intervention, validate interface elements and layouts automatically, and simulate realistic user interactions for usability testing.
Intelligent Documentation is another game-changer. The system can automatically capture organized screenshots for app documentation, create detailed documentation of user journeys within applications, generate technical manuals with step-by-step guides and visual evidence, and even perform periodic monitoring to verify application states.
The possibilities are practically infinite - any need involving automated control of Android devices can benefit from this solution.
Quick Setup
Getting started is straightforward. You'll need ADB installed and configured on your system, an Android device connected or emulator running, and Claude Code properly set up.
To install the MCP, simply run npm install -g android-debug-bridge-mcp
in your terminal. Then add it to Claude Code with the command claude mcp add --scope project android-debug-bridge-mcp -- npx android-debug-bridge-mcp
.
Next, configure a custom agent with specific prompts for your test cases. You can find my configuration at: app-tester.md
Once everything is set up, you can start executing tests using simple and direct commands to begin automation.
Conclusion
Claude Code, when combined with the right tools and well-structured instructions, demonstrates impressive potential for automation. This experiment represents only the beginning of a broader exploration - there's plenty of room for future improvements.
It's important to recognize that for more complex scenarios, the expertise of a professional QA is still necessary. AI automation complements, but doesn't completely replace, specialized testing knowledge.
Despite the limitations, I confess it was extremely gratifying to develop this solution. It not only met my initial objective of documenting application flows but also opened doors to new automation possibilities that previously seemed impractical.
The project will continue evolving, and I hope to bring new features in the future.
Thanks to my friend Iago Cavalcante for reviewing the translation and introducing me to Claude Code.
This content originally appeared on DEV Community and was authored by Tiago Danin

Tiago Danin | Sciencx (2025-08-22T19:19:38+00:00) Creating an AI Agent in Claude Code to Control my Smartphone. Retrieved from https://www.scien.cx/2025/08/22/creating-an-ai-agent-in-claude-code-to-control-my-smartphone/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.