Enabling DarkMode on iOS/Android

Hello,

Any ideas on how I could easily set the device to DarkMode on iOS and android before my tests run? I’m using Appium 1.17.1 and Python 3.8.

Thanks!

On iOS there is mobile: setAppearance helper.
On Android Q+ this is possible via mobile: shell (requires device reboot). See https://www.xda-developers.com/android-q-toggle-dark-theme/

I get selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: this[commandMap[mobileCommand]] is not a function
when I’m using self.driver.execute_script(“mobile: setAppearance”, {‘style’: ‘dark’}) on iOS sim.

Should I add something extra? Because I can’t find any info in the doc or online.

simply add the full server log

The server is running
[Appium] Welcome to Appium v1.17.1
[Appium] Non-default server args:
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“capabilities”:{“firstMatch”:[{“platformName”:“iOS”,“appium:deviceName”:“iPhone”,“appium:app”:"/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app",“appium:automationName”:“XCUITest”,“appium:platformVersion”:“13.6”,“appium:udid”:“2A062B91-094E-484E-BDAF-00D2EA45C094”,“appium:fullReset”:true,“appium:bundleId”:“com.avira.MobileEssentials”,“appium:xcodeOrgId”:“7HU9JMY9XG”,“appium:xcodeSigningId”:“iPhone Developer”,“appium:sendKeyStrategy”:“oneByOne”}]},“desiredCapabilities”:{“platformName”:“iOS”,“deviceName”:“iPhone”,“app”:"/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app",“automationName”:“XCUITest”,“platformVersion”:“13.6”,“udid”:“2A062B91-094E-484E-BDAF-00D2EA45C094”,“fullReset”:true,“bundleId”:“com.avira.MobileEssentials”,“xcodeOrgId”:“7HU9JMY9XG”,“xcodeSigningId”:“iPhone Developer”,“sendKeyStrategy”:“oneByOne”}}
[W3C] Calling AppiumDriver.createSession() with args: [{“platformName”:“iOS”,“deviceName”:“iPhone”,“app”:"/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app",“automationName”:“XCUITest”,“platformVersion”:“13.6”,“udid”:“2A062B91-094E-484E-BDAF-00D2EA45C094”,“fullReset”:true,“bundleId”:“com.avira.MobileEssentials”,“xcodeOrgId”:“7HU9JMY9XG”,“xcodeSigningId”:“iPhone Developer”,“sendKeyStrategy”:“oneByOne”},null,{“firstMatch”:[{“platformName”:“iOS”,“appium:deviceName”:“iPhone”,“appium:app”:"/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app",“appium:automationName”:“XCUITest”,“appium:platformVersion”:“13.6”,“appium:udid”:“2A062B91-094E-484E-BDAF-00D2EA45C094”,“appium:fullReset”:true,“appium:bundleId”:“com.avira.MobileEssentials”,“appium:xcodeOrgId”:“7HU9JMY9XG”,“appium:xcodeSigningId”:“iPhone Developer”,“appium:sendKeyStrategy”:“oneByOne”}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1595938987874 (15:23:07 GMT+0300 (Eastern European Summer Time))
[Appium] Appium v1.17.1 creating new XCUITestDriver (v3.22.0) session
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “platformName”: “iOS”,
[BaseDriver] “appium:deviceName”: “iPhone”,
[BaseDriver] “appium:app”: “/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app”,
[BaseDriver] “appium:automationName”: “XCUITest”,
[BaseDriver] “appium:platformVersion”: “13.6”,
[BaseDriver] “appium:udid”: “2A062B91-094E-484E-BDAF-00D2EA45C094”,
[BaseDriver] “appium:fullReset”: true,
[BaseDriver] “appium:bundleId”: “com.avira.MobileEssentials”,
[BaseDriver] “appium:xcodeOrgId”: “7HU9JMY9XG”,
[BaseDriver] “appium:xcodeSigningId”: “iPhone Developer”,
[BaseDriver] “appium:sendKeyStrategy”: “oneByOne”
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] Session created with session id: 4bd90c83-ab5c-436d-a053-e406e98fd2ba
[XCUITest] Current user: ‘alexandru.dumitru’
[XCUITest] Available devices:
[XCUITest] No real device with udid ‘2A062B91-094E-484E-BDAF-00D2EA45C094’. Looking for simulator
[iOSSim] Constructing iOS simulator for Xcode version 11.6 with udid ‘2A062B91-094E-484E-BDAF-00D2EA45C094’
[XCUITest] Determining device to run tests on: udid: ‘2A062B91-094E-484E-BDAF-00D2EA45C094’, real device: false
[BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1595938989171 (15:23:09 GMT+0300 (Eastern European Summer Time))
[BaseDriver] Using local app ‘/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app’
[BaseDriver] Event ‘appConfigured’ logged at 1595938989172 (15:23:09 GMT+0300 (Eastern European Summer Time))
[XCUITest] Checking whether app ‘/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app’ is actually present on file system
[XCUITest] App is present
[BaseDriver] Event ‘resetStarted’ logged at 1595938989173 (15:23:09 GMT+0300 (Eastern European Summer Time))
[XCUITest] Reset: fullReset is on. Cleaning simulator
[WebDriverAgent] Killing running processes ‘xcodebuild.*2A062B91-094E-484E-BDAF-00D2EA45C094, 2A062B91-094E-484E-BDAF-00D2EA45C094.*XCTRunner, xctest.*2A062B91-094E-484E-BDAF-00D2EA45C094’ for the device 2A062B91-094E-484E-BDAF-00D2EA45C094…
[WebDriverAgent] ‘pgrep -if 2A062B91-094E-484E-BDAF-00D2EA45C094.*XCTRunner’ didn’t detect any matching processes. Return code: 1
[WebDriverAgent] ‘pgrep -if xctest.*2A062B91-094E-484E-BDAF-00D2EA45C094’ didn’t detect any matching processes. Return code: 1
[iOSSim] Cleaning simulator 2A062B91-094E-484E-BDAF-00D2EA45C094
[BaseDriver] Event ‘resetComplete’ logged at 1595938995848 (15:23:15 GMT+0300 (Eastern European Summer Time))
[XCUITest] Continuing without capturing device logs: iOS Simulator with udid ‘2A062B91-094E-484E-BDAF-00D2EA45C094’ is not running
[XCUITest] Setting up simulator
[iOS] No reason to set locale
[iOS] No iOS / app preferences to set
[iOS] Setting did not need to be updated
[iOSSim] Setting preferences of 2A062B91-094E-484E-BDAF-00D2EA45C094 Simulator to {“ConnectHardwareKeyboard”:false}
[iOSSim] Setting common Simulator preferences to {“RotateWindowWhenSignaledByGuest”:true,“ConnectHardwareKeyboard”:false}
[iOSSim] Updated 2A062B91-094E-484E-BDAF-00D2EA45C094 Simulator preferences at ‘/Users/alexandru.dumitru/Library/Preferences/com.apple.iphonesimulator.plist’ with {“DevicePreferences”:{“2A062B91-094E-484E-BDAF-00D2EA45C094”:{“ConnectHardwareKeyboard”:false}},“RotateWindowWhenSignaledByGuest”:true,“ConnectHardwareKeyboard”:false}
[iOSSim] Got Simulator UI client PID: 28613
[iOSSim] Booting Simulator with UDID ‘2A062B91-094E-484E-BDAF-00D2EA45C094’…
[iOSSim] Simulator with UDID 2A062B91-094E-484E-BDAF-00D2EA45C094 booted in 23.562s
[BaseDriver] Event ‘simStarted’ logged at 1595939019521 (15:23:39 GMT+0300 (Eastern European Summer Time))
[IOSSimulatorLog] Starting log capture for iOS Simulator with udid ‘2A062B91-094E-484E-BDAF-00D2EA45C094’ using simctl
[BaseDriver] Event ‘logCaptureStarted’ logged at 1595939019811 (15:23:39 GMT+0300 (Eastern European Summer Time))
[XCUITest] Verifying application platform
[XCUITest] CFBundleSupportedPlatforms: [“iPhoneSimulator”]
[simctl] simctl error running ‘get_app_container’: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
[simctl] The operation couldn’t be completed. No such file or directory
[simctl] No such file or directory
[XCUITest] Installing ‘/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app’ on Simulator with UUID ‘2A062B91-094E-484E-BDAF-00D2EA45C094’…
[XCUITest] The app has been installed successfully.
[BaseDriver] Event ‘appInstalled’ logged at 1595939022525 (15:23:42 GMT+0300 (Eastern European Summer Time))
[WebDriverAgent] Using WDA path: ‘/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent’
[WebDriverAgent] Using WDA agent: ‘/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj’
[WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device 2A062B91-094E-484E-BDAF-00D2EA45C094 on local port 8100, device port 8100
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 2A062B91-094E-484E-BDAF-00D2EA45C094:8100
[WebDriverAgent] Parsed BUILD_DIR configuration value: ‘/Users/alexandru.dumitru/Library/Developer/Xcode/DerivedData/WebDriverAgent-eohhzogvvxexpkdvacohcghlkgni/Build/Products’
[WebDriverAgent] Got derived data root: ‘/Users/alexandru.dumitru/Library/Developer/Xcode/DerivedData/WebDriverAgent-eohhzogvvxexpkdvacohcghlkgni’
[XCUITest] Starting WebDriverAgent initialization with the synchronization key ‘/Users/alexandru.dumitru/Library/Developer/Xcode/DerivedData/WebDriverAgent-eohhzogvvxexpkdvacohcghlkgni’
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WebDriverAgent] WDA is not listening at ‘http://127.0.0.1:8100/
[WebDriverAgent] WDA is currently not running. There is nothing to cache
[XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event ‘wdaStartAttempted’ logged at 1595939026780 (15:23:46 GMT+0300 (Eastern European Summer Time))
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] Fetching dependencies
[WebDriverAgent] Dependencies up-to-date
[WebDriverAgent] Killing running processes ‘xcodebuild.*2A062B91-094E-484E-BDAF-00D2EA45C094, 2A062B91-094E-484E-BDAF-00D2EA45C094.*XCTRunner, xctest.*2A062B91-094E-484E-BDAF-00D2EA45C094’ for the device 2A062B91-094E-484E-BDAF-00D2EA45C094…
[WebDriverAgent] ‘pgrep -if xcodebuild.*2A062B91-094E-484E-BDAF-00D2EA45C094’ didn’t detect any matching processes. Return code: 1
[WebDriverAgent] ‘pgrep -if 2A062B91-094E-484E-BDAF-00D2EA45C094.*XCTRunner’ didn’t detect any matching processes. Return code: 1
[WebDriverAgent] ‘pgrep -if xctest.*2A062B91-094E-484E-BDAF-00D2EA45C094’ didn’t detect any matching processes. Return code: 1
[WebDriverAgent] Beginning test with command ‘xcodebuild build-for-testing test-without-building -project /Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/alexandru.dumitru/Library/Developer/Xcode/DerivedData/WebDriverAgent-eohhzogvvxexpkdvacohcghlkgni -destination id=2A062B91-094E-484E-BDAF-00D2EA45C094 IPHONEOS_DEPLOYMENT_TARGET=13.6 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO’ in directory ‘/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent’
[WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. To change this, use ‘showXcodeLog’ desired capability
[WebDriverAgent] Waiting up to 60000ms for WebDriverAgent to start
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WebDriverAgent] Log file for xcodebuild test: /Users/alexandru.dumitru/Library/Developer/Xcode/DerivedData/WebDriverAgent-eohhzogvvxexpkdvacohcghlkgni/Logs/Test/Test-WebDriverAgentRunner-2020.07.28_15-23-48-+0300.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-BCBD909F-E259-4ECC-8DEB-1992A28E27DA/WebDriverAgentRunner-03786F4E-A4F7-49DA-9CDA-8C224BE72E5B/Session-WebDriverAgentRunner-2020-07-28_152350-IFBOpu.log
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with unknown status: {“errno”:“ECONNREFUSED”,“code”:“ECONNREFUSED”,“syscall”:“connect”,“address”:“127.0.0.1”,“port”:8100}
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[WD Proxy] Got response with status 200: {
[WD Proxy] “value” : {
[WD Proxy] “message” : “WebDriverAgent is ready to accept commands”,
[WD Proxy] “state” : “success”,
[WD Proxy] “os” : {
[WD Proxy] “name” : “iOS”,
[WD Proxy] “version” : “13.6”,
[WD Proxy] “sdkVersion” : “13.4”
[WD Proxy] },
[WD Proxy] “ios” : {
[WD Proxy] “simulatorVersion” : “13.6”,
[WD Proxy] “ip” : “192.168.0.102”
[WD Proxy] },
[WD Proxy] “ready” : true,
[WD Proxy] “build” : {
[WD Proxy] “upgradedAt” : “1592831494759”,
[WD Proxy] “time” : “Jul 21 2020 16:34:42”,
[WD Proxy] “productBundleIdentifier” : “com.facebook.WebDriverAgentRunner”
[WD Proxy] }
[WD Proxy] },
[WD Proxy] “sessionId” : “356DB5A4-29FB-4518-BFE2-081056ED1511”
[WD Proxy] }
[WebDriverAgent] WebDriverAgent information:
[WebDriverAgent] {
[WebDriverAgent] “message”: “WebDriverAgent is ready to accept commands”,
[WebDriverAgent] “state”: “success”,
[WebDriverAgent] “os”: {
[WebDriverAgent] “name”: “iOS”,
[WebDriverAgent] “version”: “13.6”,
[WebDriverAgent] “sdkVersion”: “13.4”
[WebDriverAgent] },
[WebDriverAgent] “ios”: {
[WebDriverAgent] “simulatorVersion”: “13.6”,
[WebDriverAgent] “ip”: “192.168.0.102”
[WebDriverAgent] },
[WebDriverAgent] “ready”: true,
[WebDriverAgent] “build”: {
[WebDriverAgent] “upgradedAt”: “1592831494759”,
[WebDriverAgent] “time”: “Jul 21 2020 16:34:42”,
[WebDriverAgent] “productBundleIdentifier”: “com.facebook.WebDriverAgentRunner”
[WebDriverAgent] }
[WebDriverAgent] }
[WebDriverAgent] WebDriverAgent successfully started after 6682ms
[BaseDriver] Event ‘wdaSessionAttempted’ logged at 1595939033504 (15:23:53 GMT+0300 (Eastern European Summer Time))
[XCUITest] Sending createSession command to WDA
[WD Proxy] Matched ‘/session’ to command name ‘createSession’
[WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {“capabilities”:{“firstMatch”:[{“bundleId”:“com.avira.MobileEssentials”,“arguments”:[],“environment”:{},“eventloopIdleDelaySec”:0,“shouldWaitForQuiescence”:true,“shouldUseTestManagerForVisibilityDetection”:false,“maxTypingFrequency”:60,“shouldUseSingletonTestManager”:true}],“alwaysMatch”:{}}}
[WD Proxy] Got response with status 200: {“value”:{“sessionId”:“40D57F04-081B-4649-BBD9-F13AC4D746C3”,“capabilities”:{“device”:“iphone”,“browserName”:“Avira Security”,“sdkVersion”:“13.6”,“CFBundleIdentifier”:“com.avira.MobileEssentials”}},“sessionId”:“40D57F04-081B-4649-BBD9-F13AC4D746C3”}
[WD Proxy] Determined the downstream protocol as ‘W3C’
[BaseDriver] Event ‘wdaSessionStarted’ logged at 1595939035727 (15:23:55 GMT+0300 (Eastern European Summer Time))
[BaseDriver] Event ‘wdaStarted’ logged at 1595939035727 (15:23:55 GMT+0300 (Eastern European Summer Time))
[XCUITest] Skipping setting of the initial display orientation. Set the “orientation” capability to either “LANDSCAPE” or “PORTRAIT”, if this is an undesired behavior.
[BaseDriver] Event ‘orientationSet’ logged at 1595939035727 (15:23:55 GMT+0300 (Eastern European Summer Time))
[BaseDriver] The value of ‘elementResponseAttributes’ setting did not change. Skipping the update for it
[BaseDriver] The value of ‘shouldUseCompactResponses’ setting did not change. Skipping the update for it
[Appium] New XCUITestDriver session created successfully, session 4bd90c83-ab5c-436d-a053-e406e98fd2ba added to master session list
[BaseDriver] Event ‘newSessionStarted’ logged at 1595939035728 (15:23:55 GMT+0300 (Eastern European Summer Time))
[W3C (4bd90c83)] Cached the protocol value ‘W3C’ for the new session 4bd90c83-ab5c-436d-a053-e406e98fd2ba
[W3C (4bd90c83)] Responding to client with driver.createSession() result: {“capabilities”:{“webStorageEnabled”:false,“locationContextEnabled”:false,“browserName”:"",“platform”:“MAC”,“javascriptEnabled”:true,“databaseEnabled”:false,“takesScreenshot”:true,“networkConnectionEnabled”:false,“platformName”:“iOS”,“deviceName”:“iPhone”,“app”:"/Users/alexandru.dumitru/Downloads/ioSBuilds/iosbuild2.app",“automationName”:“XCUITest”,“platformVersion”:“13.6”,“udid”:“2A062B91-094E-484E-BDAF-00D2EA45C094”,“fullReset”:true,“bundleId”:“com.avira.MobileEssentials”,“xcodeOrgId”:“7HU9JMY9XG”,“xcodeSigningId”:“iPhone Developer”,“sendKeyStrategy”:“oneByOne”}}
[HTTP] <-- POST /wd/hub/session 200 47858 ms - 632
[HTTP]
[HTTP] --> POST /wd/hub/session/4bd90c83-ab5c-436d-a053-e406e98fd2ba/execute/sync
[HTTP] {“script”:“mobile: setAppearance”,“args”:[{“style”:“dark”}]}
[W3C (4bd90c83)] Calling AppiumDriver.execute() with args: [“mobile: setAppearance”,[{“style”:“dark”}],“4bd90c83-ab5c-436d-a053-e406e98fd2ba”]
[XCUITest] Executing command ‘execute’
[W3C (4bd90c83)] Encountered internal error running command: TypeError: this[commandMap[mobileCommand]] is not a function
[W3C (4bd90c83)] at XCUITestDriver.executeMobile (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/execute.js:114:16)
[W3C (4bd90c83)] at XCUITestDriver.call (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-ios-driver/lib/commands/execute.js:15:23)
[W3C (4bd90c83)] at XCUITestDriver.execute (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/execute.js:16:27)
[W3C (4bd90c83)] at commandExecutor (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:330:9)
[W3C (4bd90c83)] at /Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/async-lock/lib/index.js:125:12
[W3C (4bd90c83)] at AsyncLock._promiseTry (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/async-lock/lib/index.js:249:31)
[W3C (4bd90c83)] at exec (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/async-lock/lib/index.js:124:9)
[W3C (4bd90c83)] at AsyncLock.acquire (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/async-lock/lib/index.js:140:3)
[W3C (4bd90c83)] at XCUITestDriver.executeCommand (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:343:39)
[W3C (4bd90c83)] at XCUITestDriver.executeCommand (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:711:24)
[W3C (4bd90c83)] at AppiumDriver.executeCommand (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/lib/appium.js:534:36)
[W3C (4bd90c83)] at runMicrotasks ()
[W3C (4bd90c83)] at processTicksAndRejections (internal/process/task_queues.js:85:5)
[W3C (4bd90c83)] at asyncHandler (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:309:21)
[HTTP] <-- POST /wd/hub/session/4bd90c83-ab5c-436d-a053-e406e98fd2ba/execute/sync 500 47 ms - 665
[HTTP]

Please try if the fix https://github.com/appium/appium-xcuitest-driver/pull/1222 works for you

the fix has been published to [email protected]