@@ -264,10 +264,14 @@ jobs:
264264 }
265265 trap cleanup EXIT INT TERM
266266
267- # Try using WebDriverIO's built-in Appium service instead
268- # This might be more reliable than our custom Appium setup
269- echo "Using WebDriverIO's built-in Appium service..."
270- # Don't remove the appium service - let WebDriverIO handle it
267+ # Configure WebDriverIO to use our Appium server
268+ echo "Configuring WebDriverIO to use our Appium server..."
269+ # Update the hostname to use our Appium server
270+ sed -i '' 's/hostname: .*/hostname: "localhost"/' wdio.conf.ts
271+ sed -i '' 's/port: [0-9]*/port: 4723/' wdio.conf.ts
272+
273+ # Remove the appium service to prevent WebDriverIO from starting its own
274+ sed -i '' 's/services: \[.appium.\]/services: []/' wdio.conf.ts
271275
272276 # Increase timeout settings for better reliability
273277 sed -i '' 's/connectionRetryTimeout: [0-9]*/connectionRetryTimeout: 300000/' wdio.conf.ts
@@ -303,7 +307,11 @@ jobs:
303307
304308 # Test XCUITest driver directly
305309 echo "Testing XCUITest driver..."
306- xcrun simctl spawn "$SIMULATOR_UDID" xcrun simctl list devices | grep "$SIMULATOR_UDID"
310+ xcrun simctl list devices | grep "$SIMULATOR_UDID"
311+
312+ # Kill the manually launched app to let Appium handle it
313+ echo "Killing manually launched app..."
314+ xcrun simctl terminate "$SIMULATOR_UDID" to.bitkit-regtest || echo "App not running"
307315
308316 # Pass everything through to WDIO/Mocha
309317 npm run e2e:ios -- "$@"
0 commit comments