UI Testing doesn't launch app

I open my project with Xcode 7 without any previous UI Testing.

I add the UI Testing target bundle.

I record a test and press stop recording (all this just like the WWDC video). So far, so good.


I click the playback button to perform the test.

The app does not launch in the simluator. I am told the testing fail without any explanation or visible indication. I can find the follow output in a folder like: /private/var/folders/yh/cmgvmn_92p39q79pt890r0tdt1kjzf/T/com.apple.dt.XCTest-status


What am I doing wrong? Or what haven't I done?


Thanks,


Kiel


2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Beginning test session with Xcode 7A218 on target <DVTiPhoneSimulator: 0x7fa2bdd16ab0> {
  SimDevice: SimDevice : iPad Air 2 (36A988A8-2120-466C-8864-4000A0903D35) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 } runtime={ SimRuntime : 9.0 (13A340) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 }
} (9.0 (13A340))
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Launching with Xcode.DebuggerFoundation.Launcher.LLDB
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Testing on device: <DVTiPhoneSimulator: 0x7fa2bdd16ab0> {
  SimDevice: SimDevice : iPad Air 2 (36A988A8-2120-466C-8864-4000A0903D35) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 } runtime={ SimRuntime : 9.0 (13A340) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 }
}
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Initializing test infrastructure.
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Writing testing status log to /var/folders/yh/cmgvmn_92p39q79pt890r0tdt1kjzf/T/com.apple.dt.XCTest-status/Session-2015-09-18_16:54:31-imf9dG.log.
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Creating the connection.
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Listening for proxy connection request from the test bundle (all platforms)
2015-09-18 16:54:31.130 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Resuming the connection.
2015-09-18 16:54:31.131 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Test connection requires daemon assistance.
2015-09-18 16:54:31.171 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Checking test manager availability..., will wait up to 120s
2015-09-18 16:54:31.171 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Starting test session with ID <__NSConcreteUUID 0x7fa2ca19f7c0> 9E56C0B2-2B5C-4DCF-9634-8B72ED32C094
2015-09-18 16:54:31.173 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) testmanagerd handled session request.
2015-09-18 16:54:31.173 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Waiting for test process to launch.
2015-09-18 16:54:34.033 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Launch session started, setting a disallow-finish-token on the run operation.
2015-09-18 16:54:34.064 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Adding console adaptor <IDEConsoleAdaptor: 0x7fa29050d7b0 'target'> for test session 9E56C0B2-2B5C-4DCF-9634-8B72ED32C094.
2015-09-18 16:54:35.792 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Launch session finished initial intensive file IO.
2015-09-18 16:54:35.792 (9E56C0B2-2B5C-4DCF-9634-8B72ED32C094) Waiting for test process to check in..., will wait up to 120s


**** Begin output from test process:
2015-09-18 16:54:35.948 XCTRunner[46457:923204] Running tests...
2015-09-18 16:54:35.949 XCTRunner[46457:923204] Looking for test bundles in /Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/Containers/Bundle/Application/9352F34C-D823-4B41-A38D-FAA5FE54CB38/AFRUITests-Runner.app/PlugIns
2015-09-18 16:54:35.949 XCTRunner[46457:923204] XCTRunner Arguments: (
    "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/Containers/Bundle/Application/9352F34C-D823-4B41-A38D-FAA5FE54CB38/AFRUITests-Runner.app/XCTRunner",
    "-NSTreatUnknownArgumentsAsOpen",
    NO,
    "-ApplePersistenceIgnoreState",
    YES
)
2015-09-18 16:54:35.950 XCTRunner[46457:923204] XCTRunner Environment: {
    "CFFIXED_USER_HOME" = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/Containers/Data/Application/7359DBEF-6604-412B-9A47-EE18401E0867";
    "CFLOG_FORCE_STDERR" = YES;
    CLASSIC = 0;
    "CUPS_SERVER" = "/private/tmp/com.apple.launchd.16K7NeVJlq/Listeners";
    "DYLD_FALLBACK_FRAMEWORK_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks";
    "DYLD_FALLBACK_LIBRARY_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib";
    "DYLD_FRAMEWORK_PATH" = "/Users/kiel.gillard/Library/Developer/Xcode/DerivedData/Alfred-adlymjyjtksujwbgrfamofhzhuck/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks";
    "DYLD_LIBRARY_PATH" = "/Users/kiel.gillard/Library/Developer/Xcode/DerivedData/Alfred-adlymjyjtksujwbgrfamofhzhuck/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks";
    "DYLD_ROOT_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
    "DYLD_SHARED_REGION" = avoid;
    FBSClientLogging = 0;
    HOME = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/Containers/Data/Application/7359DBEF-6604-412B-9A47-EE18401E0867";
    "IOS_SIMULATOR_SYSLOG_SOCKET" = "/private/tmp/com.apple.CoreSimulator.SimDevice.36A988A8-2120-466C-8864-4000A0903D35.launchd_sim/syslogsock";
    "IPHONE_SHARED_RESOURCES_DIRECTORY" = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data";
    "IPHONE_SIMULATOR_CLASS" = J82;
    "IPHONE_SIMULATOR_DEVICE" = iPad;
    "IPHONE_SIMULATOR_ROOT" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
    NSUnbufferedIO = YES;
    "OBJC_DISABLE_GC" = YES;
    PATH = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/local/bin";
    "SIMULATOR_CAPABILITIES" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/DeviceTypes/iPad Air 2.simdevicetype/Contents/Resources/capabilities.plist";
    "SIMULATOR_DEVICE_NAME" = iPadSimulatorHiDPI;
    "SIMULATOR_HOST_HOME" = "/Users/kiel.gillard";
    "SIMULATOR_LEGACY_ASSET_SUFFIX" = ipad;
    "SIMULATOR_LOG_ROOT" = "/Users/kiel.gillard/Library/Logs/CoreSimulator/36A988A8-2120-466C-8864-4000A0903D35";
    "SIMULATOR_MAINSCREEN_HEIGHT" = 2048;
    "SIMULATOR_MAINSCREEN_PITCH" = "264.000000";
    "SIMULATOR_MAINSCREEN_SCALE" = "2.000000";
    "SIMULATOR_MAINSCREEN_WIDTH" = 1536;
    "SIMULATOR_MEMORY_WARNINGS" = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/var/run/memory_warning_simulation";
    "SIMULATOR_MODEL_IDENTIFIER" = "iPad5,4";
    "SIMULATOR_PLATFORM_RUNTIME_OVERLAY_ROOT" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/RuntimeOverlay";
    "SIMULATOR_ROOT" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
    "SIMULATOR_RUNTIME_BUILD_VERSION" = 13A340;
    "SIMULATOR_RUNTIME_VERSION" = "9.0";
    "SIMULATOR_SHARED_RESOURCES_DIRECTORY" = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data";
    "SIMULATOR_UDID" = "36A988A8-2120-466C-8864-4000A0903D35";
    "SIMULATOR_VERSION_INFO" = "CoreSimulator 179 - Device: iPad Air 2 - Runtime: iOS 9.0 (13A340) - DeviceType: iPad Air 2";
    "TESTMANAGERD_SIM_SOCK" = "/private/tmp/com.apple.launchd.AyA9KKjgbs/com.apple.testmanagerd.unix-domain.socket";
    TMPDIR = "/Users/kiel.gillard/Library/Developer/CoreSimulator/Devices/36A988A8-2120-466C-8864-4000A0903D35/data/Containers/Data/Application/7359DBEF-6604-412B-9A47-EE18401E0867/tmp";
    "XCODE_DBG_XPC_EXCLUSIONS" = "com.apple.dt.xctestSymbolicator";
    XCTestConfigurationFilePath = "/Users/kiel.gillard/Library/Developer/Xcode/DerivedData/Alfred-adlymjyjtksujwbgrfamofhzhuck/Build/Products/Debug-iphonesimulator/AFRUITests-Runner.app/PlugIns/AFRUITests.app/AFRUITests-9E56C0B2-2B5C-4DCF-9634-8B72ED32C094.xctestconfiguration";
    "XPC_FLAGS" = 0x0;
    "XPC_SERVICE_NAME" = "UIKitApplication:com.apple.test.AFRUITests-Runner[0x960]";
    "XPC_SIMULATOR_LAUNCHD_NAME" = "com.apple.CoreSimulator.SimDevice.36A988A8-2120-466C-8864-4000A0903D35.launchd_sim";
}
**** End output from test process


2015-09-18 16:54:38.134 ((null)) Test operation failure: Test session exited(1) without checking in.
2015-09-18 16:54:38.135 ((null)) _finishWithError:Error Domain=IDETestOperationsObserverErrorDomain Code=4 "Test session exited(1) without checking in." UserInfo={NSLocalizedDescription=Test session exited(1) without checking in.} didCancel: 1

Please file a bug report (using the Report Bugs link at the bottom of this page) with this information. Curious - does it work on an actual device, even if it doesn't work in the simulator? Thanks!

Good question. I tried running on the device but I received a code signing error:

/Users/kiel.gillard/Library/Developer/Xcode/DerivedData/Alfred-adlymjyjtksujwbgrfamofhzhuck/Build/Products/Debug-iphoneos/AFRUITests-Runner.app/PlugIns/AFRUITests.xctest: No such file or directory
Command /usr/bin/codesign failed with exit code 1


The file indeed does not exist. Rather, an AFRUITests.app package exists in the directory instead and that app package merely contains an Info.plist file (it's missing an executable).


Kiel

Time to file that bug report, if you haven't already. Would also make sense to stay on top of Xcode 7.1 betas, to see if any subsequent bug fixing resolves your issue. Thanks!

radar://22775295

Thanks!

I'm really keen to get this working.


I didn't want to simply file a bug report into the radar void and hope the bug gets fixed in some future, undetermined version. So I submitted a DTS request with the reference number 628664524 in the hope that I can get any possible solutions sooner.

UI Testing doesn't launch app
 
 
Q