macOS Troubleshooting #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: macOS Troubleshooting | |
on: [workflow_dispatch] | |
jobs: | |
troubleshoot: | |
runs-on: macos-15-xlarge | |
strategy: | |
matrix: | |
xcode: [ 16.2, 16.1 ] | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: "${{ matrix.xcode }}" | |
- name: Debug | |
run: | | |
xcrun simctl list runtimes | |
xcrun simctl list devicetypes | |
- name: Start iOS Simulator | |
run: | | |
DEVICE_NAME="iPhone-16-Pro" | |
OS_VERSION=$(xcrun simctl list runtimes | grep -Eo 'com.apple.CoreSimulator.SimRuntime.iOS-18-[0-9]+' | tail -1) | |
UDID=$(xcrun simctl create "TestDevice" "com.apple.CoreSimulator.SimDeviceType.$DEVICE_NAME" "$OS_VERSION") | |
echo "Simulator UDID: $UDID" | |
echo "=== Booting Simulator ===" | |
start_time=$(date +%s) | |
xcrun simctl boot "$UDID" | |
end_time=$(date +%s) | |
mkdir -p logs | |
echo "Boot time: $((end_time - start_time)) seconds" | tee -a logs/performance.txt | |
- name: Check Simulator State | |
run: | | |
echo "=== Simulator Status ===" > logs/simulator_status.txt | |
xcrun simctl list devices | grep "TestDevice" >> logs/simulator_status.txt | |
- name: Take Screenshot | |
run: | | |
echo "=== Taking Screenshot ===" | |
start_time=$(date +%s) | |
xcrun simctl io booted screenshot logs/screenshot.png | |
end_time=$(date +%s) | |
echo "Screenshot time: $((end_time - start_time)) seconds" | tee -a logs/performance.txt | |
- name: Collect logs | |
if: always() | |
run: | | |
echo "=== Simulator Logs ===" > logs/simulator_logs.txt | |
xcrun simctl spawn booted log stream --style syslog --predicate 'subsystem == "com.apple.CoreSimulator"' -timeout 10 >> logs/simulator_logs.txt || echo "No simulator logs found" | |
- name: Upload logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ios-simulator-performance-logs-${{ matrix.xcode }} | |
path: logs/ |