Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.42.0
Android Environment Setup Guide
This guide will help you set up a local Android environment for AgentWorld.
Installation Steps
Download and Install Android Studio
- Visit https://developer.android.com/studio
- Download and install the latest version for your operating system
Install ADB and Android Emulator
- Open Android Studio
- Click on the top menu: Tools → SDK Manager
- Check the following components:
- Android SDK Build-Tools
- Android SDK Command-line Tools
- Android Emulator
- Android SDK Platform-Tools
- Click "Apply" to install these components
- Important: Copy the installation directory path (you'll need it later for configuration)
Create a Virtual Device
- From the main menu, select: View → Tool Windows → Device Manager
- Click the "+" button, then "Create Virtual Device"
- Select a device (e.g., Medium Phone), then click "Next"
- Select a image (e.g., VanillalceCream), then click "Next"
- Configure device settings as needed, then click "Finish"
- Important: Note down the AVD ID (device name) for later use
- From the main menu, select: View → Tool Windows → Device Manager
Configure in Your Code
- Method 1: Default Acquisition of Emulator and ADB Installation Paths
- Only set the AVD_ID copied during the earlier installation process.
- Method 2: Manually Specify Emulator and ADB Installation Paths.Provide the following:
- AVD_ID: The name of the virtual device you created
- ADB path: Your SDK directory + "/platform-tools/adb"
- Emulator path: Your SDK directory + "/emulator/emulator"
- Method 1: Default Acquisition of Emulator and ADB Installation Paths
Example Code
Method 1
from examples.tools.android.action.adb_controller import ADBController
# Initialize the Android controller
android_controller = ADBController(avd_name="Medium_Phone_API_35")
Method 2
from examples.tools.android.action.adb_controller import ADBController
# Initialize the Android controller
android_controller = ADBController(
avd_name="Medium_Phone_API_35",
adb_path="/Users/username/Library/Android/sdk/platform-tools/adb",
emulator_path="/Users/username/Library/Android/sdk/emulator/emulator"
)
# Now you can use this controller with your agent
Troubleshooting
- If the emulator fails to start, try increasing the memory allocation in the AVD settings
- Make sure your paths are correct for your operating system:
- Windows: Use backslashes or raw strings (r"C:\path\to\sdk")
- macOS/Linux: Use forward slashes as shown in the example