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

# Setup

> Set up the MobileBoost SDK with your Java Appium test suite

The MobileBoost SDK for Appium drops into your existing Java Appium suite. Your code-based tests run first, and AI kicks in as a fallback when a step fails.

## Prerequisites

Install Appium and the platform drivers:

```bash theme={null}
# Install Appium
npm install -g appium

# Install drivers
appium driver install xcuitest      # iOS
appium driver install uiautomator2  # Android
```

## Installation

Add the dependency to your `pom.xml`:

```xml theme={null}
<dependencies>
    <dependency>
        <groupId>io.mobileboost.gptdriver</groupId>
        <artifactId>gptdriver-client</artifactId>
        <version>2.2.0</version>
    </dependency>
</dependencies>
```

## Configuration

Replace your Appium driver classes with the MobileBoost subclasses and add your API key as a capability:

```java theme={null}
import io.mobileboost.gptdriver.*;

UiAutomator2Options options = new UiAutomator2Options();
options.setCapability("gptdriver:apiKey", "YOUR_API_KEY");

// Use GptDriverAndroid instead of AndroidDriver
AndroidDriver driver = new GptDriverAndroid(
    new java.net.URL("http://127.0.0.1:4723"),
    options
);
```

You can also pass additional context to enhance AI behavior:

```java theme={null}
GptDriverAndroid driver = new GptDriverAndroid(
    new java.net.URL("http://127.0.0.1:4723"),
    options,
    "When asked about Location Permissions, grant it."
);
```

## Start the Appium server

Before running tests, start the Appium server:

```bash theme={null}
appium
```

## Next steps

<Columns cols={2}>
  <Card title="Reference" icon="book" href="/engineer-tooling/appium-java-reference">
    Driver classes, AI commands, and caching.
  </Card>

  <Card title="Examples" icon="code" href="/engineer-tooling/appium-java-examples">
    Worked examples using the Java SDK.
  </Card>
</Columns>
