-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·109 lines (92 loc) · 3.27 KB
/
setup.sh
File metadata and controls
executable file
·109 lines (92 loc) · 3.27 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
107
108
109
#!/bin/sh
#
# maestro-ios-device setup script
# Downloads the correct binary and runs setup
#
set -e
REPO="devicelab-dev/maestro-ios-device"
BINARY_NAME="maestro-ios-device"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ maestro-ios-device ║"
echo "║ ║"
echo "║ 🚀 We built maestro-runner from scratch — 3.6x faster, ║"
echo "║ real iOS device support, runs locally or on any Appium ║"
echo "║ cloud, true parallel execution, no paywall. ║"
echo "║ Fixes 78% of Maestro's top issues. Same YAML. ║"
echo "║ ║"
echo "║ https://github.com/devicelab-dev/maestro-runner ║"
echo "║ ║"
echo "║ Built by DeviceLab — https://devicelab.dev ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "This will:"
echo " 1. Download maestro-ios-device binary"
echo " 2. Download and extract patched JARs to ~/.maestro/lib"
echo " 3. Download and extract iOS runner to ~/.maestro/maestro-ios-xctest-runner"
echo ""
printf "Continue with installation? [y/N] "
read -r REPLY </dev/tty
if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
echo "Installation cancelled."
exit 1
fi
echo ""
# Check OS
OS=$(uname -s)
if [ "$OS" != "Darwin" ]; then
printf "${RED}Error: Only macOS is supported${NC}\n"
exit 1
fi
# Check architecture
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH="amd64"
;;
arm64)
ARCH="arm64"
;;
*)
printf "${RED}Error: Unsupported architecture: $ARCH${NC}\n"
exit 1
;;
esac
BINARY="maestro-ios-device-darwin-${ARCH}"
DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${BINARY}"
echo "Detected: macOS ${ARCH}"
echo ""
# Find where maestro is installed
MAESTRO_PATH=$(which maestro 2>/dev/null || true)
if [ -z "$MAESTRO_PATH" ]; then
printf "${RED}Error: Maestro not found in PATH. Install Maestro first: https://maestro.mobile.dev${NC}\n"
exit 1
fi
INSTALL_DIR=$(dirname "$MAESTRO_PATH")
echo "Found Maestro at: $INSTALL_DIR"
echo ""
# Download binary
echo "📥 Downloading ${BINARY}..."
TMP_FILE=$(mktemp)
if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_FILE"; then
printf "${RED}Error: Failed to download binary${NC}\n"
echo "URL: $DOWNLOAD_URL"
rm -f "$TMP_FILE"
exit 1
fi
# Install binary
echo "📦 Installing to $INSTALL_DIR/$BINARY_NAME..."
mv "$TMP_FILE" "$INSTALL_DIR/$BINARY_NAME"
chmod +x "$INSTALL_DIR/$BINARY_NAME"
printf "${GREEN}✅ Binary installed${NC}\n"
echo ""
# Run setup command
echo "🔧 Running maestro-ios-device setup..."
echo ""
"$INSTALL_DIR/$BINARY_NAME" setup
echo ""
printf "${GREEN}✅ Installation complete!${NC}\n"