AI Agent App Cloning on a Real Phone: A Low-Cost End-to-End Experiment
This article presents a low-cost end-to-end experiment in which an AI agent operated an Android test device to clone a target app. It covers structured information collection, page reconstruction, functional validation, and reusable skill packaging, then examines cost and time, compliance boundaries, and how the resulting assets can support further development.
1. Background: When Agents Start to “Act” Rather Than Just “Talk”
In the past, most use of large models stayed at the level of question answering and code snippet generation: you describe a requirement, the model outputs code, and you manually paste, debug, and run it. This approach has limited efficiency because a large amount of engineering time is consumed by manual transfer and environment adaptation.
As the Agent paradigm matures, large models are beginning to show a closed-loop capability of planning, execution, observation, and correction. An agent can call tools, operate a browser, control a terminal, and even operate a real phone like a person. This means that work that originally required several days of manual effort—such as fully cloning an app’s interface and interactions—can be compressed into a few hours.
I recently completed such an experiment: starting from zero, I had an agent operate an Android test device to analyze interface screenshots of a target app, reconstruct page structures, and clone functional logic, ultimately producing a high-fidelity clone. The whole process took about 7 hours, and the combined cost was only around RMB 20, mainly for model calls and compute. This article organizes the full process, methodology, and lessons learned for reference.
2. Overall Approach: Four Stages to Clone an App
Cloning is not simply copying screenshots. It needs to meet two standards: pixel-level reconstruction and functional usability. The whole workflow can be divided into four stages.
1. Information Collection: Let the Agent “Understand” the App
The first step is to give the agent a comprehensive understanding of the target app. The specific approach is:
- Install the target app on the test device and enable screen recording or page-by-page screenshots.
- Use an automation framework, such as UI automation capabilities based on the Accessibility service, to obtain the control tree, layout hierarchy, and text content of each page.
- Provide both screenshots and control information to a multimodal model, and ask it to output structured page descriptions: navigation structure, component composition, color scheme, spacing patterns, and interaction transition relationships.
The key to this step is structuring. Do not just show images to the model. Bind visual information with semantic information such as control types and click behavior. Otherwise, later reconstruction will produce a result that looks similar but behaves differently.
2. Page Reconstruction: From Screenshots to Runnable Code
With structured descriptions, the next step is to have the agent generate frontend code page by page. In practice, I recommend:
- First define a unified set of design tokens: primary color, secondary color, border radius, font size scale, and spacing base. Define once and reuse globally to avoid style drift across pages.
- Adopt a componentized generation strategy. Have the agent first produce common components such as navigation bars, cards, buttons, and modals, then compose them into pages.
- After each page is generated, immediately compare a screenshot with the original version, and feed differences such as margins, font sizes, and color deviations back to the model for iterative correction.
A typical iteration prompt can be organized like this:
Compare the two screenshots (original/current implementation) and list all visual differences.Prioritize them as follows: layout structure > color > font and font size > spacing > details.Modify the code item by item and output the complete file.
After two or three rounds of iteration, core pages such as the home page, list page, and detail page can basically reach a level of fidelity that is hard to distinguish with the naked eye.
3. Functional Validation: More Than “Looks Like”, It Must “Work”
Interface cloning is only the first half. The real difficulty lies in moving functional logic one-to-one, for example:
- Parameter adjustment and real-time preview for image editing features.
- Pagination loading, state retention, and multi-version records for lists.
- Duration control and progress memory for playback features.
At this stage, the approach is to write acceptance scripts for each function: define inputs, operation sequences, and expected outputs, and let the agent execute and verify them autonomously. For example, when validating a media playback feature, require the implementation to support complete extended playback, interruption resume, version retention, and original material attribution marking, rather than just creating a fake button that can be clicked.
4. Engineering Consolidation: Package Lessons into “Skills”
The agent did not have a smooth journey throughout the process. Common pitfalls include:
- Control tree parsing failures: Some custom controls cannot be read through the Accessibility service, so the system needs to fall back to pure visual analysis using screenshots, OCR, and visual reasoning.
- Confusing dynamic page states: Carousels and lazy loading cause mismatches between screenshots and control trees, so collection needs to happen in a stable state.
- Context loss in long tasks: Later in the cloning process, the model can easily “forget” design specifications defined earlier. The specifications need to be written into a persistent system prompt or configuration file.
The best destination for these lessons is to package them into a reusable skill package: including collection checklist templates, design token specifications, page reconstruction SOPs, functional acceptance checklists, and common issue handling strategies. The next time another app is cloned, loading this skill directly can improve efficiency by another order of magnitude.
3. Cost and Time Breakdown
Why was it possible to achieve 7 hours and about RMB 21? Breaking it down:
- Model call cost: Multimodal analysis, code generation, and iterative correction together involved dozens of rounds of dialogue. Using cost-effective models, the cost was in the range of ten-plus RMB.
- Device cost: An existing Android test device was used, with no additional spending. Headless mode further reduced intervention cost.
- Human cost: The human role shifted from “writing code” to “defining standards and reviewing results”, with intervention only at key nodes. Actual input was about one workday.
These numbers show that the agent-driven development model has lowered the threshold for “an individual developer cloning an app” from team-level engineering to an individual-level experiment.
4. Compliance Boundaries: One Thing That Must Be Made Clear
Technical feasibility does not mean there is no legal risk. When cloning another app, pay attention to the following:
- Do not copy copyrighted assets: Icons, illustrations, fonts, and audio/video content must be replaced with self-built or licensed assets.
- Do not clone trademarks or brand identities: Names, logos, and color schemes should be clearly differentiated if they have distinctive identifying power.
- Limit cloning to learning and research: The output can be used to understand technical implementation and validate interaction approaches. It is not recommended for direct commercial use or distribution.
- Comply with the target platform’s terms of service: Automated collection and operation behavior should conform to the relevant agreements.
Treating cloning as an “anatomy lesson” for understanding excellent product design, rather than a shortcut for copy-and-paste appropriation, is the correct approach.
5. Further Possibilities: From Cloning to Independent Development
After cloning is complete, the real value of this engineering asset is just beginning to emerge. Because the clone output includes complete frontend code, backend services, and a skill package, you can build on it for secondary development:
- Extract a module and turn it into a feature component in your own product.
- Use the same agent pipeline to quickly produce multiple prototypes for A/B validation of product directions.
- Generalize the process into “given a target description, automatically generate a runnable app skeleton”. This itself is an imaginative AI-native product direction.
For indie hackers and teams going global, this means the prototype validation cycle can be compressed from “weeks” to “days”, greatly reducing the cost of trial and error.
6. Conclusion
This practice validated three things. First, agents already have the ability to operate real devices end-to-end and complete complex engineering tasks. Second, the drop in cost and time is an order of magnitude, and individual developers have, for the first time, gained “industrialized” productivity. Third, the reusability of experience determines long-term efficiency—only by consolidating the pitfall process into standardized skills can the next task be faster and more stable.
If you also want to try it, I recommend starting with a utility app that has a simple interface structure. First run the minimal loop of “collection, reconstruction, and validation”, then gradually challenge more complex interactions. The technology is already in place; the rest is to start building.
