Overview

Cursor is an AI-powered code editor that enhances your development workflow with intelligent code completion, refactoring, and debugging capabilities. By integrating Gbox with Cursor, you can leverage AI agents to automatically test and validate your Android applications in cloud-based Android environments. This integration enables you to:
  • Automated Testing - Let AI agents test your Android apps on real or virtual devices
  • Seamless Development - Test your code changes directly from your IDE
  • Cloud-Based Testing - No need for local Android device setup
  • AI-Powered Workflow - Intelligent test generation and execution

Prerequisites

Before setting up the Cursor integration, ensure you have:
  • Cursor IDE installed on your system
  • An Android project for testing (we’ve prepared a Demo repository that you can use to get started quickly)

Getting Started

1

Install Gbox CLI

Install the Gbox CLI tool to manage your Gbox configuration.
sudo npm install -g @gbox.ai/cli
2

Login and Configure Gbox

Authenticate with your Gbox account and set up the configuration.
gbox login
This command will prompt you to enter your Gbox API key and configure your account.
3

Configure MCP Server with Cursor

Set up the Model Context Protocol (MCP) server to enable communication between Cursor and Gbox.
gbox mcp export --merge-to cursor
This command automatically registers the gbox-android MCP server with Cursor. After successful execution, you’ll find the MCP configuration in ~/.cursor/mcp.json:
{
  "mcpServers": {
    "gbox-android": {
      "command": "npx",
      "args": [
        "-y",
        "@gbox.ai/mcp-android-server@latest"
      ]
    }
  }
}
Open Cursor’s settings and verify that the server is enabled and the available tools are correctly listed.MCP Server Configuration
4

Add Cursor Rule for Android Testing

Download and configure the pre-built rule file for Android app testing.
cd <your-android-repo-dir>
mkdir -p .cursor/rules/tool-rules
curl -fsSL https://raw.githubusercontent.com/babelcloud/open-webui/refs/heads/main/.cursor/rules/tool-rules/gbox-testing-agent.mdc -o .cursor/rules/tool-rules/gbox-testing-agent.mdc
This rule file contains predefined instructions for the AI agent to effectively test Android applications using Gbox.
5

Develop and Test Your Android App

Now you can use Cursor’s Agent Mode to test your Android applications.
  1. Enable Agent Mode in Cursor
  2. Add the Gbox testing rule to the context:
Add Rule Step 1Add Rule Step 2
  1. Assign testing tasks to the AI agent:
Assign TaskThe AI agent will now be able to:
  • Create Android boxes on demand
  • Install and test your applications
  • Perform automated UI testing
  • Handle device management automatically

Ready to Build Your Android App!

Congratulations! You’ve successfully set up the Cursor + Gbox integration. Now you can leverage the power of AI to develop and test your Android applications seamlessly. With this setup, you can:
  • Create new Android projects from scratch with AI assistance
  • Build and test your apps in cloud-based Android environments
  • Automate UI testing without managing physical devices
  • Iterate quickly with instant feedback from AI agents
Start by creating a new Android project or using our demo repository as a reference, then let the AI agent help you build, test, and refine your Android applications!