diff --git a/FBControlCore/Configuration/FBAgentLaunchConfiguration.h b/FBControlCore/Configuration/FBAgentLaunchConfiguration.h index 2e8b6cd39..0253d117e 100644 --- a/FBControlCore/Configuration/FBAgentLaunchConfiguration.h +++ b/FBControlCore/Configuration/FBAgentLaunchConfiguration.h @@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, FBAgentLaunchMode) { @interface FBAgentLaunchConfiguration : FBProcessLaunchConfiguration /** - Creates and returns a new Configuration with the provided parameters + The designated initializer. @param launchPath the path to the executable to launch. @param arguments an array-of-strings of arguments to the process. Must not be nil. @@ -35,7 +35,7 @@ typedef NS_ENUM(NSUInteger, FBAgentLaunchMode) { @param mode the launch mode to use. @return a new Configuration Object with the arguments applied. */ -+ (instancetype)configurationWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments environment:(NSDictionary *)environment output:(FBProcessOutputConfiguration *)output mode:(FBAgentLaunchMode)mode; +- (instancetype)initWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments environment:(NSDictionary *)environment output:(FBProcessOutputConfiguration *)output mode:(FBAgentLaunchMode)mode; /** The Binary Path of the agent to Launch. diff --git a/FBControlCore/Configuration/FBAgentLaunchConfiguration.m b/FBControlCore/Configuration/FBAgentLaunchConfiguration.m index 14328ef42..4ff89e4fe 100644 --- a/FBControlCore/Configuration/FBAgentLaunchConfiguration.m +++ b/FBControlCore/Configuration/FBAgentLaunchConfiguration.m @@ -12,13 +12,6 @@ @implementation FBAgentLaunchConfiguration -+ (instancetype)configurationWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments environment:(NSDictionary *)environment output:(FBProcessOutputConfiguration *)output mode:(FBAgentLaunchMode)mode -{ - if (!launchPath || !arguments || !environment) { - return nil; - } - return [[self alloc] initWithLaunchPath:launchPath arguments:arguments environment:environment output:output mode:mode]; -} - (instancetype)initWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments environment:(NSDictionary *)environment output:(FBProcessOutputConfiguration *)output mode:(FBAgentLaunchMode)mode { self = [super initWithArguments:arguments environment:environment output:output]; diff --git a/FBSimulatorControl/Commands/FBSimulatorLaunchCtlCommands.m b/FBSimulatorControl/Commands/FBSimulatorLaunchCtlCommands.m index 8cb45042d..531632610 100644 --- a/FBSimulatorControl/Commands/FBSimulatorLaunchCtlCommands.m +++ b/FBSimulatorControl/Commands/FBSimulatorLaunchCtlCommands.m @@ -243,8 +243,8 @@ + (NSString *)extractServiceNameFromListLine:(NSString *)line processIdentifierO - (FBFuture *)runWithArguments:(NSArray *)arguments { // Construct a Launch Configuration for launchctl we'll use the 'list' command. - FBAgentLaunchConfiguration *launchConfiguration = [FBAgentLaunchConfiguration - configurationWithLaunchPath:self.launchctlLaunchPath + FBAgentLaunchConfiguration *launchConfiguration = [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:self.launchctlLaunchPath arguments:arguments environment:@{} output:FBProcessOutputConfiguration.outputToDevNull diff --git a/FBSimulatorControl/Commands/FBSimulatorLogCommands.m b/FBSimulatorControl/Commands/FBSimulatorLogCommands.m index c7e85b4be..d9da461ec 100644 --- a/FBSimulatorControl/Commands/FBSimulatorLogCommands.m +++ b/FBSimulatorControl/Commands/FBSimulatorLogCommands.m @@ -70,8 +70,8 @@ - (instancetype)initWithSimulator:(FBSimulator *)simulator return [FBSimulatorError failFutureWithError:error]; } - FBAgentLaunchConfiguration *configuration = [FBAgentLaunchConfiguration - configurationWithLaunchPath:launchPath + FBAgentLaunchConfiguration *configuration = [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:launchPath arguments:arguments environment:@{} output:output diff --git a/FBSimulatorControl/Management/FBSimulatorBridge.m b/FBSimulatorControl/Management/FBSimulatorBridge.m index ebab159e8..8baae254c 100644 --- a/FBSimulatorControl/Management/FBSimulatorBridge.m +++ b/FBSimulatorControl/Management/FBSimulatorBridge.m @@ -125,8 +125,8 @@ + (NSString *)portNameForSimulator:(FBSimulator *)simulator return [FBFuture futureWithError:error]; } - FBAgentLaunchConfiguration *config = [FBAgentLaunchConfiguration - configurationWithLaunchPath:bridgeLaunchPath + FBAgentLaunchConfiguration *config = [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:bridgeLaunchPath arguments:@[portName] environment:@{} output:output diff --git a/FBSimulatorControl/Strategies/FBDefaultsModificationStrategy.m b/FBSimulatorControl/Strategies/FBDefaultsModificationStrategy.m index 124399e95..4d293d598 100644 --- a/FBSimulatorControl/Strategies/FBDefaultsModificationStrategy.m +++ b/FBSimulatorControl/Strategies/FBDefaultsModificationStrategy.m @@ -102,8 +102,8 @@ - (NSString *)defaultsBinary - (FBFuture *)performDefaultsCommandWithArguments:(NSArray *)arguments { // Make the Launch Config - FBAgentLaunchConfiguration *configuration = [FBAgentLaunchConfiguration - configurationWithLaunchPath:self.defaultsBinary + FBAgentLaunchConfiguration *configuration = [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:self.defaultsBinary arguments:arguments environment:@{} output:FBProcessOutputConfiguration.outputToDevNull diff --git a/FBSimulatorControl/Strategies/FBSimulatorXCTestProcessExecutor.m b/FBSimulatorControl/Strategies/FBSimulatorXCTestProcessExecutor.m index a19cf75a9..cffa133f9 100644 --- a/FBSimulatorControl/Strategies/FBSimulatorXCTestProcessExecutor.m +++ b/FBSimulatorControl/Strategies/FBSimulatorXCTestProcessExecutor.m @@ -55,8 +55,8 @@ - (instancetype)initWithSimulator:(FBSimulator *)simulator shims:(FBXCTestShimCo return [FBFuture futureWithError:error]; } - FBAgentLaunchConfiguration *configuration = [FBAgentLaunchConfiguration - configurationWithLaunchPath:launchPath + FBAgentLaunchConfiguration *configuration = [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:launchPath arguments:arguments environment:environment output:output diff --git a/FBSimulatorControlTests/Fixtures/FBSimulatorControlFixtures.m b/FBSimulatorControlTests/Fixtures/FBSimulatorControlFixtures.m index 8b9b2738e..ac3cde968 100644 --- a/FBSimulatorControlTests/Fixtures/FBSimulatorControlFixtures.m +++ b/FBSimulatorControlTests/Fixtures/FBSimulatorControlFixtures.m @@ -139,8 +139,8 @@ - (FBApplicationLaunchConfiguration *)safariAppLaunchWithMode:(FBApplicationLaun - (FBAgentLaunchConfiguration *)agentLaunch1 { - return [FBAgentLaunchConfiguration - configurationWithLaunchPath:[FBBinaryDescriptor binaryWithPath:NSProcessInfo.processInfo.arguments[0] error:nil].path + return [[FBAgentLaunchConfiguration alloc] + initWithLaunchPath:[FBBinaryDescriptor binaryWithPath:NSProcessInfo.processInfo.arguments[0] error:nil].path arguments:@[@"BINGBONG"] environment:@{@"FIB" : @"BLE"} output:FBProcessOutputConfiguration.outputToDevNull