IOS真机 配置Desired Capabilities 后,Appium启动报错

Failed to create session. An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 xcodebuild error message: . 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.

[BaseDriver] Session created with session id: 67dee2c8-efec-4339-9d18-dd9d6d0cad8b
[XCUITest] Current user: 'chenchao'
[XCUITest] Available devices: 7d51c5c5df6bcd4cb5606a066074658b311cf4d5
[XCUITest] Creating iDevice object with udid '7d51c5c5df6bcd4cb5606a066074658b311cf4d5'
[XCUITest] Determining device to run tests on: udid: '7d51c5c5df6bcd4cb5606a066074658b311cf4d5', real device: true
[BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1666947644103 (17:00:44 GMT+0800 (中国标准时间))
[BaseDriver] Event 'appConfigured' logged at 1666947644103 (17:00:44 GMT+0800 (中国标准时间))
[BaseDriver] Event 'resetStarted' logged at 1666947644104 (17:00:44 GMT+0800 (中国标准时间))
[XCUITest] Reset: running ios real device reset flow
[BaseDriver] Event 'resetComplete' logged at 1666947644104 (17:00:44 GMT+0800 (中国标准时间))
[WebDriverAgent] Using WDA path: '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[WebDriverAgent] Using WDA agent: '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[XCUITest] Crash reports root '/Users/chenchao/Library/Logs/CrashReporter/MobileDevice/iPad' does not exist. Got nothing to gather.
[BaseDriver] Event 'logCaptureStarted' logged at 1666947644300 (17:00:44 GMT+0800 (中国标准时间))
[XCUITest] Setting up real device
[WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device 7d51c5c5df6bcd4cb5606a066074658b311cf4d5 on local port 8100, device port 8100
[DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for 7d51c5c5df6bcd4cb5606a066074658b311cf4d5:8100
[XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver'
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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 1 times with 10000ms interval
[XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[BaseDriver] Event 'wdaStartAttempted' logged at 1666947644542 (17:00:44 GMT+0800 (中国标准时间))
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] WebDriverAgent does not need a cleanup. The sources are up to date (1632535255000 >= 1632535255000)
[WebDriverAgent] Killing running processes 'xcodebuild.*7d51c5c5df6bcd4cb5606a066074658b311cf4d5' for the device 7d51c5c5df6bcd4cb5606a066074658b311cf4d5...
[WebDriverAgent] 'pgrep -if xcodebuild.*7d51c5c5df6bcd4cb5606a066074658b311cf4d5' didn't detect any matching processes. Return code: 1
[WebDriverAgent] Generating xcode config file for orgId 'X727ZXY3PX' and signingId 'iPhone Developer'
[WebDriverAgent] Writing xcode config file to /var/folders/ch/670wqdvd1r95q0vdg1260ct80000gn/T/2022928-34181-1wpb4bo.c4me/appium-temp.xcconfig
[WebDriverAgent] Using Xcode configuration file: '/var/folders/ch/670wqdvd1r95q0vdg1260ct80000gn/T/2022928-34181-1wpb4bo.c4me/appium-temp.xcconfig'
[WebDriverAgent] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=7d51c5c5df6bcd4cb5606a066074658b311cf4d5 IPHONEOS_DEPLOYMENT_TARGET=13.7 -xcconfig /var/folders/ch/670wqdvd1r95q0vdg1260ct80000gn/T/2022928-34181-1wpb4bo.c4me/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[WebDriverAgent] Parsed BUILD_DIR configuration value: '/Users/chenchao/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou/Build/Products'
[WebDriverAgent] Got derived data root: '/Users/chenchao/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou'
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[WebDriverAgent] xcodebuild exited with code '65' and signal 'null'
[WebDriverAgent] Launching WebDriverAgent on the device
[WebDriverAgent] WebDriverAgent does not need a cleanup. The sources are up to date (1632535255000 >= 1632535255000)
[WebDriverAgent] Killing running processes 'xcodebuild.*7d51c5c5df6bcd4cb5606a066074658b311cf4d5' for the device 7d51c5c5df6bcd4cb5606a066074658b311cf4d5...
[WebDriverAgent] 'pgrep -if xcodebuild.*7d51c5c5df6bcd4cb5606a066074658b311cf4d5' didn't detect any matching processes. Return code: 1
[WebDriverAgent] Using Xcode configuration file: '/var/folders/ch/670wqdvd1r95q0vdg1260ct80000gn/T/2022928-34181-1wpb4bo.c4me/appium-temp.xcconfig'
[WebDriverAgent] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/chenchao/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou -destination id=7d51c5c5df6bcd4cb5606a066074658b311cf4d5 IPHONEOS_DEPLOYMENT_TARGET=13.7 -xcconfig /var/folders/ch/670wqdvd1r95q0vdg1260ct80000gn/T/2022928-34181-1wpb4bo.c4me/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[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
[iProxy@7d51c5c5:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[WebDriverAgent] xcodebuild exited with code '65' and signal 'null'
[BaseDriver] Event 'wdaStartFailed' logged at 1666947650005 (17:00:50 GMT+0800 (中国标准时间))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[XCUITest] xcodebuild error message:
[XCUITest] . 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.
[XCUITest] Quitting and uninstalling WebDriverAgent
[WebDriverAgent] Shutting down sub-processes
[WebDriverAgent] No WDAs on the device.
[XCUITest] {}
[DevCon Factory] Releasing connections for 7d51c5c5df6bcd4cb5606a066074658b311cf4d5 device on any port number
[DevCon Factory] Found cached connections to release: ["7d51c5c5df6bcd4cb5606a066074658b311cf4d5:8100"]
[DevCon Factory] Releasing the listener for '7d51c5c5df6bcd4cb5606a066074658b311cf4d5:8100'
[iProxy@7d51c5c5:8100] Closing the connection
[DevCon Factory] Cached connections count: 0
[XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[iProxy@7d51c5c5:8100] The connection has been closed
[BaseDriver] Event 'newSessionStarted' logged at 1666947650175 (17:00:50 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[W3C] xcodebuild error message:
[W3C] . 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.
[W3C]     at quitAndUninstall (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:592:15)
[W3C]     at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:627:11
[W3C]     at wrapped (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[W3C]     at retry (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[W3C]     at retryInterval (/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[W3C]     at /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:607:7
[HTTP] <-- POST /wd/hub/session 500 6122 ms - 1413
[HTTP] 

你先找到你本地的webdriver路径,然后用xcode打开,看下能不能编译成功