Gbox provides cloud-based Android automation testing without the need to purchase, configure, or maintain any Android devices. Gbox supports both virtual machines and physical devices, letting you focus on testing:

  • No Device Management - Eliminate hardware procurement, system configuration, and device maintenance hassles
  • Ready to Use - Get clean Android testing environments in seconds
  • Flexible Options - Choose between virtual machines or physical devices based on your testing needs
  • Auto Scaling - Run multiple tests in parallel without hardware limitations
1

Get an API Key

  1. Go to Gbox AI
  2. Copy your API Key
  3. Paste your Gbox API Key into your env file
.env
GBOX_API_KEY=gbox-******
2

Install Gbox SDK and other dependencies

Install gbox-sdk and other dependencies by running the following command in your terminal.

npm install gbox-sdk dotenv typescript tsx @types/node
3

Create a basic Android box

Create a basic Android box by running the following code.

import GboxSDK from "gbox-sdk";
import * as dotenv from "dotenv";

dotenv.config();

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"], // This is the default and can be omitted
});

async function main() {
  const box = await gboxSDK.create({ type: "android" });

  console.log(`Android box created: ${box.data.id}`);

  // take a screenshot of the box
  await box.action.screenshot({
    path: "screenshot.png",
  });

  // terminate the box
  await box.terminate();

  console.log("Box terminated");
}

main();
4

Run the box

Run the box by running the following command in your terminal.

npx tsx index.ts

More Android Capabilities

Explore the complete Android API reference to discover all available operations and features.