Xcodebuild code 65

So, I just started using Appium now, and maybe I’m forgetting to do something, but when i’m trying to run an app trough the last version of the Appium new app, it gives me this

[XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Carthage found: '/usr/local/bin/carthage'
[XCUITest] Killing hanging processes
[XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=97CC2F88-32F7-4C10-9703-00D73DB3258E -configuration Debug' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Output from xcodebuild will not be logged
[XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[XCUITest] Log file for xcodebuild test: /Users/joaohaas/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Logs/Test/97834447-58A6-450A-B1D2-54248D7D534D/Session-WebDriverAgentRunner-2017-03-31_144159-1oig2H.log
[Xcode] 2017-03-31 14:41:59.943 xcodebuild[26861:4134170] Error Domain=IDEFoundationErrorDomain Code=1 "Cannot launch simulated executable: no file found at /Users/joaohaas/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app" UserInfo={NSLocalizedDescription=Cannot launch simulated executable: no file found at /Users/joaohaas/Library/Developer/Xcode/DerivedData/WebDriverAgent-cvqckynzuuktkogfpkkkgyompmoj/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app}
[Xcode] 2017-03-31 14:41:59.943 xcodebuild[26861:4134170] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[Xcode] 
[Xcode] 2017-03-31 14:41:59.945 xcodebuild[26861:4134284] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled 
[Xcode] 
[Xcode] ** TEST EXECUTE FAILED **
[Xcode] 
[Xcode] 
[XCUITest] xcodebuild exited with code '65' and signal 'null'
[BaseDriver] Event 'wdaStartFailed' logged at 1490982119982 (14:41:59 GMT-0300 (BRT))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Removing WDA application from device
[BaseDriver] Event 'wdaStartAttempted' logged at 1490982130173 (14:42:10 GMT-0300 (BRT))
[XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Carthage found: '/usr/local/bin/carthage'
[XCUITest] Killing hanging processes

(Full Log bellow)

xcodebuild fail.txt (13.3 KB)

I’ve seen that this could be related to the signing of the WebDriveAgent file, but when i try to sign it and build, the build fails.

Am I doing something wrong or this is a problem with the app?

You need to sign and rebuild the web driver agent xcode project with your developer certs.

There are several threads with how to steps on this error.

https://discuss.appium.io/search?q=Xcodebuild%20code%2065

Check this YouTube video for a temporary fix for xcodebuild failed with code 65 error:

https://www.youtube.com/watch?v=TprXEKBnfmA