用simctl运行XCTest包

我有一个XCTest包,我可以通过使用simctl在模拟器上运行xcode。 我正在使用带有以下环境variables的iPhone 6 iOS 9.1模拟器:

 export SIMCTL_CHILD_TestBundleLocation="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator/Tests.xctest" export SIMCTL_CHILD_XCInjectBundle="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator/Tests.xctest" export SIMCTL_CHILD_XCInjectBundleInto="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator/ios_app.app/ios_app" export SIMCTL_CHILD_XCTestConfigurationFilePath="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator/Tests.xctest/Tests-7025D700-AA6C-4343-9C7A-92F9CC3A1C42.xctestconfiguration" export SIMCTL_CHILD_DYLD_LIBRARY_PATH="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks" export SIMCTL_CHILD_DYLD_FRAMEWORK_PATH="/Users/User/ios_app/DerivedData/primus/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks" 

该应用程序已经安装在模拟器上,模拟器正在运行,我运行:

 xcrun simctl launch booted uk.co.company.ios.app -NSTreatUnknownArgumentsAsOpen NO -ApplePersistenceIgnoreState YES -XCTest All 

应用程序启动,从模拟器日志中我可以看到,XCTest包加载,但testing不运行。 我注销了似乎停止的地方,并有一个私人方法_checkForTestManager ,更具体地说_checkManagerForDaemonStateAndConnectIfAvailable 。 从我可以告诉XCTest试图连接到testmanagerd但失败。 所以我试着在模拟器上用kickstarting testmanagerd

 xcrun simctl spawn booted launchctl kickstart system/com.apple.testmanagerd 

但是这似乎对运行的testing没有影响,但是我在模拟器日志中看到了一些额外的输出:

 testmanagerd[41610]: Received new test session connection (-[XCTestManager listener:shouldAcceptNewConnection:]) testmanagerd[41610]: Initial orientation 0 testmanagerd[41610]: Test session <__NSConcreteUUID 0x7fd2bb804a00> 7025D700-AA6C-4343-9C7A-92F9CC3A1C42 requested socket (-[XCTestSession _XCT_requestSocketForSessionIdentifier:reply:]) testmanagerd[41610]: Test session <__NSConcreteUUID 0x7fd2bb804a00> 7025D700-AA6C-4343-9C7A-92F9CC3A1C42 requested socket (__57-[XCTestManager requestSocketForSessionIdentifier:reply:]_block_invoke) testmanagerd[41610]: -[XCTestManager _handleRequestForSessionWithIdentifier:] 

但是之后什么也没有。 与通过Xcode运行时相比:

 testmanagerd[41309]: Test session <__NSConcreteUUID 0x7fd162b016a0> 64B7815C-A0A2-4213-9A5E-E0BB0139F35A requested socket (-[XCTestSession _XCT_requestSocketForSessionIdentifier:reply:]) testmanagerd[41309]: Test session <__NSConcreteUUID 0x7fd162b016a0> 64B7815C-A0A2-4213-9A5E-E0BB0139F35A requested socket (__57-[XCTestManager requestSocketForSessionIdentifier:reply:]_block_invoke) testmanagerd[41309]: -[XCTestManager _handleRequestForSessionWithIdentifier:] testmanagerd[41309]: Closing IDE connection before sending socket 8 to test host. testmanagerd[41309]: -[XCIDESession closeIDEConnection:] sending barrier testmanagerd[41309]: barrier flushed, closing DTXConnection to IDE, socket will not be closed testmanagerd[41309]: Socket disconnected testmanagerd[41309]: __33-[XCTestManager closeIDESession:]_block_invoke <XCIDESession: 0x7fd160514d80> testmanagerd[41309]: Considering exiting, 1 test sessions, 0 sessions with identifiers, 0 unidentified sessions... assertiond[39075]: assertion failed: 14F1021 13B137: assertiond + 12188 [93FFE0B6-5C27-387F-B32A-6EE378BBB22A]: 0x1 testmanagerd[41309]: Sending socket 8 to test host testmanagerd[41309]: __33-[XCTestManager closeIDESession:]_block_invoke <XCIDESession: 0x7fd160514d80> testmanagerd[41309]: Considering exiting, 1 test sessions, 0 sessions with identifiers, 0 unidentified sessions... testmanagerd[41309]: IDE connected over socket 7 (__47-[XCTestManagerIDEServer initWithListenSocket:]_block_invoke) testmanagerd[41309]: Created session with socket 7 testmanagerd[41309]: Handling a proxy request from the IDE testmanagerd[41309]: -[XCIDESession _IDE_initiateControlSessionForTestProcessID:] 41398 testmanagerd[41309]: Set control session <XCIDESession: 0x7fd160716f60> 

这样可以通过simctl来运行testing吗?