#!/bin/bash
#Find and boot device
if [ "$1" == "-b" ]
then
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/.
UDID=$(xcrun xctrace list devices \
| awk '/iPhone 11 Pro/ && !/Max/ {print $NF}' \
| tr -d '()')
xcrun simctl boot "${UDID:?No Simulator with this name found}"
fi
# Run Integration Tests
flutter drive --flavor dev --dart-define=TEST_MODE=true --target=test_driver/app.dart
then in my bitrise,yml
- script@1:
title: Find and boot device, run integration tests
inputs:
- content: bin/integration -b
Unfortunately, xctrace does not seem to be available. I get:
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/./usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/./Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find xctrace 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "xctrace", not a developer tool or in PATH
bin/integration: line 10: UDID: No Simulator with this name found
Is there another way to achieve what I want - booting an ios device, then running flutter driver integration tests against it? Or is there a way to get my current approach to work by getting access to xctrace somehow?