Skip to main content
This example demonstrates how to use the mobile-use SDK with Minitap Platform for centralized task orchestration and observability.

What This Example Does

1

Uses platform-configured tasks

Tasks are defined once on the platform, reused in code
2

Switches between profiles

Uses different LLM configurations for different task types
3

Demonstrates observability

All task runs are visible on the platform dashboard
4

Shows error handling

Proper exception handling for platform errors

Key Concepts

Platform Configuration

Tasks and profiles managed on web UI

Unified API Keys

Single API key for all LLM providers

Cloud Observability

View task runs, traces, and analytics online

Type Safety

Structured output with Pydantic models

App Lock

Restrict task execution to specific apps

Cloud Execution

Run tasks from UI on cloud devices

Prerequisites

Before running this example, complete the Platform Quickstart:
1

Create Account

2

Generate API Key

Create an API key from the API Keys page
3

Create LLM Profiles

Create β€œdefault” and β€œaccurate” profiles
4

Create Tasks

Create the following tasks:
  • email-summary - Check and summarize emails
  • schedule-meeting - Book a calendar meeting

Complete Code

platform_task_example.py

Code Breakdown

1. Define Output Structures

Even though tasks are configured on the platform, you can still define Pydantic models for type-safe results.

2. Verify API Key

Always check that the API key is configured before running tasks.

3. Use Different Profiles

4. Handle Platform Errors

Running the Example

1

Set up environment

2

Install SDK

3

Connect device

4

Run the script

5

View on platform

Visit platform.mobile-use.ai/task-runs to see execution details

Expected Output

Viewing on Platform

After running, visit the platform to see detailed execution:
  • All your task runs with status
  • Filter by task, status, date
  • Quick status overview

Platform Task Configuration

For this example to work, create these tasks on the platform:

Email Summary Task

Schedule Meeting Task

Running with Locked App Package

You can lock task execution to a specific app, ensuring the agent stays within that app:

On the Platform

When creating a task, specify the Locked App Package field:

Via SDK

Execute the platform task with its configured app lock:
PlatformTaskRequest does not support overriding locked_app_package via SDK. The app lock must be configured on the platform task itself.

Cloud Execution (No Code Required)

Instead of running tasks via SDK, you can execute directly from the platform UI:

How It Works

1

Open Tasks Page

2

Click Run

Click the Run button on any task card
3

Select Cloud Execution

Choose the Cloud Execution tab in the dialog
4

Configure

  1. Select an LLM Profile
  2. Select a Cloud Device (must be in Ready state)
5

Execute

Click Run Task - you’ll be redirected to the task run page

Local SDK vs Cloud Execution

Cloud Execution is ideal for non-technical team members or quick testing without local environment setup.

Customization Ideas

Create additional platform tasks:
  • check-notifications - Check notification panel
  • send-message - Send WhatsApp/SMS message
  • search-product - Find products on shopping apps
Different profiles for different needs:
  • fast - Quick tasks with cheaper models
  • accurate - Complex tasks with powerful models
  • cost-optimized - Balance of speed and cost

Benefits Demonstrated

Centralized Config

Change task prompts without code changes

Unified API Keys

One key for all LLM providers

Cloud Observability

View all runs in one dashboard

Profile Switching

Easy to switch between model configurations

Type Safety

Pydantic models ensure data integrity

Team Collaboration

Share tasks and profiles with team

Troubleshooting

Solution:
Solution:
Solution:

Next Steps

Platform Quickstart

Complete platform setup guide

Types Reference

PlatformTaskRequest type documentation

Local Examples

Compare with local approach

Dashboard

Open Minitap Platform