Do NOT use direct launch when video recording is enabled in Xcode 10
Summary: See title. In Xcode 10 video recording doesn't work on direct launched simulator, but works on simulators launched Simulator.app, so we don't use direct launch in this case. Reviewed By: lawrencelomax Differential Revision: D10147771 fbshipit-source-id: aea7b735e440148b7a32debcb5a6766830953398
This commit is contained in:
Родитель
88aefcc29a
Коммит
a913056419
|
@ -64,6 +64,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
*/
|
||||
@property (nonatomic, assign, readonly, class) BOOL isXcode9OrGreater;
|
||||
|
||||
/**
|
||||
YES if Xcode 10 or greater, NO Otherwise.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly, class) BOOL isXcode10OrGreater;
|
||||
|
||||
/**
|
||||
YES if passing a custom SimDeviceSet to the Simulator App is Supported.
|
||||
*/
|
||||
|
|
|
@ -97,6 +97,11 @@
|
|||
return [FBXcodeConfiguration.xcodeVersionNumber compare:[NSDecimalNumber decimalNumberWithString:@"9.0"]] != NSOrderedAscending;
|
||||
}
|
||||
|
||||
+ (BOOL)isXcode10OrGreater
|
||||
{
|
||||
return [FBXcodeConfiguration.xcodeVersionNumber compare:[NSDecimalNumber decimalNumberWithString:@"10.0"]] != NSOrderedAscending;
|
||||
}
|
||||
|
||||
+ (BOOL)supportsCustomDeviceSets
|
||||
{
|
||||
// Prior to Xcode 7, 'iOS Simulator.app' calls `+[SimDeviceSet defaultSet]` directly
|
||||
|
|
|
@ -82,9 +82,21 @@
|
|||
|
||||
- (FBFuture<FBSimulator *> *)fetchSimulatorForApplicationTest:(FBXCTestDestinationiPhoneSimulator *)destination
|
||||
{
|
||||
FBSimulatorBootOptions options = FBSimulatorBootOptionsEnableDirectLaunch | FBSimulatorBootOptionsVerifyUsable;
|
||||
|
||||
if (FBXcodeConfiguration.isXcode10OrGreater) {
|
||||
NSMutableDictionary<NSString *, NSString *> *environment = [NSProcessInfo.processInfo.environment mutableCopy];
|
||||
NSString *videoRecordingPath = environment[@"FBXCTEST_VIDEO_RECORDING_PATH"];
|
||||
if (videoRecordingPath != nil) {
|
||||
// rdar://44907260
|
||||
// In Xcode 10, we need to launch Simulator.app to setup simulator properly for enabling video recording.
|
||||
options &= ~FBSimulatorBootOptionsEnableDirectLaunch;
|
||||
}
|
||||
}
|
||||
|
||||
FBSimulatorBootConfiguration *bootConfiguration = [[FBSimulatorBootConfiguration
|
||||
defaultConfiguration]
|
||||
withOptions:FBSimulatorBootOptionsEnableDirectLaunch | FBSimulatorBootOptionsVerifyUsable];
|
||||
withOptions:options];
|
||||
|
||||
return [[self
|
||||
fetchSimulatorForLogicTest:destination]
|
||||
|
|
Загрузка…
Ссылка в новой задаче