-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
106 lines (94 loc) · 2.79 KB
/
setup.sh
File metadata and controls
106 lines (94 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
# Setup script for Mobile-Agent-v3 Virtual Runner
echo "=========================================="
echo "Mobile-Agent-v3 Virtual Runner Setup"
echo "=========================================="
echo ""
# Check Python version
echo "Checking Python version..."
python_version=$(python3 --version 2>&1 | grep -oP '\d+\.\d+' | head -1)
required_version="3.11"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then
echo "❌ Error: Python 3.11+ required (found $python_version)"
exit 1
fi
echo "✓ Python $python_version found"
echo ""
# Create virtual environment
echo "Creating virtual environment..."
if [ ! -d "venv" ]; then
python3 -m venv venv
echo "✓ Virtual environment created"
else
echo "✓ Virtual environment already exists"
fi
echo ""
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
echo "✓ Virtual environment activated"
echo ""
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip > /dev/null 2>&1
echo "✓ pip upgraded"
echo ""
# Install dependencies
echo "Installing dependencies..."
echo "This may take a few minutes..."
pip install -r requirements.txt
if [ $? -eq 0 ]; then
echo "✓ Dependencies installed"
else
echo "❌ Error installing dependencies"
exit 1
fi
echo ""
# Create output directories
echo "Creating output directories..."
mkdir -p logs trajectories outputs results
echo "✓ Directories created"
echo ""
# Copy environment template
if [ ! -f ".env" ]; then
echo "Creating .env file from template..."
cp .env.example .env
echo "✓ .env file created"
echo ""
echo "⚠️ IMPORTANT: Please edit .env and add your API keys:"
echo " - GEMINI_API_KEY (required)"
echo " - AGENT_MODEL (required)"
echo ""
else
echo "✓ .env file already exists"
echo ""
fi
# Make scripts executable
echo "Setting execute permissions..."
chmod +x run_virtual.sh
chmod +x examples/quick_start.sh
echo "✓ Permissions set"
echo ""
# Check if start_Android.png exists
if [ ! -f "start_Android.png" ]; then
echo "⚠️ Warning: start_Android.png not found"
echo " This file is needed as the initial virtual screen"
echo " Please add an Android home screen screenshot"
echo ""
fi
echo "=========================================="
echo "✓ Setup Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo " 1. Edit .env and add your API keys"
echo " 2. Ensure start_Android.png exists (initial screen)"
echo " 3. Run: source venv/bin/activate"
echo " 4. Run: ./run_virtual.sh"
echo ""
echo "For quick start examples:"
echo " ./examples/quick_start.sh"
echo ""
echo "For help:"
echo " python run_virtual.py --help"
echo "=========================================="