|
42 | 42 | echo "" |
43 | 43 | echo "System Architecture:" |
44 | 44 | uname -m |
45 | | - echo "" |
46 | | - echo "Available Simulators:" |
47 | | - xcrun simctl list devices available | head -20 |
48 | | - echo "" |
49 | | - echo "Disk Space:" |
50 | | - df -h |
51 | | - echo "" |
52 | | - echo "Memory:" |
53 | | - system_profiler SPHardwareDataType | grep "Memory:" |
54 | 45 |
|
55 | 46 | # - name: Setup Xcode |
56 | 47 | # uses: maxim-lobanov/setup-xcode@v1 |
@@ -114,22 +105,69 @@ jobs: |
114 | 105 | # Reset package caches |
115 | 106 | xcodebuild -resolvePackageDependencies -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit |
116 | 107 |
|
117 | | - - name: Fix CodeScanner asset catalog issue |
| 108 | + - name: Fix CoreSimulator asset catalog issue |
| 109 | + run: | |
| 110 | + # This is a CoreSimulator issue, not a CodeScanner issue |
| 111 | + # The AssetCatalogSimulatorAgent can't communicate with the simulator |
| 112 | + echo "=== Fixing CoreSimulator asset catalog issue ===" |
| 113 | + |
| 114 | + # Reset CoreSimulator services |
| 115 | + echo "Resetting CoreSimulator services..." |
| 116 | + sudo launchctl unload /System/Library/LaunchDaemons/com.apple.CoreSimulator.CoreSimulatorService.plist || true |
| 117 | + sudo launchctl load /System/Library/LaunchDaemons/com.apple.CoreSimulator.CoreSimulatorService.plist || true |
| 118 | + |
| 119 | + # Kill any existing simulator processes |
| 120 | + echo "Killing existing simulator processes..." |
| 121 | + pkill -f "Simulator" || true |
| 122 | + pkill -f "CoreSimulator" || true |
| 123 | + pkill -f "AssetCatalogSimulatorAgent" || true |
| 124 | + |
| 125 | + # Wait for processes to fully terminate |
| 126 | + sleep 5 |
| 127 | + |
| 128 | + # Reset simulator state |
| 129 | + echo "Resetting simulator state..." |
| 130 | + xcrun simctl shutdown all || true |
| 131 | + xcrun simctl erase all || true |
| 132 | + |
| 133 | + # Restart CoreSimulator daemon |
| 134 | + echo "Restarting CoreSimulator daemon..." |
| 135 | + sudo launchctl stop com.apple.CoreSimulator.CoreSimulatorService || true |
| 136 | + sleep 2 |
| 137 | + sudo launchctl start com.apple.CoreSimulator.CoreSimulatorService || true |
| 138 | + |
| 139 | + # Wait for services to be ready |
| 140 | + sleep 10 |
| 141 | + |
| 142 | + echo "CoreSimulator reset complete" |
| 143 | +
|
| 144 | + - name: Reboot iOS Simulator |
118 | 145 | run: | |
119 | | - # This is a known issue with CodeScanner on some Xcode versions |
120 | | - # Try to fix the asset catalog compilation issue |
121 | | - echo "Attempting to fix CodeScanner asset catalog issue..." |
| 146 | + echo "=== Rebooting iOS Simulator after CoreSimulator reset ===" |
122 | 147 | |
123 | | - # Find the CodeScanner package path |
124 | | - CODESCANNER_PATH=$(find DerivedData -name "CodeScanner" -type d | head -1) |
125 | | - if [ -n "$CODESCANNER_PATH" ]; then |
126 | | - echo "Found CodeScanner at: $CODESCANNER_PATH" |
127 | | - # Check if Assets.xcassets exists and is valid |
128 | | - if [ -d "$CODESCANNER_PATH/Sources/CodeScanner/Resources/Assets.xcassets" ]; then |
129 | | - echo "CodeScanner Assets.xcassets found, checking contents..." |
130 | | - ls -la "$CODESCANNER_PATH/Sources/CodeScanner/Resources/Assets.xcassets" |
| 148 | + # Boot the simulator again |
| 149 | + echo "Booting $SIMULATOR_NAME..." |
| 150 | + xcrun simctl boot "$SIMULATOR_NAME" || true |
| 151 | + |
| 152 | + # Wait for simulator to boot |
| 153 | + echo "Waiting for simulator to boot..." |
| 154 | + for i in {1..30}; do |
| 155 | + if xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep -q "Booted"; then |
| 156 | + echo "$SIMULATOR_NAME is booted!" |
| 157 | + break |
131 | 158 | fi |
132 | | - fi |
| 159 | + echo "Waiting for $SIMULATOR_NAME boot... ($i/30)" |
| 160 | + sleep 5 |
| 161 | + done |
| 162 | + |
| 163 | + # Additional wait for simulator to be fully ready |
| 164 | + sleep 15 |
| 165 | + |
| 166 | + # Launch simulator app to ensure it's visible |
| 167 | + open -a Simulator |
| 168 | + sleep 5 |
| 169 | + |
| 170 | + echo "Simulator reboot complete" |
133 | 171 |
|
134 | 172 | - name: Build iOS app |
135 | 173 | env: |
|
0 commit comments