Failed to create WDA session

Hi All,
When I run Appium on my real iOS device, I get the error like below. How can I overcome this problem? I could not find a solution for 2 days.

Appium log:

[info] e[35m[Appium]e[39m Welcome to Appium v1.20.2
[info] e[35m[Appium]e[39m Non-default server args:
[info] e[35m[Appium]e[39m   relaxedSecurityEnabled: true
[info] e[35m[Appium]e[39m   allowInsecure: {
[info] e[35m[Appium]e[39m   }
[info] e[35m[Appium]e[39m   denyInsecure: {
[info] e[35m[Appium]e[39m   }
[info] e[35m[Appium]e[39m Appium REST http interface listener started on 0.0.0.0:4723[info] e[35m[HTTP]e[39m e[37m-->e[39m e[37mGETe[39m e[37m/wd/hub/sessionse[39m
[info] e[35m[HTTP]e[39m e[90m{}e[39m
[debug] e[35m[GENERIC]e[39m Calling AppiumDriver.getSessions() with args: []
[debug] e[35m[GENERIC]e[39m Responding to client with driver.getSessions() result: []
[info] e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/sessions e[39me[32m200e[39m e[90m8 ms - 40e[39m
[info] e[35m[HTTP]e[39m e[90me[39m[info] e[35m[HTTP]e[39m e[37m-->e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
[info] e[35m[HTTP]e[39m e[90m{"desiredCapabilities":{"app":"/Users/appapp/Downloads/appappMobileIQ-Prod.ipa","automationName":"XCUITest","bundleId":"com.appappdata.mobileiq","deviceName":"iPhone 11","platformName":"iOS","platformVersion":"14.5.1","startIWDP":true,"udid":"00008030-0006405C0232802E","useNewWDA":true,"xcodeOrgId":"5755SZ8TRS","xcodeSigningId":"iPhone Developer","newCommandTimeout":0,"connectHardwareKeyboard":true}}e[39m
[debug] e[35m[MJSONWP]e[39m Calling AppiumDriver.createSession() with args: [{"app":"/Users/appapp/Downloads/appappMobileIQ-Prod.ipa","automationName":"XCUITest","bundleId":"com.appappdata.mobileiq","deviceName":"iPhone 11","platformName":"iOS","platformVersion":"14.5.1","startIWDP":true,"udid":"00008030-0006405C0232802E","useNewWDA":true,"xcodeOrgId":"5755SZ8TRS","xcodeSigningId":"iPhone Developer","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[debug] e[35m[BaseDriver]e[39m Event 'newSessionRequested' logged at 1621528550837 (19:35:50 GMT+0300 (GMT+03:00))
[info] e[35m[Appium]e[39m Appium v1.20.2 creating new XCUITestDriver (v3.46.0) session
[info] e[35m[Appium]e[39m Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] e[35m[BaseDriver]e[39m Creating session with MJSONWP desired capabilities: {
[debug] e[35m[BaseDriver]e[39m   "app": "/Users/appapp/Downloads/appappMobileIQ-Prod.ipa",
[debug] e[35m[BaseDriver]e[39m   "automationName": "XCUITest",
[debug] e[35m[BaseDriver]e[39m   "bundleId": "com.appappdata.mobileiq",
[debug] e[35m[BaseDriver]e[39m   "deviceName": "iPhone 11",
[debug] e[35m[BaseDriver]e[39m   "platformName": "iOS",
[debug] e[35m[BaseDriver]e[39m   "platformVersion": "14.5.1",
[debug] e[35m[BaseDriver]e[39m   "startIWDP": true,
[debug] e[35m[BaseDriver]e[39m   "udid": "00008030-0006405C0232802E",
[debug] e[35m[BaseDriver]e[39m   "useNewWDA": true,
[debug] e[35m[BaseDriver]e[39m   "xcodeOrgId": "5755SZ8TRS",
[debug] e[35m[BaseDriver]e[39m   "xcodeSigningId": "iPhone Developer",
[debug] e[35m[BaseDriver]e[39m   "newCommandTimeout": 0,
[debug] e[35m[BaseDriver]e[39m   "connectHardwareKeyboard": true
[debug] e[35m[BaseDriver]e[39m }
[warn] e[35m[BaseDriver]e[39m The following capabilities were provided, but are not recognized by Appium:
[warn] e[35m[BaseDriver]e[39m   startIWDP
[info] e[35m[BaseDriver]e[39m Session created with session id: 6a3dfaba-7780-46ea-8a31-56bd135f2c5d[debug] e[35m[XCUITest]e[39m Current user: 'appapp'
[debug] e[35m[XCUITest]e[39m Available devices: 00008030-0006405C0232802E
[debug] e[35m[XCUITest]e[39m Creating iDevice object with udid '00008030-0006405C0232802E'
[info] e[35m[XCUITest]e[39m Determining device to run tests on: udid: '00008030-0006405C0232802E', real device: true
[info] e[35m[XCUITest]e[39m Normalized platformVersion capability value '14.5.1' to '14.5'
[debug] e[35m[BaseDriver]e[39m Event 'xcodeDetailsRetrieved' logged at 1621528551508 (19:35:51 GMT+0300 (GMT+03:00))[info] e[35m[BaseDriver]e[39m Using local app '/Users/appapp/Downloads/appappMobileIQ-Prod.ipa'[debug] e[35m[BaseDriver]e[39m Unzipping '/Users/appapp/Downloads/appappMobileIQ-Prod.ipa'
[debug] e[35m[BaseDriver]e[39m Enforcing UTF-8 encoding on the extracted file names for 'appappMobileIQ-Prod.ipa'[debug] e[35m[BaseDriver]e[39m Extracted 2969 items from '/Users/appapp/Downloads/appappMobileIQ-Prod.ipa' in 34965ms
[debug] e[35m[BaseDriver]e[39m Matched 1 item in the extracted archive. Assuming 'Payload/appappMobileIQ.app' is the correct bundle
[info] e[35m[BaseDriver]e[39m Unzipped local app to '/var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-11kygfs.hkc4/appappMobileIQ.app'
[debug] e[35m[BaseDriver]e[39m Event 'appConfigured' logged at 1621528588233 (19:36:28 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Checking whether app '/var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-11kygfs.hkc4/appappMobileIQ.app' is actually present on file system
[debug] e[35m[XCUITest]e[39m App is present
[debug] e[35m[BaseDriver]e[39m Event 'resetStarted' logged at 1621528588235 (19:36:28 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Reset: running ios real device reset flow
[debug] e[35m[BaseDriver]e[39m Event 'resetComplete' logged at 1621528588236 (19:36:28 GMT+0300 (GMT+03:00))
[info] e[35m[WebDriverAgent]e[39m Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[info] e[35m[WebDriverAgent]e[39m Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'[debug] e[35m[XCUITest]e[39m Crash reports root '/Users/appapp/Library/Logs/CrashReporter/MobileDevice/appapp iPhone’u' does not exist. Got nothing to gather.
[debug] e[35m[BaseDriver]e[39m Event 'logCaptureStarted' logged at 1621528588688 (19:36:28 GMT+0300 (GMT+03:00))
[info] e[35m[XCUITest]e[39m Setting up real device
[debug] e[35m[XCUITest]e[39m Verifying application platform
[debug] e[35m[XCUITest]e[39m CFBundleSupportedPlatforms: ["iPhoneOS"][debug] e[35m[XCUITest]e[39m Reset requested. Removing app with id 'com.appappdata.mobileiq' from the device[debug] e[35m[XCUITest]e[39m Installing '/var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-11kygfs.hkc4/appappMobileIQ.app' on device with UUID '00008030-0006405C0232802E'...[debug] e[35m[XCUITest]e[39m Installing '/var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-11kygfs.hkc4/appappMobileIQ.app' on device with UUID '00008030-0006405C0232802E'...[debug] e[35m[WebDriverAgent]e[39m Parsed BUILD_DIR configuration value: '/Users/appapp/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products'
[debug] e[35m[WebDriverAgent]e[39m Got derived data root: '/Users/appapp/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp'[debug] e[35m[Support]e[39m Traversed 324 directories and 2644 files in 53133ms
[debug] e[35m[XCUITest]e[39m Pushed the app files successfully after 53922ms[info] e[35m[XCUITest]e[39m App installation succeeded after 57320ms
[debug] e[35m[XCUITest]e[39m The app has been installed successfully.
[debug] e[35m[BaseDriver]e[39m Event 'appInstalled' logged at 1621528646690 (19:37:26 GMT+0300 (GMT+03:00))[debug] e[35m[WebDriverAgent]e[39m No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[info] e[35m[DevCon Factory]e[39m Requesting connection for device 00008030-0006405C0232802E on local port 8100, device port 8100
[debug] e[35m[DevCon Factory]e[39m Cached connections count: 0
[info] e[35m[DevCon Factory]e[39m Successfully requested the connection for 00008030-0006405C0232802E:8100
[debug] e[35m[XCUITest]e[39m Starting WebDriverAgent initialization with the synchronization key '/Users/appapp/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp'
[debug] e[35m[XCUITest]e[39m Capability 'useNewWDA' set to true, so uninstalling WDA before proceeding
[info] e[35m[WebDriverAgent]e[39m Shutting down sub-processes[debug] e[35m[WebDriverAgent]e[39m No WDAs on the device.
[debug] e[35m[BaseDriver]e[39m Event 'wdaUninstalled' logged at 1621528647403 (19:37:27 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Trying to start WebDriverAgent 1 times with 10000ms interval
[debug] e[35m[XCUITest]e[39m These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] e[35m[BaseDriver]e[39m Event 'wdaStartAttempted' logged at 1621528647405 (19:37:27 GMT+0300 (GMT+03:00))
[info] e[35m[WebDriverAgent]e[39m Launching WebDriverAgent on the device
[info] e[35m[WebDriverAgent]e[39m WebDriverAgent does not need a cleanup. The sources are up to date (1621523032157 >= 1621523032157)
[debug] e[35m[WebDriverAgent]e[39m Killing running processes 'xcodebuild.*00008030-0006405C0232802E' for the device 00008030-0006405C0232802E...
[debug] e[35m[WebDriverAgent]e[39m 'pgrep -if xcodebuild.*00008030-0006405C0232802E' didn't detect any matching processes. Return code: 1
[debug] e[35m[WebDriverAgent]e[39m Generating xcode config file for orgId '5755SZ8TRS' and signingId 'iPhone Developer'
[debug] e[35m[WebDriverAgent]e[39m Writing xcode config file to /var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-hcpoms.6bjde/appium-temp.xcconfig
[debug] e[35m[WebDriverAgent]e[39m Using Xcode configuration file: '/var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-hcpoms.6bjde/appium-temp.xcconfig'
[debug] e[35m[WebDriverAgent]e[39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/appapp/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp -destination id=00008030-0006405C0232802E IPHONEOS_DEPLOYMENT_TARGET=14.5 -xcconfig /var/folders/pj/t5w9ky917yqfyrppbmzd728h0000gn/T/2021420-1525-hcpoms.6bjde/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[debug] e[35m[WebDriverAgent]e[39m Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] e[35m[WebDriverAgent]e[39m Waiting up to 60000ms for WebDriverAgent to start
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up[error] e[35m[WebDriverAgent]e[39m xcodebuild exited with code '0' and signal 'null'[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528666165 (19:37:46 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528667195 (19:37:47 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528668215 (19:37:48 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528669232 (19:37:49 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528670249 (19:37:50 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528671265 (19:37:51 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528672280 (19:37:52 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528673301 (19:37:53 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528674324 (19:37:54 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528675353 (19:37:55 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528676370 (19:37:56 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528677395 (19:37:57 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528678408 (19:37:58 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528679428 (19:37:59 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...[debug] e[35m[BaseDriver]e[39m Event 'wdaSessionAttempted' logged at 1621528680465 (19:38:00 GMT+0300 (GMT+03:00))
[debug] e[35m[XCUITest]e[39m Sending createSession command to WDA
[debug] e[35m[WD Proxy]e[39m Matched '/status' to command name 'getStatus'
[debug] e[35m[WD Proxy]e[39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] e[35m[iProxy@00008030:8100]e[39m Connection was refused to port 8100
[info] e[35m[WD Proxy]e[39m socket hang up
[debug] e[35m[XCUITest]e[39m 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: socket hang up). Retrying...
[debug] e[35m[XCUITest]e[39m UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
[debug] e[35m[XCUITest]e[39m     at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:275:13)
[debug] e[35m[XCUITest]e[39m     at runMicrotasks (<anonymous>)
[debug] e[35m[XCUITest]e[39m     at processTicksAndRejections (internal/process/task_queues.js:85:5)
[debug] e[35m[XCUITest]e[39m Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[warn] e[35m[XCUITest]e[39m Quitting and uninstalling WebDriverAgent
[info] e[35m[WebDriverAgent]e[39m Shutting down sub-processes[debug] e[35m[WebDriverAgent]e[39m Uninstalling WDAs: 'com.facebook.WebDriverAgentRunner.xctrunner'[error] e[35m[XCUITest]e[39m {}
[info] e[35m[DevCon Factory]e[39m Releasing connections for 00008030-0006405C0232802E device on any port number
[info] e[35m[DevCon Factory]e[39m Found cached connections to release: ["00008030-0006405C0232802E:8100"]
[info] e[35m[DevCon Factory]e[39m Releasing the listener for '00008030-0006405C0232802E:8100'
[debug] e[35m[iProxy@00008030:8100]e[39m Closing the connection
[debug] e[35m[DevCon Factory]e[39m Cached connections count: 0
[debug] e[35m[XCUITest]e[39m Not clearing log files. Use `clearSystemFiles` capability to turn on.
[info] e[35m[iProxy@00008030:8100]e[39m The connection has been closed
[debug] e[35m[BaseDriver]e[39m Event 'newSessionStarted' logged at 1621528681057 (19:38:01 GMT+0300 (GMT+03:00))
[debug] e[35m[MJSONWP]e[39m Encountered internal error running command: Error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] e[35m[MJSONWP]e[39m     at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:556:15)
[debug] e[35m[MJSONWP]e[39m     at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:622:11
[debug] e[35m[MJSONWP]e[39m     at wrapped (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[debug] e[35m[MJSONWP]e[39m     at retry (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[debug] e[35m[MJSONWP]e[39m     at retryInterval (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[debug] e[35m[MJSONWP]e[39m     at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:571:7
[info] e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session e[39me[31m500e[39m e[90m130293 ms - 602e[39m
[info] e[35m[HTTP]e[39m e[90me[39m[info] e[35m[HTTP]e[39m e[37m-->e[39m e[37mDELETEe[39m e[37m/wd/hub/sessione[39m
[info] e[35m[HTTP]e[39m e[90m{}e[39m
[debug] e[35m[HTTP]e[39m No route found for /wd/hub/session
[info] e[35m[HTTP]e[39m e[37m<-- DELETE /wd/hub/session e[39me[33m404e[39m e[90m44 ms - 211e[39m
[info] e[35m[HTTP]e[39m e[90me[39m

Appium capabilities:

{
“udid”: “00008030-0006405C0232802E”,
“platformName”: “iOS”,
“app”: “/Users/matriks/Downloads/appappMobileIQ-Prod.ipa”,
“automationName”: “XCUITest”,
“deviceName”: “iPhone 11”,
“xcodeSigningId”: “iPhone Developer”,
“xcodeOrgId”: “4753SZ9TRS”,
“bundleId”: “com.appappdata.mobileiq”,
“useNewWDA”: true,
“platformVersion”: “14.5.1”,
“startIWDP”: true
}

Webdriveragent path:
/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

When I run the command from the terminal:

command:
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=00008030-0006405C0232802E’ test

Result:

Testing started
2021-05-20 19:56:09.009792+0300 WebDriverAgentRunner-Runner[491:69309] Running tests…
Test Suite ‘All tests’ started at 2021-05-20 19:56:09.453
Test Suite ‘WebDriverAgentRunner.xctest’ started at 2021-05-20 19:56:09.454
Test Suite ‘UITestingUITests’ started at 2021-05-20 19:56:09.454
t = nans Suite Set Up
Test Case ‘-[UITestingUITests testRunner]’ started.
t = 0.00s Start Test at 2021-05-20 19:56:09.461
t = 0.00s Set Up
2021-05-20 19:56:09.462666+0300 WebDriverAgentRunner-Runner[491:69309] -[UITestingUITests internalImplementation]: unrecognized selector sent to instance 0x282f3ec00
2021-05-20 19:56:09.469819+0300 WebDriverAgentRunner-Runner[491:69309] Enqueue Failure: -[UITestingUITests internalImplementation]: unrecognized selector sent to instance 0x282f3ec00 (NSInvalidArgumentException) (null) 0 0
t = 0.01s Tear Down
Test Case ‘-[UITestingUITests testRunner]’ passed (0.009 seconds).
Test Suite ‘UITestingUITests’ passed at 2021-05-20 19:56:09.471.
Executed 1 test, with 0 failures (0 unexpected) in 0.009 (0.017) seconds
Test Suite ‘WebDriverAgentRunner.xctest’ passed at 2021-05-20 19:56:09.471.
Executed 1 test, with 0 failures (0 unexpected) in 0.009 (0.017) seconds
Test Suite ‘WebDriverAgentLib.framework’ started at 2021-05-20 19:56:09.471
Test Suite ‘WebDriverAgentLib.framework’ passed at 2021-05-20 19:56:09.471.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite ‘All tests’ passed at 2021-05-20 19:56:09.471.
Executed 1 test, with 0 failures (0 unexpected) in 0.009 (0.018) seconds
2021-05-20 19:56:09.271 xcodebuild[1864:37341] [MT] IDETestOperationsObserverDebug: 2.619 elapsed – Testing started completed.
2021-05-20 19:56:09.271 xcodebuild[1864:37341] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec – start
2021-05-20 19:56:09.271 xcodebuild[1864:37341] [MT] IDETestOperationsObserverDebug: 2.619 sec, +2.619 sec – end

Test session results, code coverage, and logs:
/Users/appapp/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.20_19-55-32-+0300.xcresult

** TEST SUCCEEDED **

The following commands produced analyzer issues:
Analyze /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m normal arm64
Analyze /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgentLib/Routing/FBSession.m normal arm64
(2 commands with analyzer issues)
appapp@appapps-mbp appium-webdriveragent %