Skip to content

Commit 4947517

Browse files
fix(ci): detect AltTester Desktop in /Applications, ~/Applications, and via mdfind
1 parent ebca703 commit 4947517

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

.github/workflows/ui-tests.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,29 @@ jobs:
149149
run: pip install -r sample-unity6/Tests/requirements-desktop.txt
150150
- name: Start AltTester Desktop (AltServer) headless on port 13000
151151
run: |
152-
ALT_APP="${ALTTESTER_DESKTOP_APP:-/Applications/AltTester Desktop.app}"
153-
if [ ! -d "$ALT_APP" ]; then
154-
echo "AltTester Desktop not found at $ALT_APP; install it so the app and driver can connect to port 13000."
155-
echo "See sample-unity6/Tests/README-ALTTESTER-MACOS.md"
152+
# Use env var if set; otherwise search common locations
153+
if [ -n "$ALTTESTER_DESKTOP_APP" ] && [ -d "$ALTTESTER_DESKTOP_APP" ]; then
154+
ALT_APP="$ALTTESTER_DESKTOP_APP"
155+
echo "Using ALTTESTER_DESKTOP_APP: $ALT_APP"
156+
else
157+
ALT_APP=""
158+
for candidate in "/Applications/AltTester Desktop.app" "$HOME/Applications/AltTester Desktop.app"; do
159+
if [ -d "$candidate" ]; then
160+
ALT_APP="$candidate"
161+
echo "Found AltTester Desktop at: $ALT_APP"
162+
break
163+
fi
164+
done
165+
if [ -z "$ALT_APP" ]; then
166+
echo "Searching system for AltTester Desktop (mdfind)..."
167+
ALT_APP=$(mdfind "kMDItemCFBundleIdentifier == 'com.alttester.desktop'" 2>/dev/null | grep -E '\.app$' | head -1)
168+
[ -z "$ALT_APP" ] && ALT_APP=$(mdfind "AltTester Desktop.app" 2>/dev/null | grep -E 'AltTester Desktop\.app$' | head -1)
169+
[ -n "$ALT_APP" ] && echo "Found via mdfind: $ALT_APP"
170+
fi
171+
fi
172+
if [ -z "$ALT_APP" ] || [ ! -d "$ALT_APP" ]; then
173+
echo "AltTester Desktop not found. Searched: /Applications, \$HOME/Applications, and mdfind."
174+
echo "Install it or set ALTTESTER_DESKTOP_APP to the .app path. See sample-unity6/Tests/README-ALTTESTER-MACOS.md"
156175
exit 1
157176
fi
158177
EXE="$ALT_APP/Contents/MacOS/AltTester Desktop"

0 commit comments

Comments
 (0)