Xcode build fails with error code 65 because of an alert

System:
Appium version : 1.6.1-beta
Platform: iOS and Android (need help with iOS)
Real device - iPhone 5s iOS 9
Tests written in Java
OS - Mac El Capitan 10.11.6

Hi , not sure if this is a bug or more of a feature request but i have the following issue that i need help with.
I’m getting the following error when trying to launch my app

Now i have all the provisions profiles signed and everything and i know why i am getting this error.
I’m getting the error because i have an alert on the foreground “No SIM Card Installed”,
which is fine because i really don’t have a sim on my device (real device , iphone 5s version 9.3.5)

once i manually click “OK” on the alert and running again our test suite , appium driver is created successfully and
the tests finish as expected.

So i need help or an idea on how to get rid of that alert without manual steps, as these tests are running as part of our nightly build.

Thanks!

/WebDriverAgent/WebDriverAgent.xcodeproj'
27-11-2016;22:00:46.684 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[XCUITest] Launching WebDriverAgent on the device
27-11-2016;22:00:46.686 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
27-11-2016;22:00:46.687 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [XCUITest] Killing hanging processes
27-11-2016;22:00:46.771 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [XCUITest] Using real device logger '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
27-11-2016;22:00:46.772 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[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=d5a08bfccbd4eb414d416b1a676d9ea978330fcf -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
27-11-2016;22:00:48.558 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[XCUITest] Waiting for WebDriverAgent to start on device
27-11-2016;22:00:52.902 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [XCUITest] Log file for xcodebuild test: /Users/muvix/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/1DF63D0A-F7EA-4904-B534-5ABBA6FBE164/Session-WebDriverAgentRunner-2016-11-27_220052-YzbnLO.log
27-11-2016;22:01:01.349 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [WebDriverAgent] Device: Nov 27 22:01:01 Muvixs-iPhone XCTRunner[386] <Warning>: Running tests...
27-11-2016;22:01:32.073 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[Xcode] 2016-11-27 22:01:32.072 xcodebuild[62557:2689704] Error Domain=IDETestOperationsObserverErrorDomain Code=12 "Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/muvix/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/1DF63D0A-F7EA-4904-B534-5ABBA6FBE164/Session-WebDriverAgentRunner-2016-11-27_220052-YzbnLO.log" UserInfo={NSLocalizedDescription=Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/muvix/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/1DF63D0A-F7EA-4904-B534-5ABBA6FBE164/Session-WebDriverAgentRunner-2016-11-27_220052-YzbnLO.log}
27-11-2016;22:01:32.073 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[Xcode] 
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :Testing failed:
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :	Test target WebDriverAgentRunner encountered an error (Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/muvix/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/1DF63D0A-F7EA-4904-B534-5ABBA6FBE164/Session-WebDriverAgentRunner-2016-11-27_220052-YzbnLO.log)
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :** TEST FAILED **
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[Xcode] 2016-11-27 22:01:01.341 XCTRunner[386:61596] Running tests...
27-11-2016;22:01:32.129 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :
27-11-2016;22:01:32.137 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[XCUITest] xcodebuild exited with code '65' and signal 'null'
27-11-2016;22:01:32.140 [Thread-13] DEBUG media.muvix.framework.AppiumRunnable - appium :[debug] [XCUITest] xcodebuild failure warrants retry. Retrying...

have you provided the config file ?

i am assuming you meant - https://github.com/appium/appium-xcuitest-driver#real-devices
if so , i did the manual configuration alternative.
Basically appium works , but only if i don’t have any alerts during his initialization

I’ve noticed the same thing; if there’s an alert onscreen during the launch of the app, it appears not to work. Once the app is launched it seems that pop-ups do not seem to be an issue.

I was able to over come the error 65 with the below guide:

What do you mean by alerts ? can you share the screenshot of what you are talking about ?

Its the system alerts
For example , No Sim Card Alert

Whenever there is a system popup you will surely get that , are using autoDismissAlerts as one of the capabilities ?

I believe that it’s not working on XCUITest , I’m not using this capability

This command works for me in Python:

self.driver.switch_to.alert.accept()

Anybody found a solution for dismissing alert? I get the same error, WDA cant open because of alert unless I manually dismiss it prior to starting the test.

in my case the alert was “No Sim Card” , installing dummy sim card solved it for me.
maybe you can add pre test code and try clicking the button yourself

any update on this issue?

“Anybody found a solution for dismissing alert? I get the same error, WDA cant open because of alert unless I manually dismiss it prior to starting the test.”