### Quick Start Environment Setup and Execution Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/codespace/README.md Configure the API key and execute a Python example script within the Codespace environment. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run any example python code_execution_example.py ``` -------------------------------- ### Configure and Run Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Environment setup and execution command for the example script. ```bash # Set your API key export AGENTBAY_API_KEY="your-api-key-here" # Compile and run the example npx ts-node main.ts ``` -------------------------------- ### Installing and Running Command Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to install the SDK, configure the API key, and execute the TypeScript example. ```bash npm install wuying-agentbay-sdk ``` ```bash export AGENTBAY_API_KEY=your_api_key_here ``` ```bash # Compile TypeScript cd command-example npx ts-node command-example.ts ``` -------------------------------- ### Install and Run Quick Start Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to install the SDK, configure the API key, and execute the basic usage script. ```bash # Install dependencies npm install wuying-agentbay-sdk # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run the quick start example npx ts-node basic-usage.ts ``` -------------------------------- ### Run Quick Start Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/common-features/README.md Commands to set the API key and execute example scripts. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run any example cd basics/session_creation python main.py cd ../file_system python main.py ``` -------------------------------- ### Run Extension Example Project Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to install dependencies, build, and execute the extension example. ```bash # Navigate to the TypeScript directory cd typescript # Install dependencies npm install # Build the project npm run build # Run the extension example node docs/examples/extension-example/extension-example.js ``` -------------------------------- ### Quick Start for Computer Use Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/computer-use/README.md Commands to configure the API key and execute the application management example. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run the example cd computer python windows_app_management_example.py ``` -------------------------------- ### Starting Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/computer-use/computer-application-management.md Demonstrates how to start applications, including finding them in the installed apps list. ```APIDOC ## POST /api/computer/start_app ### Description Starts an application using its command. This method can be used to launch applications found in the installed apps list. ### Method POST ### Endpoint /api/computer/start_app ### Parameters #### Request Body - **start_cmd** (string) - Required - The command to start the application. ### Request Example ```json { "start_cmd": "/usr/bin/google-chrome-stable" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **data** (array) - A list of processes started by the command. - **error_message** (string) - Error message if the operation failed. #### Response Example ```json { "success": true, "data": [ { "pname": "chrome", "pid": 6378, "cmdline": "/usr/bin/google-chrome-stable --flag" } ], "error_message": null } ``` ``` -------------------------------- ### Quick Start: AgentBay SDK Golang Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/README.md A comprehensive example demonstrating session creation, command execution, and file operations using the AgentBay SDK in Golang. Ensure API keys are set as environment variables. ```go package main import ( "fmt" "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay" ) func main() { // Create session client, err := agentbay.NewAgentBay("", nil) if err != nil { fmt.Printf("Initialization failed: %v\n", err) return } // Verified: ✓ Client initialized successfully result, err := client.Create(nil) if err != nil { fmt.Printf("Session creation failed: %v\n", err) return } // Verified: ✓ Session created with ID like "session-04bdwfj7u2a668axp" session := result.Session // Execute command cmdResult, err := session.Command.ExecuteCommand("ls -la") if err == nil { fmt.Printf("Command output: %s\n", cmdResult.Output) } // Verified: ✓ Command executed successfully // Sample output: "总计 100\ndrwxr-x--- 16 wuying wuying 4096..." // File operations session.FileSystem.WriteFile("/tmp/test.txt", "Hello World", "") fileResult, err := session.FileSystem.ReadFile("/tmp/test.txt") if err == nil { fmt.Printf("File content: %s\n", fileResult.Content) } // Verified: ✓ File written and read successfully // Output: "File content: Hello World" } ``` -------------------------------- ### Start and Manage Windows Applications with AgentBay SDK Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/computer-use/README.md Demonstrates starting, listing, and stopping Windows applications using the AgentBay SDK's Computer API. Includes examples for starting by executable name, listing visible applications, stopping by PID or process name, and retrieving all installed applications. ```java // Start an application session.getComputer().startApp("notepad.exe"); // List visible applications ListResult visibleApps = session.getComputer().listVisibleApps(); for (App app : visibleApps.getApps()) { System.out.println("App: " + app.getName() + " (PID: " + app.getPid() + ")"); } // Stop by PID session.getComputer().stopAppByPID(12345); // Stop by process name session.getComputer().stopAppByPName("notepad.exe"); // Get all installed apps List installedApps = session.getComputer().getInstalledApps(); ``` -------------------------------- ### Complete Workflow Example (Linux/MacOS) Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/codespace/codestral-data-analysis-python/MISTRAL_CODESTRAL_GUIDE.md Demonstrates a complete workflow for setting up and running analysis, including navigating to the project directory, setting environment variables, verifying them, and installing dependencies. ```bash # 1. Enter project directory cd cookbook/codespace/codestral-data-analysis-python # 2. Set environment variables (Windows PowerShell) $env:AGENTBAY_API_KEY = "your_agentbay_api_key_here" $env:MISTRAL_API_KEY = "your_mistral_api_key_here" # 3. Verify environment variables python -c "import os; print('AGENTBAY_API_KEY:', 'SET' if os.environ.get('AGENTBAY_API_KEY') else 'NOT SET'); print('MISTRAL_API_KEY:', 'SET' if os.environ.get('MISTRAL_API_KEY') else 'NOT SET')" # 4. Install dependencies (if not already installed) pip install -r mistral_requirements.txt ``` -------------------------------- ### Run Extension Management Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/examples/browser-use/extension-example/README.md Navigate to the TypeScript directory, install dependencies, build the project, and then run the extension example using Node.js. ```bash cd typescript npm install npm run build node docs/examples/extension-example/extension-example.js ``` -------------------------------- ### Example: Basic Logger Setup Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/api/common/logging.md Configures the logger with debug level enabled. Requires importing AgentBayLogger and get_logger. ```python from .logger import AgentBayLogger, get_logger # Basic setup with debug level AgentBayLogger.setup(level="DEBUG") logger = get_logger("app") logger.debug("Debug mode enabled") ``` -------------------------------- ### Example: Setup with Custom Log File and Rotation Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/api/common/logging.md Configures logging to a specific file with size-based rotation and retention. Requires importing AgentBayLogger and get_logger. ```python from .logger import AgentBayLogger, get_logger # Setup with custom log file and rotation AgentBayLogger.setup( level="INFO", log_file="/var/log/agentbay/app.log", max_file_size="50 MB", retention="7 days" ) logger = get_logger("app") logger.info("Application started with file logging") ``` -------------------------------- ### Run Mobile Simulate Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/mobile-use/mobile_simulate_basic_usage/README.md Set your AgentBay API key, navigate to the example directory, and run the Go example to demonstrate mobile simulation. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Navigate to the example directory cd golang/docs/examples/mobile-use/mobile_simulate_basic_usage # Run the example go run main.go ``` -------------------------------- ### Run the Ele.me Login Persistence Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/mobile/app-login-persistence/eleme/README.md Execute the main Python script to start the AgentBay session and follow the on-screen instructions for login and verification. ```bash python main.py ``` -------------------------------- ### Start Application Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/computer-use/computer.md Starts a specified application. Provide the command to start the application, its working directory, and optionally an activity. Handles potential errors during startup. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("windows_latest")) defer result.Session.Delete() processResult, err := result.Session.Computer.StartApp("notepad.exe", "", "") if err != nil { log.Fatal(err) } ``` -------------------------------- ### Run AgentBay Java Examples with Maven Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/README.md Demonstrates how to set the AGENTBAY_API_KEY and run Java examples using Maven. Ensure you have Java 8+ and Maven 3.6+ installed. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Navigate to the agentbay directory cd agentbay # Run any example mvn clean compile exec:java -Dexec.mainClass="com.aliyun.agentbay.examples.FileSystemExample" ``` -------------------------------- ### Run Browser Proxies Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/examples/browser-use/browser/README.md Execute the browser proxies TypeScript example to demonstrate custom proxy setup, WuYing proxy strategies, and proxy authentication. ```bash ts-node browser-proxies.ts ``` -------------------------------- ### Quick Start Mobile Automation Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/mobile-use/README.md Commands to configure the environment and execute the provided mobile automation examples. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run the main example cd mobile_system python main.py # Run ADB URL example cd .. python mobile_get_adb_url_example.py ``` -------------------------------- ### Set API Key and Run Quick Start Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/browser/login-persistence/README.md Set your AgentBay API key as an environment variable and navigate to the example directory to run the main script. ```bash export AGENTBAY_API_KEY=your_api_key_here cd cookbook/browser/login-persistence python main.py ``` -------------------------------- ### Run Extension Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Execute the provided Python example scripts. ```bash python basic_extension_usage.py python extension_development_workflow.py python extension_testing_automation.py ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/api/mobile-use/mobile.md Retrieves a list of installed applications on the device. Options are available to include start menu, desktop, and system applications. ```java public InstalledAppListResult getInstalledApps(boolean startMenu, boolean desktop, boolean ignoreSystemApps) ``` ```java public InstalledAppListResult getInstalledApps() ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/computer-use/computer-application-management.md Retrieves a list of all installed applications on the computer. Supports filtering by start menu and desktop shortcuts, and ignoring system applications. ```APIDOC ## GET /api/computer/get_installed_apps ### Description Get a list of installed applications on the computer. ### Method GET ### Endpoint /api/computer/get_installed_apps ### Parameters #### Query Parameters - **start_menu** (bool) - Optional - If True, include applications found in the start menu. - **desktop** (bool) - Optional - If True, include applications found on the desktop. - **ignore_system_apps** (bool) - Optional - If True, exclude system applications from the list. ### Response #### Success Response (200) - **success** (bool) - Whether the operation succeeded. - **data** (List[InstalledApp]) - List of installed applications. - **error_message** (str) - Error message if operation failed. - **request_id** (str) - Unique request identifier. #### Response Example ```json { "success": true, "data": [ { "name": "Notepad", "start_cmd": "notepad.exe", "stop_cmd": null, "work_directory": null } ], "error_message": null, "request_id": "req_12345" } ``` ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/computer-use/computer-application-management.md Retrieves a list of installed applications from the desktop environment. Can filter by start menu or desktop shortcuts and exclude system applications. ```python result = session.computer.get_installed_apps( start_menu=True, desktop=False, ignore_system_apps=True ) # Verification: Result type is InstalledAppListResult # Verification: Success = True # Verification: Found 76 installed applications on test system if result.success: apps = result.data print(f"Found {len(apps)} installed applications") # Output: Found 76 installed applications for app in apps[:5]: print(f"Name: {app.name}") print(f"Start Command: {app.start_cmd}") print(f"Stop Command: {app.stop_cmd if app.stop_cmd else 'N/A'}") print(f"Work Directory: {app.work_directory if app.work_directory else 'N/A'}") print("---") # Output example: # Name: AptURL # Start Command: apturl %u # Stop Command: N/A # Work Directory: N/A # --- # Name: Bluetooth Transfer # Start Command: bluetooth-sendto # Stop Command: N/A # Work Directory: N/A # --- else: print(f"Error: {result.error_message}") ``` -------------------------------- ### Quick Start with Golang Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/README.md Initialize the client, create a sandbox session, and execute code. ```go import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay" client, _ := agentbay.NewAgentBay("", nil) // Create a cloud sandbox result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("code_latest")) session := result.Session // Execute code in the sandbox res, _ := session.Code.RunCode("print('Hello AgentBay')", "python") fmt.Println(res.Output) // Hello AgentBay client.Delete(session, false) ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/computer-use/computer.md Retrieves a list of installed applications, with options to include Start Menu and Desktop shortcuts, and to ignore system applications. Error handling is recommended. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("windows_latest")) defer result.Session.Delete() appsResult, err := result.Session.Computer.GetInstalledApps(true, true, true) if err != nil { log.Fatal(err) } ``` -------------------------------- ### Quick Start with Java Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/README.md Initialize the client, create a sandbox session, and execute code. ```java import com.aliyun.agentbay.*; AgentBay agentBay = new AgentBay(); // Create a cloud sandbox CreateSessionParams params = new CreateSessionParams().setImageId("code_latest"); Session session = agentBay.create(params).getSession(); // Execute code in the sandbox CodeExecutionResult result = session.getCode().runCode("print('Hello AgentBay')", "python"); if (result.isSuccess()) { System.out.println(result.getResult()); // Hello AgentBay } agentBay.delete(session, false); ``` -------------------------------- ### Execute the Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/common-features/basics/archive-upload-mode-example/README.md Navigate to the example directory and run the main Go application. ```bash # Navigate to the example directory cd golang/docs/examples/archive-upload-mode-example # Run the example go run main.go ``` -------------------------------- ### Quick Start with Python Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/README.md Initialize the client, create a sandbox session, and execute Python code. ```python from agentbay import AgentBay, CreateSessionParams agent_bay = AgentBay() # Create a cloud sandbox (options: "code_latest", "browser_latest", "desktop_latest") session = agent_bay.create(CreateSessionParams(image_id="code_latest")).session # Execute code in the sandbox result = session.code.run_code("print('Hello AgentBay')", "python") if result.success: print(result.result) # Hello AgentBay agent_bay.delete(session) ``` -------------------------------- ### Get Installed Applications with Options Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/api/computer-use/computer.md Retrieves a list of installed applications, with options to include start menu items, desktop shortcuts, and to ignore system applications. Defaults are set for common use cases. ```java public InstalledAppListResult getInstalledApps(boolean startMenu, boolean desktop, boolean ignoreSystemApps) ``` -------------------------------- ### Run LangChain Orchestration Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/codespace/auto-testing-agent/sync/langchain/README.md Navigate to the example directory and execute the Python script to run the LangChain orchestration example. ```bash cd YOUR_PREFIX_PATH/cookbook/codespace/auto-testing-agent/sync/langchain/ python src/auto_testing_agent_example.py ``` -------------------------------- ### Get Installed Mobile Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/mobile-use/mobile-application-management.md Queries for installed applications on a mobile device, with options to include start menu apps and exclude system apps. Note: The 'mobile_latest' image may return an empty list. ```python result = session.mobile.get_installed_apps( start_menu=True, desktop=False, ignore_system_apps=True ) if result.success: apps = result.data print(f"Found {len(apps)} installed applications") for app in apps[:5]: print(f"Name: {app.name}") print(f"Start Command: {app.start_cmd}") print(f"Stop Command: {app.stop_cmd if app.stop_cmd else 'N/A'}") print(f"Work Directory: {app.work_directory if app.work_directory else 'N/A'}") print("---") else: print(f"Error: {result.error_message}") ``` -------------------------------- ### Close Window by ID Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/api/computer-use/computer.md Closes a specified window using its ID. This example demonstrates starting an app, getting its window ID, and then closing it. ```typescript const agentBay = new AgentBay({ apiKey: process.env.AGENTBAY_API_KEY }); const result = await agentBay.create({ imageId: 'windows_latest' }); if (result.success) { await result.session.computer.startApp('notepad.exe'); const win = await result.session.computer.getActiveWindow(); await result.session.computer.closeWindow(win.window!.id); await result.session.delete(); } ``` -------------------------------- ### Start Application from Installed Apps List Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/computer-use/computer-application-management.md Finds and starts an application by searching the installed applications list. This method is useful when the exact start command is unknown but the application name is. ```python result = session.computer.get_installed_apps( start_menu=True, desktop=False, ignore_system_apps=True ) # Verification: Successfully retrieves installed apps list if result.success: apps = result.data target_app = None for app in apps: if "chrome" in app.name.lower(): target_app = app break # Verification: Found "Google Chrome" in the apps list if target_app: print(f"Starting {target_app.name}...") # Output: Starting Google Chrome... start_result = session.computer.start_app(target_app.start_cmd) # Verification: Successfully started the application if start_result.success: print("Application started successfully!") # Output: Application started successfully! else: print(f"Failed to start: {start_result.error_message}") else: print("Target application not found") ``` -------------------------------- ### Run Go Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/codespace/code_example/README.md Navigate to the example directory and run the main Go program. Ensure the AGENTBAY_API_KEY environment variable is set. ```bash cd docs/examples/golang/code_example go run main.go ``` -------------------------------- ### Install SDK and Dependencies Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/examples/README.md Install the AgentBay SDK and necessary dependencies for running examples. For browser examples, Playwright is also required. ```bash npm install wuying-agentbay-sdk npm install playwright npx playwright install chromium npm install -D typescript ts-node @types/node ``` -------------------------------- ### Start Application with Directory and Activity Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/api/mobile-use/mobile.md Launches an application using a specified command, optionally defining its working directory and the activity to start. This is the most comprehensive way to start an app. ```java public ProcessListResult startApp(String startCmd, String workDirectory, String activity) ``` -------------------------------- ### Run List Sessions Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/common-features/basics/list_sessions/README.md Navigate to the example directory and run the main Go program. ```bash cd /path/to/wuying-agentbay-sdk/golang/docs/examples/list_sessions go run main.go ``` -------------------------------- ### Get Browser Task Status Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/common-features/advanced/agent.md Example demonstrating how to get the status of a browser task. It involves initializing the client, creating a session, executing a task to get a task ID, and then calling GetTaskStatus with that ID. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) sessionResult, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("windows_latest")) defer sessionResult.Session.Delete() execResult := sessionResult.Session.Agent.Browser.ExecuteTask("Find weather in NYC", 10) statusResult := sessionResult.Session.Agent.Browser.GetTaskStatus(execResult.TaskID) ``` -------------------------------- ### API Methods Used for Computer Application Management Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/computer-use/computer/README.md This table lists the AgentBay SDK API methods used in the Windows application management example. It details the purpose of each method, such as retrieving installed applications, starting and stopping processes, and listing visible applications. ```markdown | Method | Purpose | |--------|---------| | `session.computer.get_installed_apps()` | Get list of installed applications | | `session.computer.start_app()` | Start an application | | `session.computer.list_visible_apps()` | List currently visible applications | | `session.computer.stop_app_by_pid()` | Stop application by process ID | | `session.computer.stop_app_by_pname()` | Stop application by process name | ``` -------------------------------- ### Quick Start with AgentBay SDK Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/README.md Demonstrates creating a session, executing a shell command, performing file I/O, and cleaning up resources. ```java import com.aliyun.agentbay.*; // Create session AgentBay agentBay = new AgentBay(); CreateSessionParams params = new CreateSessionParams(); SessionResult result = agentBay.create(params); if (result.isSuccess()) { Session session = result.getSession(); // Execute command CommandResult cmdResult = session.getCommand().executeCommand("ls -la"); System.out.println(cmdResult.getOutput()); // File operations session.getFileSystem().writeFile("/tmp/test.txt", "Hello World"); FileContentResult content = session.getFileSystem().readFile("/tmp/test.txt"); System.out.println(content.getContent()); // Hello World // Clean up session.delete(); } ``` -------------------------------- ### Run SDK Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to configure the API key and execute example scripts. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run any example cd docs/examples/basic_usage go run main.go # Or run from any example directory cd docs/examples/common-features/basics/session_creation go run main.go ``` -------------------------------- ### Manage Mobile Applications and UI Interactions Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/README.md Provides a comprehensive example of mobile device UI automation. It covers getting installed apps, starting/stopping applications, performing tap and swipe gestures, inputting text, sending key events, and taking screenshots. ```java Session session = agentBay.create(params).getSession(); // 1. Get installed apps InstalledAppListResult appsResult = session.getMobile() .getInstalledApps(true, false, true); for (InstalledApp app : appsResult.getData()) { System.out.println("App: " + app.getName()); } // 2. Start an application ProcessListResult result = session.getMobile().startApp( "monkey -p com.android.settings -c android.intent.category.LAUNCHER 1" ); // 3. Perform tap BoolResult tapResult = session.getMobile().tap(500, 800); // 4. Swipe gesture BoolResult swipeResult = session.getMobile().swipe(500, 1000, 500, 500); // 5. Input text BoolResult inputResult = session.getMobile().inputText("Hello!"); // 6. Send key event import com.aliyun.agentbay.mobile.KeyCode; BoolResult keyResult = session.getMobile().sendKey(KeyCode.HOME); // 7. Take screenshot OperationResult screenshot = session.getMobile().screenshot(); System.out.println("Screenshot: " + screenshot.getData()); // 8. Stop application session.getMobile().stopAppByCmd("am force-stop com.android.settings"); ``` -------------------------------- ### Discover and Start Application if Installed Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/computer-use/README.md Checks if a specific application, like Chrome, is installed on the system. If found, it proceeds to start the application. This is useful for ensuring an application is available before attempting to launch it. ```java // Check if specific app is installed List apps = session.getComputer().getInstalledApps(); boolean hasChrome = apps.stream() .anyMatch(app -> app.getName().contains("Chrome")); if (hasChrome) { session.getComputer().startApp("chrome.exe"); } ``` -------------------------------- ### Run Session Creation Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Navigate to the session creation directory and execute the example code. ```bash cd session_creation go run main.go ``` -------------------------------- ### Configure Environment and Install SDK Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Set the API key and install the required Go package. ```bash export AGENTBAY_API_KEY='your-api-key-here' ``` ```bash go get github.com/aliyun/wuying-agentbay-sdk/golang ``` -------------------------------- ### Go: Build and Run Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/common-features/basics/context_sync_demo/context_sync_demo.md Standard Go commands to build the executable and then run it. This is useful for deploying or testing the application. ```bash # From the golang directory go run docs/examples/data_persistence/context_sync_demo.go # Or build and run go build -o context_sync_demo docs/examples/data_persistence/context_sync_demo.go ./context_sync_demo ``` -------------------------------- ### Retrieve Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Example usage for fetching a list of installed applications from a mobile session. ```python session = (await agent_bay.create(image="mobile_latest")).session apps = await session.mobile.get_installed_apps(True, False, True) print(f"Found {len(apps.data)} apps") await session.delete() ``` -------------------------------- ### Run Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/browser-use/README.md Navigate to the browser examples directory and run a Python script. ```bash # Set your API key export AGENTBAY_API_KEY=your_api_key_here # Run any example cd browser python browser_automation.py ``` -------------------------------- ### Run Session Creation Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/common-features/basics/session_creation/README.md Navigate to the session_creation directory and execute the main Go program. Ensure the AGENTBAY_API_KEY environment variable is set. ```bash cd session_creation go run main.go ``` -------------------------------- ### Install AgentBay SDK for Golang Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/README.md Use 'go get' to install the AgentBay SDK for Golang. ```bash go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay ``` -------------------------------- ### Install Dependencies Before Execution Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/codespace/README.md Install required packages using the Command API before running code that depends on them. This example shows installing Python packages. ```bash pip install pandas numpy ``` ```python import pandas as pd; print(pd.__version__) ``` -------------------------------- ### Run SDK Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/README.md Execute the provided example scripts for async or sync workflows. ```bash python python/docs/examples/_async/codespace/python_development.py ``` ```bash python python/docs/examples/_sync/codespace/python_development.py ``` -------------------------------- ### Install Golang SDK Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/quickstart/installation.md Initialize a Go module and fetch the SDK package directly. ```bash # Initialize module (if new project) mkdir my-agentbay-project && cd my-agentbay-project go mod init my-agentbay-project # Install the package GOPROXY=direct go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay # Verify installation go list -m github.com/aliyun/wuying-agentbay-sdk/golang && echo "✅ Installation successful" ``` -------------------------------- ### Find Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/computer-use/computer/README.md Discovers installed applications from the start menu, excluding system applications. Requires an active AgentBay session. ```python apps_result = session.computer.get_installed_apps( start_menu=True, desktop=False, ignore_system_apps=True ) ``` -------------------------------- ### Run Session Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/common-features/basics/session_get/README.md Commands to configure the API key and execute the example script. ```bash # Set your API key export AGENTBAY_API_KEY="your-api-key-here" # Run the example python main.py ``` -------------------------------- ### Run AgentBay SDK Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to configure the API key and execute the main persistence example. ```bash # Set your API key export AGENTBAY_API_KEY="your-api-key-here" # Run the example go run main.go ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Retrieves a list of installed applications from a mobile session. Requires a valid session created with an image ID. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("mobile_latest")) defer result.Session.Delete() appsResult := result.Session.Mobile.GetInstalledApps(true, true, true) ``` -------------------------------- ### Run AgentBay SDK Examples from Source Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/common-features/basics/README.md Navigate to the SDK root directory and use Maven or direct compilation to run example classes. ```bash cd java/agentbay mvn compile exec:java -Dexec.mainClass="com.aliyun.agentbay.examples.FileSystemExample" mvn compile exec:java -Dexec.mainClass="com.aliyun.agentbay.examples.ContextSyncLifecycleExample" mvn compile exec:java -Dexec.mainClass="com.aliyun.agentbay.examples.SessionConfigurationExample" ``` ```bash cd java/agentbay/src/main/java javac -cp "path/to/agentbay.jar" com/aliyun/agentbay/examples/FileSystemExample.java java -cp ".:path/to/agentbay.jar" com.aliyun.agentbay.examples.FileSystemExample ``` -------------------------------- ### Install AgentBay and Dependencies Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/mobile/nl-mobile-control/WEB_DEMO.md Installs the necessary Python packages for running the AgentBay mobile control example. Ensure you have a virtual environment activated. ```bash python -m venv .venv source .venv/bin/activate pip install agentbay fastapi uvicorn ``` -------------------------------- ### Get Installed Applications Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/api/computer-use/computer.md Retrieves a default list of installed applications. This method uses default boolean values for startMenu, desktop, and ignoreSystemApps. ```java public InstalledAppListResult getInstalledApps() ``` -------------------------------- ### Configure Browser Options Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/browser-use/browser.md Example demonstrating how to set custom user agent, viewport, screen, and enable stealth mode. Includes validation of the configuration. ```go option := browser.NewBrowserOption() // Custom user agent ua := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0" option.UserAgent = &ua // Viewport and screen option.Viewport = &browser.BrowserViewport{Width: 1920, Height: 1080} option.Screen = &browser.BrowserScreen{Width: 1920, Height: 1080} // Stealth mode option.UseStealth = true // Validate configuration if err := option.Validate(); err != nil { log.Fatalf("Invalid configuration: %v", err) } ``` -------------------------------- ### Get context usage example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/common-features/basics/context.md Demonstrates retrieving or creating a context. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) contextResult, _ := client.Context.Get("my-context", true) ``` -------------------------------- ### Run FileSystem Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Commands to configure the API key and execute the filesystem operations example. ```bash export AGENTBAY_API_KEY="your-api-key-here" go run main.go ``` -------------------------------- ### Install Dependencies from PyPI Mirror Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/skills/agentscope-official-skills-sandbox/README.md Install dependencies from a specified PyPI index URL if the default pinned versions are unavailable, for example, due to an internal mirror. ```bash pip install -i https://pypi.org/simple -r cookbook/skills/agentscope-official-skills-sandbox/requirements.txt ``` -------------------------------- ### Python Example: Full AgentBay SDK Workflow Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/mobile-use/mobile-simulate.md This comprehensive example demonstrates initializing the AgentBay client, managing user-specific contexts, configuring context synchronization, simulating mobile device properties, uploading mobile info if necessary, creating a session with context sync, executing a command on the simulated device, and finally deleting the session. Ensure the AGENTBAY_API_KEY environment variable is set. ```python import os import time from agentbay import AgentBay, MobileSimulateService from agentbay import ContextSync, SyncPolicy, BWList, WhiteList from agentbay import CreateSessionParams, ExtraConfigs from agentbay import MobileExtraConfig, MobileSimulateMode def main(): # Initialize AgentBay client agent_bay = AgentBay(api_key=os.getenv("AGENTBAY_API_KEY")) # Step 1: Get or create user-specific context print("Getting a user specific context...") context_result = agent_bay.context.get("user_phone_number", create=True) if not context_result.success or not context_result.context: print(f"Failed to get context: {context_result.error_message}") return context = context_result.context print(f"context.id = {context.id}, context.name = {context.name}") # Step 2: Create context sync configuration sync_policy = SyncPolicy( bw_list=BWList( white_lists=[ WhiteList(path="/com.wuying.devinfo", exclude_paths=[]) ] ) ) context_sync = ContextSync( context_id=context.id, path="/data/data", policy=sync_policy, ) # Step 3: Create MobileSimulateService and configure simulate_service = MobileSimulateService(agent_bay) simulate_service.set_simulate_enable(True) simulate_service.set_simulate_mode(MobileSimulateMode.PROPERTIES_ONLY) # Step 4: Check and upload mobile info if needed print("Checking or uploading mobile dev info file...") has_mobile_info = simulate_service.has_mobile_info(context_sync) if not has_mobile_info: with open("mobile_info_model_a.json", "r") as f: mobile_info_content = f.read() upload_result = simulate_service.upload_mobile_info( mobile_info_content, context_sync ) if not upload_result.success: print(f"Failed to upload: {upload_result.error_message}") return print("Mobile dev info uploaded successfully") else: print(f"Mobile dev info already exists: {has_mobile_info}") # Step 5: Create session with context sync params = CreateSessionParams( image_id="mobile_latest", context_syncs=[context_sync], extra_configs=ExtraConfigs( mobile=MobileExtraConfig( simulate_config=simulate_service.get_simulate_config() ) ) ) print("Creating session...") session_result = agent_bay.create(params) if not session_result.success or not session_result.session: print(f"Failed to create session: {session_result.error_message}") return session = session_result.session print(f"Session created with ID: {session.session_id}") # Step 6: Wait for mobile simulate to complete time.sleep(5) # Step 7: Use the session # Device info is automatically loaded from context print("Getting device model after mobile simulate...") result = session.command.execute_command("getprop ro.product.model") if result.success: print(f"Session device model: {result.output.strip()}") # Step 8: Delete session with context sync print("Deleting session...") delete_result = agent_bay.delete(session, sync_context=True) if not delete_result.success: print(f"Failed to delete session: {delete_result.error_message}") return print(f"Session deleted successfully (RequestID: {delete_result.request_id})") if __name__ == "__main__": main() ``` -------------------------------- ### GET /apps/installed Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/api/async/async-mobile.md Retrieves a list of installed applications based on specified criteria. ```APIDOC ## GET /apps/installed ### Description Retrieves a list of installed applications. ### Method GET ### Endpoint /apps/installed ### Query Parameters - **start_menu** (bool) - Required - Whether to include start menu applications. - **desktop** (bool) - Required - Whether to include desktop applications. - **ignore_system_apps** (bool) - Required - Whether to ignore system applications. ### Response #### Success Response (200) - **data** (list) - The list of installed applications. #### Response Example ```json { "data": [ { "name": "App Name", "package_name": "com.example.app" } ] } ``` ``` -------------------------------- ### Verify SDK Setup Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/common-features/basics/session-management.md Use these snippets to verify your API key configuration and SDK installation. ```python import os from agentbay import AgentBay api_key = os.getenv("AGENTBAY_API_KEY") agent_bay = AgentBay(api_key=api_key) result = agent_bay.create() if result.success: print("✅ Setup successful - ready to use session management!") agent_bay.delete(result.session) else: print(f"❌ Setup issue: {result.error_message}") ``` ```python import os import asyncio from agentbay import AsyncAgentBay async def main(): api_key = os.getenv("AGENTBAY_API_KEY") agent_bay = AsyncAgentBay(api_key=api_key) result = await agent_bay.create() if result.success: print("✅ Setup successful - ready to use session management!") await agent_bay.delete(result.session) else: print(f"❌ Setup issue: {result.error_message}") asyncio.run(main()) ``` -------------------------------- ### Initialize and Configure BrowserOption Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Demonstrates how to instantiate a new browser option and customize settings like user agent, viewport, and stealth mode. ```go option := browser.NewBrowserOption() // Custom user agent ua := "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0" option.UserAgent = &ua // Viewport and screen option.Viewport = &browser.BrowserViewport{Width: 1920, Height: 1080} option.Screen = &browser.BrowserScreen{Width: 1920, Height: 1080} // Stealth mode option.UseStealth = true // Validate configuration if err := option.Validate(); err != nil { log.Fatalf("Invalid configuration: %v", err) } ``` -------------------------------- ### Execute SDK Examples Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/python/docs/examples/_async/common-features/basics/file_system/README.md Run the provided example scripts for file operations, directory monitoring, and file transfers. ```bash # Basic file operations python basic_file_operations_example.py # Directory monitoring python watch_directory_example.py # File transfers python file_transfer_example.py ``` -------------------------------- ### Define InstalledApp Type Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/mobile-use/mobile.md Represents an installed application on a mobile device, including its name and commands for starting and stopping. ```go type InstalledApp struct { Name string `json:"name"` StartCmd string `json:"start_cmd"` StopCmd string `json:"stop_cmd,omitempty"` WorkDirectory string `json:"work_directory,omitempty"` } ``` -------------------------------- ### Run Java Example with Maven Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/network_example/README.md Execute the NetworkExample using Maven's exec plugin. ```bash cd java/agentbay mvn exec:java -Dexec.mainClass="com.aliyun.agentbay.examples.NetworkExample" ``` -------------------------------- ### Run Basic Usage Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/examples/basic_usage/README.md Navigate to the 'basic_usage' directory and execute the main Go program. Ensure the AGENTBAY_API_KEY environment variable is set or replace the placeholder in the code with your actual API key. ```bash cd basic_usage go run main.go ``` -------------------------------- ### Drag Mouse Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/golang/docs/api/computer-use/computer.md Drags the mouse from a starting point to an ending point with a specified button. Requires an active session. ```go client, _ := agentbay.NewAgentBay(os.Getenv("AGENTBAY_API_KEY"), nil) result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("windows_latest")) defer result.Session.Delete() dragResult := result.Session.Computer.DragMouse(100, 100, 300, 300, computer.MouseButtonLeft) ``` -------------------------------- ### Compile and Run Java Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/java/docs/examples/network_example/README.md Compile the Java code and run the NetworkExample directly. ```bash cd java/agentbay mvn clean compile java -cp target/classes:$(mvn dependency:build-classpath | grep -v 'INFO') \ com.aliyun.agentbay.examples.NetworkExample ``` -------------------------------- ### Launch Application Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/computer-use/desktop-gui-automation/README.md Launch an application on the cloud desktop by providing its command-line executable name. For example, 'gedit' to start the text editor. ```python start_result = await session.computer.start_app("gedit") # Started: gedit (PID: 42506) ``` -------------------------------- ### Start Application with AgentBay SDK Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/api/computer-use/computer.md Illustrates how to start an application using its command. Optional parameters for working directory and activity can be provided. ```typescript const agentBay = new AgentBay({ apiKey: 'your_api_key' }); const result = await agentBay.create({ imageId: 'windows_latest' }); if (result.success) { const startResult = await result.session.computer.startApp('notepad.exe'); console.log(`Started ${startResult.data.length} process(es)`); await result.session.delete(); } ``` -------------------------------- ### Complete OSS Workflow Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/common-features/advanced/oss-integration.md Demonstrates a full workflow including session creation, OSS initialization with STS credentials, writing a local file, uploading it to OSS, downloading it back, and reading its content. Ensure AGENTBAY_API_KEY is set in your environment. ```python import os from agentbay import AgentBay from agentbay import CreateSessionParams agent_bay = AgentBay(api_key=os.getenv("AGENTBAY_API_KEY")) params = CreateSessionParams(image_id="code_latest") result = agent_bay.create(params) if not result.success: print(f"Failed to create session: {result.error_message}") exit(1) session = result.session try: # Initialize OSS with STS temporary credentials init_result = session.oss.env_init( access_key_id="your-sts-access-key-id", access_key_secret="your-sts-access-key-secret", security_token="your-sts-security-token", # Required for STS credentials endpoint="https://oss-cn-hangzhou.aliyuncs.com", region="cn-hangzhou" ) if not init_result.success: print(f"Failed to initialize OSS: {init_result.error_message}") exit(1) print("✓ OSS environment initialized") session.file_system.write_file( path="/home/wuying/data.txt", content="Hello from AgentBay!", mode="overwrite" ) print("✓ Created local file") upload_result = session.oss.upload( bucket="my-bucket", object="agentbay/data.txt", path="/home/wuying/data.txt" ) if upload_result.success: print(f"✓ File uploaded to OSS: {upload_result.content}") else: print(f"✗ Upload failed: {upload_result.error_message}") download_result = session.oss.download( bucket="my-bucket", object="agentbay/data.txt", path="/home/wuying/downloaded_data.txt" ) if download_result.success: print(f"✓ File downloaded from OSS: {download_result.content}") content_result = session.file_system.read_file("/home/wuying/downloaded_data.txt") if content_result.success: print(f"✓ File content: {content_result.content}") else: print(f"✗ Download failed: {download_result.error_message}") finally: agent_bay.delete(session) print("✓ Session deleted") ``` -------------------------------- ### Run Browser Viewport Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Execute the script demonstrating custom viewport and screen configuration. ```bash ts-node browser-viewport.ts ``` -------------------------------- ### Quick Start with TypeScript Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/README.md Initialize the client, create a sandbox session, and execute code using asynchronous calls. ```typescript import { AgentBay } from 'wuying-agentbay-sdk'; const agentBay = new AgentBay(); // Create a cloud sandbox const session = (await agentBay.create({ imageId: "code_latest" })).session; // Execute code in the sandbox const result = await session.code.runCode("print('Hello AgentBay')", "python"); if (result.success) { console.log(result.result); // Hello AgentBay } await agentBay.delete(session); ``` -------------------------------- ### TypeScript Session Object Usage Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/typescript/docs/examples/common-features/basics/get/README.md Example showing how to use the typed `Session` object returned by the `get` method, benefiting from full IDE autocomplete support. ```typescript import { AgentBay, Session } from "wuying-agentbay-sdk"; const agentBay = new AgentBay({ apiKey: "your-key" }); const session: Session = await agentBay.get("session-id"); // TypeScript knows all methods and properties of session ``` -------------------------------- ### Cookie Persistence Example Setup Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/docs/guides/browser-use/core-features/browser-context.md Sets up a persistent context, creates a first session, navigates to a page, and adds cookies. Requires AGENTBAY_API_KEY environment variable. ```typescript import { AgentBay, CreateSessionParams, BrowserContext, BrowserOption } from 'wuying-agentbay-sdk'; import { chromium } from 'playwright'; // Initialize AgentBay const agentBay = new AgentBay({ apiKey: process.env.AGENTBAY_API_KEY! }); // Create persistent context const contextResult = await agentBay.context.get("cookie-demo-context", true); const context = contextResult.context; // First session - set cookies const browserContext: BrowserContext = { contextId: context.id, autoUpload: true }; const params :CreateSessionParams = { imageId:'browser_latest', browserContext:browserContext, } const session1 = (await agentBay.create(params)).session; // Set cookies in first session await session1.browser.initializeAsync(new BrowserOption()); const endpointUrl = session1.browser.getEndpointUrl(); const browser = await chromium.connectOverCDP(endpointUrl); const contextP = browser.contexts()[0] || await browser.newContext(); const page = await contextP.newPage(); // Navigate and set cookies await page.goto("https://example.com"); await contextP.addCookies([ { name: "session_cookie", value: "session_value", domain: "example.com", path: "/", } ]); await browser.close(); // Delete first session with context sync await agentBay.delete(session1, true); ``` -------------------------------- ### Run Screenshot Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/llms-full.txt Execute the screenshot capability demonstration. ```bash ts-node screenshot-example.ts ``` -------------------------------- ### Run Device Simulation Example Source: https://github.com/agentbay-ai/wuying-agentbay-sdk/blob/main/cookbook/mobile/device-simulation/README.md Navigate to the device simulation example directory and run the main Python script. ```bash cd cookbook/mobile/device-simulation python main.py ```