[Web Driver Agent] Issues with WDA startup time

Hello, I am currently setting up the Appium IOS tests run on the CircleCI MacOS environment
All tests are successfully running - when I started looking into test parallelization

Used the appium-device-farm plugin for this and set up the tests run with 3 threads - currently everything running pretty well except for one thing - the WDA startup time is pretty long

Currently, at the beginning of tests, it is built via Xcode for 3 simulators I have booted separately
for this, I use “appium:useNewWda, true” capability, after that when the 4-th test started execution changed “appium:useNewWda” to false and set “appium:usePrebuildWDA” to true dynamically, and generally everything is working pretty fast after first three tests

However, the initial tests take quite a long time since the WDA is building for each of the simulators, which you can see at the timeline

here is what appium logs saying

I am having
debug] e[38;5;48m[XCUITestDriver@a047 (57fa5d53)]e[0m Proxying [GET /status] to [GET http://127.0.0.1:50152/status] with no body
[38;5;48m[XCUITestDriver@a047 (57fa5d53)]e[0m connect ECONNREFUSED 127.0.0.1:50152

for a very long time until the WDA is installed and running

Here is the part of circleCI.yml:

      - run:
          name: Appium Install
          command: |
            npm install -g appium@next && appium driver install xcuitest && appium plugin install --source=npm appium-device-farm
      - macos/preboot-simulator:
          version: "16.2"
          platform: "iOS"
          device: "iPhone 14 Pro Max"
      - macos/preboot-simulator:
          version: "16.2"
          platform: "iOS"
          device: "iPhone 14 Pro"
      - macos/preboot-simulator:
          version: "16.2"
          platform: "iOS"
          device: "iPhone 14 Plus"
      - run:
          name: Start Appium Server
          command: |
            appium server -ka 800 --use-plugins=device-farm -pa /wd/hub
          background: true
      - run:
          name: "Run Cucumber IOS Tests"
          command: |
            sudo mvn clean test (--env-vars...)

And my Caps:

        DesiredCapabilities capabilities = CAP.get();
        if (isTestNumberLessThanThreadCount()) {
            capabilities.setCapability("appium:useNewWda", false);
            capabilities.setCapability("appium:usePrebuildWDA", true);
        } else {
            capabilities.setCapability("appium:usePrebuildWDA", true);
            capabilities.setCapability("appium:useNewWda", false);
        }

        capabilities.setCapability("appium:app", "app.zip");
        capabilities.setCapability("appium:deviceOrientation", "portrait");
        capabilities.setCapability("appium:connectHardwareKeyboard", true);
        capabilities.setCapability("appium:forceSimulatorSoftwareKeyboardPresence", false);
        capabilities.setCapability("appium:interKeyDelay", "100");
        capabilities.setCapability("appium:sendKeyStrategy", "setValue");
        capabilities.setCapability("appium:settings[waitForQuiescence]", false);
        capabilities.setCapability("appium:isHeadless", true);
        capabilities.setCapability("appium:bundleId", "bundle");
        capabilities.setCapability("appium:settings[reduceMotion]", true);
        capabilities.setCapability("appium:autoFillPasswords", false);
        capabilities.setCapability("appium:maxTypingFrequency", "20");
        capabilities.setCapability("appium:settings[animationCoolOffTimeout]", 0);
        capabilities.setCapability("appium:noReset", true);
        capabilities.setCapability("appium:shouldTerminateApp", true);
        capabilities.setCapability("appium:settings[customSnapshotTimeout]", 2);
        capabilities.setCapability("appium:settings[pageSourceExcludedAttributes]", "visible,enabled,accessible,x,y,width,height,index");
        log.info("Capabilities: " + new JSONObject(capabilities.toJson()).toString(identFactor));
        Allure.addAttachment("Capabilities", capabilities.toString());
        return capabilities;

Thank you in advance for any suggestions

You can follow https://github.com/appium/java-client/blob/4623e1138ca19c388ac2f636a30a4320c00b7fb5/.github/workflows/gradle.yml#L99 to prepare your iOS Simulator environment. Make sure WDA source is only complied once by a single process. The reason for that is that xcodebuild always tries to use as much CPU cores as possible for a single compilation job. Trying to compile more than one project in parallel would only create more concurrency issues and slow down all running jobs.

As I see from the logs of java-client last build - build(deps): Bump actions/setup-java from 3 to 4 (#2081) · appium/java-client@5cd439a · GitHub

There is exactly the same thing happened -

appium driver run xcuitest build-wda

command build the WDA for the firstly selected simulator (iPhone 8) in this case

info iOSSim Constructing iOS simulator for Xcode version 14.2 with udid 'F55B010D-0DF2-43EE-B39D-C8BD58D020FF'
[16](https://github.com/appium/java-client/actions/runs/7086392810/job/19284567350#step:11:17)[12:15:46] Building WDA for iPhone 8 16.2 Simulator...

When later in the next steps the iPhone 12 is being prepared during the E2E run it still builds the WDA separately for this iPhone 12:

[XCUITestDriver@1805 (921ee00f)] Starting WebDriverAgent initialization with the synchronization key ‘XCUITestDriver’

114 [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

115 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

116 [WD Proxy] connect ECONNREFUSED 127.0.0.1:8100

117 [XCUITestDriver@1805 (921ee00f)] WDA is not listening at ‘http://127.0.0.1:8100/

118 [XCUITestDriver@1805 (921ee00f)] WDA is currently not running. There is nothing to cache

119 [XCUITestDriver@1805 (921ee00f)] Trying to start WebDriverAgent 2 times with 10000ms interval

120 [XCUITestDriver@1805 (921ee00f)] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities

121 [XCUITestDriver@1805 (921ee00f)] Event ‘wdaStartAttempted’ logged at 1701692549269 (12:22:29 GMT+0000 (Coordinated Universal Time))

122 [XCUITestDriver@1805 (921ee00f)] Launching WebDriverAgent on the device

123 [XCUITestDriver@1805 (921ee00f)] There is no need to perform the project cleanup. A fresh install has been detected

124 [WebDriverAgent] Killing running processes ‘xcodebuild.*A02193D4-2839-41BE-91E3-8DA6B9151965, A02193D4-2839-41BE-91E3-8DA6B9151965.*XCTRunner, xctest.*A02193D4-2839-41BE-91E3-8DA6B9151965’ for the device A02193D4-2839-41BE-91E3-8DA6B9151965…

125 [WebDriverAgent] ‘pgrep -if xcodebuild.*A02193D4-2839-41BE-91E3-8DA6B9151965’ didn’t detect any matching processes. Return code: 1

126 [WebDriverAgent] ‘pgrep -if xctest.*A02193D4-2839-41BE-91E3-8DA6B9151965’ didn’t detect any matching processes. Return code: 1

127 [WebDriverAgent] ‘pgrep -if A02193D4-2839-41BE-91E3-8DA6B9151965.*XCTRunner’ didn’t detect any matching processes. Return code: 1

128 [XCUITestDriver@1805 (921ee00f)] Beginning test with command ‘xcodebuild build-for-testing test-without-building -project /Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=A02193D4-2839-41BE-91E3-8DA6B9151965 IPHONEOS_DEPLOYMENT_TARGET=16.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO’ in directory ‘/Users/runner/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent’

129 [XCUITestDriver@1805 (921ee00f)] Output from xcodebuild will only be logged if any errors are present there. To change this, use ‘showXcodeLog’ desired capability

130 [XCUITestDriver@1805 (921ee00f)] Waiting up to 240000ms for WebDriverAgent to start

131 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

132 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

133 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

134 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

135 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

136 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

137 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

138 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

139 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

140 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

141 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

142 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

143 [XCUITestDriver@1805 (921ee00f)] Parsed BUILD_DIR configuration value: ‘/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent-dtmoeonrefnxsncuficthanbldlc/Build/Products’

144 [XCUITestDriver@1805 (921ee00f)] Got derived data root: ‘/Users/runner/Library/Developer/Xcode/DerivedData/WebDriverAgent-dtmoeonrefnxsncuficthanbldlc’

145 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

146 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

147 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

148 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

149 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

150 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

151 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

152 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

153 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

154 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

155 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

156 [XCUITestDriver@1805 (921ee00f)] connect ECONNREFUSED 127.0.0.1:8100

157 [XCUITestDriver@1805 (921ee00f)] Matched ‘/status’ to command name ‘getStatus’

158 [XCUITestDriver@1805 (921ee00f)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body

It seems to me that the prebuild-driver step is totally unnecessary in this case, because the WDA build still takes place during e2e test’s actual run

I am gonna try the following:

  - run:
      name: Prebuild driver
      command: |
        UDID=$(xcrun simctl list devices available | grep "$iPhone 14 Pro Max (" | cut -d "(" -f2 | cut -d ")" -f1)
        xcodebuild build-for-testing -project /Users/distiller/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner  -derivedDataPath /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData -destination id=$UDID IPHONEOS_DEPLOYMENT_TARGET=16.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO

and use those caps from Run Prebuilt WebDriverAgentRunner - Appium XCUITest Driver

capabilities.setCapability(“appium:useXctestrunFile”, true);
capabilities.setCapability(“appium:bootstrapPath”, “/Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData/Build/Products”);

Yes, with that approach it is working as expected now.

[debug] e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m WDA is not listening at ‘http://127.0.0.1:50356/
[debug] e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m WDA is currently not running. There is nothing to cache
[debug] e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m Trying to start WebDriverAgent 4 times with 20000ms interval
[debug] e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m Event ‘wdaStartAttempted’ logged at 1706873315640 (11:28:35 GMT+0000 (Greenwich Mean Time))
e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m Launching WebDriverAgent on the device
e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m Skipped WDA project cleanup according to the provided capabilities
[debug] e[38;5;192m[WebDriverAgent]e[0m Killing running processes ‘xcodebuild.*309CE2B6-45C8-4FE5-9B43-87A0A93C72E1, 309CE2B6-45C8-4FE5-9B43-87A0A93C72E1.*XCTRunner, xctest.*309CE2B6-45C8-4FE5-9B43-87A0A93C72E1’ for the device 309CE2B6-45C8-4FE5-9B43-87A0A93C72E1…
[debug] e[38;5;192m[WebDriverAgent]e[0m ‘pgrep -if xcodebuild.*309CE2B6-45C8-4FE5-9B43-87A0A93C72E1’ didn’t detect any matching processes. Return code: 1
[debug] e[38;5;192m[WebDriverAgent]e[0m ‘pgrep -if 309CE2B6-45C8-4FE5-9B43-87A0A93C72E1.*XCTRunner’ didn’t detect any matching processes. Return code: 1
[debug] e[38;5;192m[WebDriverAgent]e[0m ‘pgrep -if xctest.*309CE2B6-45C8-4FE5-9B43-87A0A93C72E1’ didn’t detect any matching processes. Return code: 1
e[38;5;192m[WebDriverAgent]e[0m Using ‘/Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData/Build/Products/309CE2B6-45C8-4FE5-9B43-87A0A93C72E1_16.2.xctestrun’ as xctestrun file copied by ‘/Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData/Build/Products/WebDriverAgentRunner_iphonesimulator16.2-x86_64.xctestrun’
[debug] e[38;5;48m[XCUITestDriver@7a5f (8deae3c0)]e[0m Beginning test with command ‘xcodebuild test-without-building -xctestrun /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData/Build/Products/309CE2B6-45C8-4FE5-9B43-87A0A93C72E1_16.2.xctestrun -destination id=309CE2B6-45C8-4FE5-9B43-87A0A93C72E1 IPHONEOS_DEPLOYMENT_TARGET=16.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO’ in directory ‘/Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData/Build/Products’

it skips xcodebuild build-for-testing and proceeds with xcodebuild test-without-building immediately

@mykola-mokhnach

I have a new problem, you see the CircleCI will abandon intel resources in the near future so it is necessary to make the run happen for me on the m1 chip: here is what I’ve got after a successful WDA start-up, it is strange because on my local machine, there is also M1 - and when I launch the tests using the same algorithm it works okay

[XCUITestDriver@8cd6 (9f3bc213)] WebDriverAgent successfully started after 104420ms
[XCUITestDriver@8cd6 (9f3bc213)] Event ‘wdaSessionAttempted’ logged at 1706888795284 (15:46:35 GMT+0000 (Greenwich Mean Time))
[XCUITestDriver@8cd6 (9f3bc213)] Sending createSession command to WDA
[XCUITestDriver@8cd6 (9f3bc213)] Matched ‘/session’ to command name ‘createSession’
[XCUITestDriver@8cd6 (9f3bc213)] Proxying [POST /session] to [POST http://127.0.0.1:52752/session] with body: {“capabilities”:{“firstMatch”:[{“bundleId”:“app.bundle”,“arguments”:,“environment”:{},“eventloopIdleDelaySec”:0,“shouldWaitForQuiescence”:true,“shouldUseTestManagerForVisibilityDetection”:false,“maxTypingFrequency”:20,“shouldUseSingletonTestManager”:true,“shouldTerminateApp”:true,“forceAppLaunch”:false,“useNativeCachingStrategy”:true,“forceSimulatorSoftwareKeyboardPresence”:false,“defaultAlertAction”:“accept”}],“alwaysMatch”:{}}}
[Xcode] 2024-02-02 15:46:34.817892+0000 WebDriverAgentRunner-Runner[16507:50219] Using singleton test manager
[Xcode]
[Xcode] t = 1.21s Open app.bundle
[Xcode] t = 1.21s Launch app.bundle
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 146642 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 146618 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 146530 ms
[device-farm-main] No pending sessions to clean
[Xcode] 2024-02-02 15:47:17.521234+0000 WebDriverAgentRunner-Runner[16441:49100] Issue type: 0
[Xcode] 2024-02-02 15:47:17.521374+0000 WebDriverAgentRunner-Runner[16441:49100] Enqueue Failure: Application ‘app.bundle’ does not have a process ID ((null)) (null) 0 0
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 176652 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 176628 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 176540 ms
[device-farm-main] No pending sessions to clean
[Xcode] 2024-02-02 15:47:27.091511+0000 WebDriverAgentRunner-Runner[16474:49640] Issue type: 0
[Xcode] 2024-02-02 15:47:27.091640+0000 WebDriverAgentRunner-Runner[16474:49640] Enqueue Failure: Application ‘app.bundle’ does not have a process ID ((null)) (null) 0 0
[Xcode]
[Xcode] 2024-02-02 15:47:35.443471+0000 WebDriverAgentRunner-Runner[16507:50219] Issue type: 0
[Xcode] 2024-02-02 15:47:35.443655+0000 WebDriverAgentRunner-Runner[16507:50219] Enqueue Failure: Application ‘app.bundle’ does not have a process ID ((null)) (null) 0 0
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 206685 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 206661 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 206573 ms
[device-farm-main] No pending sessions to clean
[Xcode] 2024-02-02 15:48:17.526208+0000 WebDriverAgentRunner-Runner[16441:49100] Issue type: 0
[Xcode] 2024-02-02 15:48:17.526395+0000 WebDriverAgentRunner-Runner[16441:49100] Enqueue Failure: Failed to activate application ‘app.bundle’ (current state: Not Running) ((null)) (null) 0 0
[Xcode]
[Xcode] t = 121.32s Wait for accessibility to load
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 236684 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 236660 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 236572 ms
[device-farm-main] No pending sessions to clean
[Xcode] 2024-02-02 15:48:27.097528+0000 WebDriverAgentRunner-Runner[16474:49640] Issue type: 0
[Xcode] 2024-02-02 15:48:27.098467+0000 WebDriverAgentRunner-Runner[16474:49640] Enqueue Failure: Failed to activate application ‘app.bundle’ (current state: Not Running) ((null)) (null) 0 0
[Xcode] t = 121.24s Wait for accessibility to load
[Xcode]
[Xcode] 2024-02-02 15:48:35.455761+0000 WebDriverAgentRunner-Runner[16507:50219] Issue type: 0
[Xcode]
[Xcode] 2024-02-02 15:48:35.455934+0000 WebDriverAgentRunner-Runner[16507:50219] Enqueue Failure: Failed to activate application ‘app.bundle’ (current state: Not Running) ((null)) (null) 0 0
[Xcode] t = 121.31s Wait for accessibility to load
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 266685 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 266661 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 266573 ms
[device-farm-main] No pending sessions to clean
[Xcode] t = 181.33s Capturing diagnostic spindump
[Xcode]
[Xcode] 2024-02-02 15:49:17.543268+0000 WebDriverAgentRunner-Runner[16441:49100] Issue type: 0
[Xcode] 2024-02-02 15:49:17.543442+0000 WebDriverAgentRunner-Runner[16441:49100] Enqueue Failure: Application ‘app.bundle’ has not loaded accessibility ((null)) (null) 0 0
[Xcode] t = 181.34s Setting up automation session
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 296688 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 296664 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 296576 ms
[device-farm-main] No pending sessions to clean
[Xcode] t = 181.24s Capturing diagnostic spindump
[Xcode] 2024-02-02 15:49:27.103866+0000 WebDriverAgentRunner-Runner[16474:49640] Issue type: 0
[Xcode] 2024-02-02 15:49:27.104054+0000 WebDriverAgentRunner-Runner[16474:49640] Enqueue Failure: Application ‘app.bundle’ has not loaded accessibility ((null)) (null) 0 0
[Xcode] t = 181.24s Setting up automation session
[Xcode]
[Xcode] t = 181.32s Capturing diagnostic spindump
[Xcode]
[Xcode] 2024-02-02 15:49:35.463379+0000 WebDriverAgentRunner-Runner[16507:50219] Issue type: 0
[Xcode] 2024-02-02 15:49:35.463519+0000 WebDriverAgentRunner-Runner[16507:50219] Enqueue Failure: Application ‘app.bundle’ has not loaded accessibility ((null)) (null) 0 0
[Xcode] t = 181.32s Setting up automation session
[Xcode]
[device-farm-main] Found 0 device candidates to be released
[device-farm-main] Cleaning pending sessions…
[device-farm-main] Session queue ID:5616f479-ce2d-4752-9892-d612b09315b8 has been pending for 326693 ms
[device-farm-main] Session queue ID:ad309805-296b-47b5-b478-58ba88a150fe has been pending for 326669 ms
[device-farm-main] Session queue ID:aa49092b-be8d-4ae2-84dd-4b7e8be92f75 has been pending for 326581 ms
[device-farm-main] Found 3 pending sessions to clean
[device-farm-main] Removing pending session 5616f479-ce2d-4752-9892-d612b09315b8 because it has timed out
[device-farm-main] Removing pending session ad309805-296b-47b5-b478-58ba88a150fe because it has timed out
[device-farm-main] Removing pending session aa49092b-be8d-4ae2-84dd-4b7e8be92f75 because it has timed out
[XCUITestDriver@cee3 (ce425b31)] AxiosError: timeout of 240000ms exceeded
[XCUITestDriver@cee3 (ce425b31)] at RedirectableRequest.handleRequestTimeout (/Users/distiller/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/http.js:643:16)
[XCUITestDriver@cee3 (ce425b31)] at RedirectableRequest.emit (node:events:513:28)
[XCUITestDriver@cee3 (ce425b31)] at Timeout. (/Users/distiller/.appium/node_modules/appium-xcuitest-driver/node_modules/follow-redirects/index.js:210:12)
[XCUITestDriver@cee3 (ce425b31)] at listOnTimeout (node:internal/timers:569:17)
[XCUITestDriver@cee3 (ce425b31)] at processTimers (node:internal/timers:512:7)
[XCUITestDriver@cee3 (ce425b31)] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded). Retrying…
[Xcode] 2024-02-02 15:50:17.552731+0000 WebDriverAgentRunner-Runner[16441:49100] Issue type: 0
[Xcode] 2024-02-02 15:50:17.552841+0000 WebDriverAgentRunner-Runner[16441:49100] Enqueue Failure: Failed to get automation session for app.bundle:0: Timed out while requesting automation session for app.bundle (pid:0). ((null)) (null) 0 0

I believe you need to compile different simulator builds for m1 or intel architectures

1 Like

@mykola-mokhnach you are 100% right, I didn’t realize that my app was built for x86_64 :disappointed_relieved:
Thanks for the advice, I would definitely spend a few more days on it without you

@Arsen_Domanych @mykola-mokhnach I am trying to run ios tests on CircleCI. Do I need to mention “appium driver run xcuitest build-wda” in the config.yml?

@Mallik_Vennapusa I am not sure if, did not use the command you provided if this command successfully built wda when probably yes otherwise just prebuild it via xcode before you start appium server and trigger the tests

 - run:
      name: Prebuild driver
      command: |
        UDID=$(xcrun simctl list devices available | grep "$iPhone 14 Pro Max (" | cut -d "(" -f2 | cut -d ")" -f1)
        xcodebuild build-for-testing -project /Users/distiller/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner  -derivedDataPath /Users/distiller/Library/Developer/Xcode/DerivedData/WebDriverAgentData -destination id=$UDID IPHONEOS_DEPLOYMENT_TARGET=16.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO

@Arsen_Domanych Thanks for your reply. I realised that the error is related to session creation. I posted it here. Can you please check that if you can help me :slight_smile: