Couldn't run test on real device
This is error that I see.
Device iPhone 6 with OS 10.01(14A403). its ios10 GM
[User Defaults] Failed to write value for key AutomationEnabled in CFPrefsPlistSource<0x1740f6c80> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only
2016-09-09 13:39:20.592391 App[952:261015] [User Defaults] attempt to set
I wonder why the log is not symbolicated.
Looks like the crash is happening in Swift runtime in the not equal operator, which is called from your app binary.
$ xcrun swift-demangle _TFsoi3neeFTGSqPs9AnyObject__GSqPS____Sb _TFsoi3neeFTGSqPs9AnyObject__GSqPS____Sb ---> Swift.!== infix (Swift.AnyObject?, Swift.AnyObject?) -> Swift.Bool
For some reason I can't demangle the other 2 mangled names. They seem to refer to UIView initialize.
Did you implement/override this method in your app? Does it use the not equal operator, and is it being used correctly? Are you using Swift 2.3 or Swift 3?
I can't repro this issue running EarlGreyFunctionalTests or EarlGreyFunctionalSwiftTests on iPhone 5S with iOS 10.0.1 final, and Xcode 8 final. I can see the log messages for failed writes to User Defaults, but those are just warnings and don't crash the app, all tests continue normally.
It would be helpful if you could share code that can repro this issue.
I can also run our functional tests just fine on my iPhone 6s running iOS 10.01
2016-09-15 01:17:04.969089 FunctionalTestRig[579:118552] Crash handler setup started.
2016-09-15 01:17:04.969325 FunctionalTestRig[579:118552] Crash handlers setup completed.
2016-09-15 01:17:04.973422 FunctionalTestRig[579:118603] [User Defaults] Failed to write value for key AutomationEnabled in CFPrefsPlistSource<0x1700ed680> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only
2016-09-15 01:17:04.976638 FunctionalTestRig[579:118552] [User Defaults] attempt to set <private> for key in <private> in read-only (due to a previous failed write) preferences domain CFPrefsPlistSource<0x1700ed680> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null))
2016-09-15 01:17:04.976889 FunctionalTestRig[579:118552] [User Defaults] attempt to set <private> for key in <private> in read-only (due to a previous failed write) preferences domain CFPrefsPlistSource<0x1700ed680> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null))
2016-09-15 01:17:06.087497 FunctionalTestRig[579:118552] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-09-15 01:17:06.105742 FunctionalTestRig[579:118604] [MC] Invalidating cache
2016-09-15 01:17:06.124475 FunctionalTestRig[579:118604] [MC] Invalidating cache
2016-09-15 01:17:06.128834 FunctionalTestRig[579:118604] [MC] Invalidating cache
2016-09-15 01:17:06.322612 FunctionalTestRig[579:118552] [MC] Reading from public effective user settings.
2016-09-15 01:17:06.337720 FunctionalTestRig[579:118604] [MC] Invalidating cache
2016-09-15 01:17:06.349781 FunctionalTestRig[579:118552] [MC] Reading from public effective user settings.
2016-09-15 01:17:06.350549 FunctionalTestRig[579:118603] [MC] Invalidating cache
2016-09-15 01:17:06.843593 FunctionalTestRig[579:118552] Scheduling timer to fire in 0.5 seconds.
2016-09-15 01:17:06.934139 FunctionalTestRig[579:118552] [MC] Reading from public effective user settings.
Test Suite 'All tests' started at 2016-09-15 01:17:07.393
Test Suite 'FunctionalTests.xctest' started at 2016-09-15 01:17:07.394
Test Suite 'FTRAccessibilityTest' started at 2016-09-15 01:17:07.394
Test Case '-[FTRAccessibilityTest testAccessibilityElementTappedSuccessfullyWithTapAtPoint]' started.
2016-09-15 01:17:07.399443 FunctionalTestRig[579:118552] Timer fired! Removing splash screen.
2016-09-15 01:17:07.442503 FunctionalTestRig[579:118552] View is moving to nil window. Skipping viewWillDisappear state tracking.
Thanks @axi0mX , @khandpur : When I tried this , I also just build app and launch it and it didn't crash. There is no test code as it was failing in set up itself. We recently fixed few bugs with Swift 3 migration. I will try with latest code for our app and let you know.
@yaphatak, as mentioned, it would be great if you could please provide us with a repro project or reproduce the issue with our tests projects. Do tell us what you find. Thanks.
Yes I will do that. It will be sometime next week hopefully. So if you want to close this I am fine with it, as you guys can't repro it with same configuration of device and host.
I tried example project as suggested. Example app keep crashing. This is on iphone 5s and OS 10.0.1 (Also this example project didnt work as is on xcode 8. So i converted to Swift3. )
Error Domain=com.apple.platform.iphoneos Code=-12 "Unable to launch com.google.samples.EarlGrey" UserInfo={NSLocalizedDescription=Unable to launch com.google.samples.EarlGrey, NSUnderlyingError=0x7ff300284340 {Error Domain=DTXMessage Code=1 "(null)" UserInfo={DTXExceptionKey=Background launch requested, but this app cannot run in the background (see UIApplicationExitsOnSuspend or 'Background Modes' in Xcode).}}} 2016-09-16 15:42:14.503 xcodebuild[93081:717074] 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}
@yaphatak, just to confirm, this was a vanilla run on a 5s on iOS 10.0.1 on Xcode8? (Thanks for the heads up on the conversion. Feel free to send a PR for it or we'll get it in in the coming release.)
Yatin, following up to see if you were able to get this issue resolved? @yaphatak
@khandpur Our debug build has some issues running with EarlGrey but release one worked just fine. Actually I worked with @tirodkar on this. Thanks for all support. I am closing this now
@tirodkar : I can still reproduce this issue with Xcode 10.2 and device with iOS 11+. Here are the logs.
2019-05-02: Enabling accessibility for automation on Device. 2019-05-02: [User Defaults] Couldn't write value for key AutomationEnabled in CFPrefsPlistSource<0x1086e3470> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only 2019-05-02: [User Defaults] attempt to set 1 for key in ApplicationAccessibilityEnabled in read-only (due to a previously logged write error) preferences domain CFPrefsPlistSource<0x1086e3470> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) 2019-05-02: [User Defaults] attempt to set 1 for key in AccessibilityEnabled in read-only (due to a previously logged write error) preferences domain CFPrefsPlistSource<0x1086e3470> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No)