> ## 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.

# Physical Device

<Frame>
  <img src="https://mintcdn.com/gbox-551f8aad/jd9idhpJM54nI41-/images/real-device.png?fit=max&auto=format&n=jd9idhpJM54nI41-&q=85&s=24c6d256b27ab6a167ad650b2eba4dfd" alt="Physical Device Pn" className="mx-auto" width="1536" height="1024" data-path="images/real-device.png" />
</Frame>

<Warning>
  This is a **beta feature** currently in testing phase. Please note that physical
  device availability may be limited, and some functionalities might experience
  occasional instability. We appreciate your feedback to help us improve this
  feature.
</Warning>

GBOX provides cloud physical devices through [https://gbox.ai](https://gbox.ai). You can instantly start cloud physical Android devices and operate through GBOX SDK/MCP/CLI. You can also register your local Android devices to gbox.ai and operate in the same way as cloud ones. [Register Local Android](https://docs.gbox.ai/cli/register-local-device)

*Note: Virtual devices created through Android Studio locally are treated as local physical devices.*

## Key Features

* **Real Hardware**: Access to actual physical Android devices, not emulators
* **Remote Control**: Full touch, swipe, and gesture support
* **Live View**: Real-time screen streaming with minimal latency

## Usage

### How to create a box using cloud physical device

<CodeGroup>
  ```typescript Typescript icon="https://cdn.worldvectorlogo.com/logos/typescript.svg" highlight={12-14} theme={null}
  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",
      config: {
        deviceType: "physical",
      },
    });

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

    const liveView = await box.liveView();

    console.log(`Live view URL: ${liveView.url}`);
  }

  main();
  ```

  ```python Python icon="https://cdn.worldvectorlogo.com/logos/python-5.svg" highlight={13-16} theme={null}
  import os
  from dotenv import load_dotenv
  from gbox_sdk import GboxSDK

  # Load environment variables from .env file
  load_dotenv()

  def main():
      api_key = os.getenv("GBOX_API_KEY")
      gbox = GboxSDK(api_key=api_key)

      box = gbox.create(
          type="android",
          config={
              "deviceType": "physical",
          }
      )

      print(f"Android box created: {box.data.id}")

      live_view = box.live_view()

      print(f"Live view URL: {live_view.url}")

  if __name__ == "__main__":
      main()
  ```
</CodeGroup>

### Create a box using local Android device

If you want to connect to a **local real device**,here is the tutorial:

1. Refer to the [Register Local Device](/cli/register-local-device) to register your real device to the cloud and get the corresponding device ID.

2. Enter the device ID in the SDK parameter below and execute:

<CodeGroup>
  ```typescript Typescript icon="https://cdn.worldvectorlogo.com/logos/typescript.svg" highlight={12-18} theme={null}
  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",
      config: {
        deviceType: "physical",
        labels: {
          "gbox.ai/device-id": "YOUR_DEVICE_ID", // Replace with your device ID
        },
      },
    });

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

    const liveView = await box.liveView();

    console.log(`Live view URL: ${liveView.url}`);
  }

  main();
  ```

  ```python Python icon="https://cdn.worldvectorlogo.com/logos/python-5.svg" highlight={13-19} theme={null}
  import os
  from dotenv import load_dotenv
  from gbox_sdk import GboxSDK

  # Load environment variables from .env file
  load_dotenv()

  def main():
      api_key = os.getenv("GBOX_API_KEY")
      gbox = GboxSDK(api_key=api_key)

      box = gbox.create(
          type="android",
          config={
              "deviceType": "physical",
              "labels":{
                  "gbox.ai/device-id": "YOUR_DEVICE_ID" # Replace with your device ID
              }
          }
      )

      print(f"Android box created: {box.data.id}")

      live_view = box.live_view()

      print(f"Live view URL: {live_view.url}")

  if __name__ == "__main__":
      main()
  ```
</CodeGroup>
