> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Integrate GBOX with Cursor IDE for seamless Android app testing and development workflow.

If you have not installed Cursor, please check the [installation](https://docs.cursor.com/en/get-started/installation) instructions before proceeding.

## Getting Started

<Steps>
  <Step title="Install GBOX CLI">
    Install the GBOX CLI tool to manage your GBOX configuration.

    ```bash theme={null}
    # Install GBOX CLI
    brew install gbox

    # Update GBOX if already installed
    brew update && brew upgrade gbox
    ```
  </Step>

  <Step title="Login and Configure GBOX">
    Enter the command in the command line.

    ```bash theme={null}
    gbox login
    ```

    This command will prompt you to enter your GBOX API key and configure your account.
  </Step>

  <Step title="Use GBOX CLI to configure GBOX Android MCP Server for Cursor">
    Set up the Model Context Protocol (MCP) server to enable communication between Cursor and GBOX.

    ```bash theme={null}
    #Using GBOX CLI
    #NOTE: This command will not affect your original configuration.
    gbox mcp export --merge-to cursor

    #Check merging result
    cursor /Users/@your-username/.cursor/mcp.json
    ```

    Or copy and paste the following content into your Cursor configuration file, you'll find the MCP configuration in `~/.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "gbox-android": {
          "command": "npx",
          "args": [
            "-y",
            "@gbox.ai/mcp-server@latest"
          ]
        }
      }
    }
    ```
  </Step>

  <Step title="Add Cursor Rule for Android Testing">
    Download and configure the pre-built rule file for Android app testing: [Rule File Link](https://github.com/babelcloud/gbox-mcp-server/blob/main/src/prompts/gbox-manual.md)

    <img src="https://mintcdn.com/gbox-551f8aad/jd9idhpJM54nI41-/images/integrations/ide/cursor/add-rule.png?fit=max&auto=format&n=jd9idhpJM54nI41-&q=85&s=e7dd36564bba280f2c99b5b1c84f57de" alt="Add Rule Step 1" width="1280" height="1045" data-path="images/integrations/ide/cursor/add-rule.png" />

    This rule file contains predefined instructions for the AI agent to effectively test Android applications using GBOX.
  </Step>

  <Step title="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. **Check** whether the rule is enabled

           <img src="https://mintcdn.com/gbox-551f8aad/jd9idhpJM54nI41-/images/integrations/ide/cursor/add-rule-success.png?fit=max&auto=format&n=jd9idhpJM54nI41-&q=85&s=9bda40a212dfd076a08efe964e3f0633" alt="Add Rule Step 1" width="1280" height="1045" data-path="images/integrations/ide/cursor/add-rule-success.png" />

    3. **Assign testing tasks** to the AI agent:

           <img src="https://mintcdn.com/gbox-551f8aad/jd9idhpJM54nI41-/images/integrations/ide/cursor/assign-task.png?fit=max&auto=format&n=jd9idhpJM54nI41-&q=85&s=8a8fa157ffcd3a1f2ee76d41d70d19e9" alt="Assign Task" width="1280" height="800" data-path="images/integrations/ide/cursor/assign-task.png" />
  </Step>

  <Step title="Work with your local Android">
    By default, GBOX MCP uses a cloud android VM. To connect GBOX to your own Android devices, see [Register Local Devices](https://docs.gbox.ai/cli/register-local-device).
  </Step>
</Steps>

## Demo

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/U8-yyPi18FI" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/TtzrbS5ooWw" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />
