Unable to install app on real device iOS 10.2 using appium 1.6.3

When I try to run the testcases ,I am getting the below error.
But webdriverAgent runner is successfully installed on the device and the app also installed and after that i am getting the below error.

Can some one please help me on this.

XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger ‘/usr/local/lib/node_modules/deviceconsole/deviceconsole’
[debug] [XCUITest] Beginning test with command ‘xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=11d1e2fb8563011d84eea34527fe62475c4fd2fe -configuration Debug’ in directory ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[debug] [XCUITest] Unable to get device time. Using local system time
[debug] [XCUITest] Output from idevicedate: Tue Feb 7 15:38:38 AEDT 2017

[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/gunuputis4r/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/3CB32A2A-13B2-442D-A7F1-D6F94B3D5182/Session-WebDriverAgentRunner-2017-02-07_153839-eUKwIF.log
[Xcode] 2017-02-07 15:38:50.975 xcodebuild[14803:5634312] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7fa7e5863680 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}

[Xcode] 2017-02-07 15:38:50.975 xcodebuild[14803:5634312] Error Domain=IDETestOperationsObserverErrorDomain Code=5 “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]
Testing failed:

[Xcode] Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

[XCUITest] xcodebuild exited with code ‘65’ and signal ‘null’
[XCUITest] Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down Logger process (pid 14811)
[XCUITest] System log exited with code ‘null’
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: xcodebuild failed with code 65
at SubProcess. (…/…/lib/webdriveragent.js:355:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[HTTP] <-- POST /wd/hub/session 500 25872 ms - 167

yes it is installed on my device

I also faced same issue, but somehow it got resolved after restarting the device. Did you tried restarting it?

yes I also resolved the error by just accepting the certificate.

Did you automated dev signed ipa file…If so can you please tell me how can I automate the dev signed ipa because I am using different provisioning profile for building webdriverAgent and the developers will use different provisioning profile for building the ipa file.

How to resolve this conflict?

Open WebDriverAgentRunner.xcodeproj in xcode and revoke your provisioning certificates. It will surely work.

Thanks for the reply.This problem has been solved.Now I had a different question.

Did you automated dev signed ipa file…If so can you please tell me how can I automate the dev signed ipa because I am using different provisioning profile for building webdriverAgent and the developers will use different provisioning profile for building the ipa file.

How to resolve this conflict?

Provisioning profile for building webdriveragent and ipa both will be different and there will not be any conflict because of that.

Alternatively you can check this link FYI https://mobileautotools.wordpress.com/appium-setup-for-ios-10/

I will give it a try by checking an app with a different provisioning profile and let you know the results.

Thanks swapan.As you mentioned I am able to run dev signed ipa file which has different provisioning profile.

@Swathi … so how did you resolve that code signing problem? I’m running in to the same thing.

For me the webdriver agent project signed properly.If I opened the project once in my device then it started working.What exact error you are facing.

I had problems with signing and the Xcode error 65, but resolved that by updating my settings; didn’t have to use an ipa file as I’m testing a mobile website, not an App. Then, once I resolved a port issue (see Appium issue #7847, I got it working – at least partially. I’m still having issues getting taps and CSS selectors to work, but I figure I’ll be able to push through that as well.