├── .gitignore ├── FBSimulatorCLI ├── AppDelegate.h ├── AppDelegate.m ├── ArgumentParser.h ├── ArgumentParser.m ├── ControlHandler.swift ├── Either.swift ├── FBSimulatorClient-Bridging-Header.h ├── Frameworks │ └── FBSimulatorControl.framework │ │ ├── FBSimulatorControl │ │ ├── Headers │ │ ├── Resources │ │ └── Versions │ │ ├── A │ │ ├── FBSimulatorControl │ │ ├── Headers │ │ │ ├── FBConcurrentCollectionOperations.h │ │ │ ├── FBCoreSimulatorNotifier.h │ │ │ ├── FBDispatchSourceNotifier.h │ │ │ ├── FBInteraction+Private.h │ │ │ ├── FBInteraction.h │ │ │ ├── FBProcessLaunchConfiguration+Helpers.h │ │ │ ├── FBProcessLaunchConfiguration+Private.h │ │ │ ├── FBProcessLaunchConfiguration.h │ │ │ ├── FBSimulator+Private.h │ │ │ ├── FBSimulator+Queries.h │ │ │ ├── FBSimulator.h │ │ │ ├── FBSimulatorApplication.h │ │ │ ├── FBSimulatorConfiguration+Convenience.h │ │ │ ├── FBSimulatorConfiguration+CoreSimulator.h │ │ │ ├── FBSimulatorConfiguration+Private.h │ │ │ ├── FBSimulatorConfiguration.h │ │ │ ├── FBSimulatorControl+Private.h │ │ │ ├── FBSimulatorControl.h │ │ │ ├── FBSimulatorControlConfiguration.h │ │ │ ├── FBSimulatorControlStaticConfiguration.h │ │ │ ├── FBSimulatorError.h │ │ │ ├── FBSimulatorInteraction+Private.h │ │ │ ├── FBSimulatorInteraction.h │ │ │ ├── FBSimulatorLogger.h │ │ │ ├── FBSimulatorLogs+Private.h │ │ │ ├── FBSimulatorLogs.h │ │ │ ├── FBSimulatorPool+Private.h │ │ │ ├── FBSimulatorPool.h │ │ │ ├── FBSimulatorPredicates.h │ │ │ ├── FBSimulatorProcess+Private.h │ │ │ ├── FBSimulatorProcess.h │ │ │ ├── FBSimulatorSession+Convenience.h │ │ │ ├── FBSimulatorSession+Private.h │ │ │ ├── FBSimulatorSession.h │ │ │ ├── FBSimulatorSessionInteraction+Diagnostics.h │ │ │ ├── FBSimulatorSessionInteraction+Private.h │ │ │ ├── FBSimulatorSessionInteraction.h │ │ │ ├── FBSimulatorSessionLifecycle.h │ │ │ ├── FBSimulatorSessionState+Private.h │ │ │ ├── FBSimulatorSessionState+Queries.h │ │ │ ├── FBSimulatorSessionState.h │ │ │ ├── FBSimulatorSessionStateGenerator.h │ │ │ ├── FBSimulatorVideoRecorder.h │ │ │ ├── FBSimulatorWindowHelpers.h │ │ │ ├── FBSimulatorWindowTiler.h │ │ │ ├── FBSimulatorWindowTilingStrategy.h │ │ │ ├── FBTask+Private.h │ │ │ ├── FBTask.h │ │ │ ├── FBTaskExecutor+Convenience.h │ │ │ ├── FBTaskExecutor+Private.h │ │ │ ├── FBTaskExecutor.h │ │ │ ├── FBTerminationHandle.h │ │ │ ├── FBWritableLog+Private.h │ │ │ ├── FBWritableLog.h │ │ │ └── NSRunLoop+SimulatorControlAdditions.h │ │ └── Resources │ │ │ ├── Info.plist │ │ │ └── libShimulator.dylib │ │ └── Current ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── KillRequestHandler.swift ├── LaunchRequestHandler.swift ├── RequestHandler.swift ├── SimulatorController.h ├── SimulatorController.m ├── WebServer.swift └── main.m ├── FBSimulatorCLITests └── Info.plist ├── FBSimulatorClient.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── FBSimulatorClient.xcworkspace └── contents.xcworkspacedata ├── Frameworks └── FBSimulatorControl.framework │ ├── FBSimulatorControl │ ├── Headers │ ├── Resources │ └── Versions │ ├── A │ ├── FBSimulatorControl │ ├── Headers │ │ ├── FBConcurrentCollectionOperations.h │ │ ├── FBCoreSimulatorNotifier.h │ │ ├── FBDispatchSourceNotifier.h │ │ ├── FBInteraction+Private.h │ │ ├── FBInteraction.h │ │ ├── FBProcessLaunchConfiguration+Helpers.h │ │ ├── FBProcessLaunchConfiguration+Private.h │ │ ├── FBProcessLaunchConfiguration.h │ │ ├── FBSimulator+Private.h │ │ ├── FBSimulator+Queries.h │ │ ├── FBSimulator.h │ │ ├── FBSimulatorApplication.h │ │ ├── FBSimulatorConfiguration+Convenience.h │ │ ├── FBSimulatorConfiguration+CoreSimulator.h │ │ ├── FBSimulatorConfiguration+Private.h │ │ ├── FBSimulatorConfiguration.h │ │ ├── FBSimulatorControl+Private.h │ │ ├── FBSimulatorControl.h │ │ ├── FBSimulatorControlConfiguration.h │ │ ├── FBSimulatorControlStaticConfiguration.h │ │ ├── FBSimulatorError.h │ │ ├── FBSimulatorInteraction+Private.h │ │ ├── FBSimulatorInteraction.h │ │ ├── FBSimulatorLogger.h │ │ ├── FBSimulatorLogs+Private.h │ │ ├── FBSimulatorLogs.h │ │ ├── FBSimulatorPool+Private.h │ │ ├── FBSimulatorPool.h │ │ ├── FBSimulatorPredicates.h │ │ ├── FBSimulatorProcess+Private.h │ │ ├── FBSimulatorProcess.h │ │ ├── FBSimulatorSession+Convenience.h │ │ ├── FBSimulatorSession+Private.h │ │ ├── FBSimulatorSession.h │ │ ├── FBSimulatorSessionInteraction+Diagnostics.h │ │ ├── FBSimulatorSessionInteraction+Private.h │ │ ├── FBSimulatorSessionInteraction.h │ │ ├── FBSimulatorSessionLifecycle.h │ │ ├── FBSimulatorSessionState+Private.h │ │ ├── FBSimulatorSessionState+Queries.h │ │ ├── FBSimulatorSessionState.h │ │ ├── FBSimulatorSessionStateGenerator.h │ │ ├── FBSimulatorVideoRecorder.h │ │ ├── FBSimulatorWindowHelpers.h │ │ ├── FBSimulatorWindowTiler.h │ │ ├── FBSimulatorWindowTilingStrategy.h │ │ ├── FBTask+Private.h │ │ ├── FBTask.h │ │ ├── FBTaskExecutor+Convenience.h │ │ ├── FBTaskExecutor+Private.h │ │ ├── FBTaskExecutor.h │ │ ├── FBTerminationHandle.h │ │ ├── FBWritableLog+Private.h │ │ ├── FBWritableLog.h │ │ └── NSRunLoop+SimulatorControlAdditions.h │ └── Resources │ │ ├── Info.plist │ │ └── libShimulator.dylib │ └── Current ├── Podfile ├── Podfile.lock ├── README.md └── screen_shot.png /.gitignore: -------------------------------------------------------------------------------- 1 | #### joe made this: https://goel.io/joe 2 | 3 | #####=== Objective-C ===##### 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # CocoaPods 25 | # 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | Pods/ 31 | 32 | -------------------------------------------------------------------------------- /FBSimulatorCLI/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FBSimulatorCLI 4 | // 5 | // Created by Tapan Thaker on 07/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AppDelegate : NSObject 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /FBSimulatorCLI/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // FBSimulatorCLI 4 | // 5 | // Created by Tapan Thaker on 07/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ArgumentParser.h" 11 | #import "FBSimulatorClient-Swift.h" 12 | #import 13 | 14 | @interface AppDelegate () { 15 | WebServer *webserver; 16 | } 17 | 18 | @end 19 | 20 | @implementation AppDelegate 21 | 22 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 23 | 24 | NSArray *arguments = [[NSProcessInfo processInfo] arguments]; 25 | ArgumentParser *parser = [[ArgumentParser alloc]initWithArguments:arguments]; 26 | 27 | if ([parser flagExists:@"--start-server"] ) { 28 | NSString *portNumberString = [parser valueForFlag:@"--port"]; 29 | if (portNumberString != nil) { 30 | NSScanner *scanner = [NSScanner scannerWithString:portNumberString]; 31 | NSInteger portNumber; 32 | if ([scanner scanInteger:&portNumber]) { 33 | webserver = [[WebServer alloc]initWithPort:portNumber]; 34 | [webserver startServer]; 35 | } else { 36 | [NSException raise:@"Invalid port number" format:@"Invalid port number:%@",portNumberString]; 37 | } 38 | } else { 39 | [NSException raise:@"Invalid port number" format:@"Please pass a valid port number with --port argument"]; 40 | } 41 | } 42 | } 43 | 44 | 45 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 46 | // Insert code here to tear down your application 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /FBSimulatorCLI/ArgumentParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // ArgumentParser.h 3 | // FBSimulatorCLI 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ArgumentParser : NSObject 12 | 13 | - (instancetype)initWithArguments:(NSArray*)args; 14 | -(NSString*)valueForFlag:(NSString*)flag; 15 | -(BOOL)flagExists:(NSString*)flag; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /FBSimulatorCLI/ArgumentParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // ArgumentParser.m 3 | // FBSimulatorCLI 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import "ArgumentParser.h" 10 | 11 | @interface ArgumentParser (){ 12 | NSArray *arguments; 13 | } 14 | @end 15 | 16 | @implementation ArgumentParser 17 | 18 | - (instancetype)initWithArguments:(NSArray*)args 19 | { 20 | self = [super init]; 21 | if (self) { 22 | arguments = args; 23 | } 24 | return self; 25 | } 26 | 27 | -(NSString*)valueForFlag:(NSString*)flag { 28 | NSInteger i = [self indexOfFlag:flag]; 29 | if (i + 1 < arguments.count) { 30 | return arguments[i+1]; 31 | } 32 | return nil; 33 | } 34 | 35 | -(NSInteger)indexOfFlag:(NSString*)flag { 36 | for (NSInteger i = 0 ; i < arguments.count ; i++) { 37 | if ([flag isEqualToString:arguments[i]]) { 38 | return i; 39 | } 40 | } 41 | return -1; 42 | } 43 | 44 | -(BOOL)flagExists:(NSString*)flag { 45 | NSInteger i = [self indexOfFlag:flag]; 46 | if (i > 0 && i< arguments.count) { 47 | return YES; 48 | } 49 | return NO; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /FBSimulatorCLI/ControlHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExitHandler.swift 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | class ControlHandler: RequestHandler { 11 | func handle(request: Map) -> Either { 12 | 13 | let command = request["command"]; 14 | 15 | if let commandUnwrapped = command { 16 | switch commandUnwrapped { 17 | case "quit": 18 | var error : NSError? 19 | SimulatorController.sharedController().killAllSimulatorsWithError(&error) 20 | if let errorUnwrapped = error { 21 | exit(1) 22 | }else { 23 | exit(0) 24 | } 25 | default: 26 | return Either.right(NSError(domain: "com.fbsimulator.client", code: 500, userInfo: [NSLocalizedDescriptionKey : "No such command: "+commandUnwrapped])) 27 | } 28 | } else { 29 | return Either.right(NSError(domain: "com.fbsimulator.client", code: 500, userInfo: [NSLocalizedDescriptionKey : "Command parameter missing"])) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Either.swift: -------------------------------------------------------------------------------- 1 | struct Either { 2 | let left: L? 3 | let right: R? 4 | 5 | init(left: L?, right: R?) { 6 | self.left = left 7 | self.right = right 8 | } 9 | 10 | static func left(left : L) -> Either { 11 | return Either(left: left, right: nil) 12 | } 13 | 14 | static func right(right : R) -> Either { 15 | return Either(left: nil, right: right) 16 | } 17 | 18 | func either() -> Bool { 19 | return (self.left != nil) || (self.right != nil) 20 | } 21 | 22 | func isLeft() -> Bool { 23 | return self.left != nil 24 | } 25 | 26 | func isRight() -> Bool { 27 | return self.right != nil 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /FBSimulatorCLI/FBSimulatorClient-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | #import 5 | #import "SimulatorController.h" -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/FBSimulatorControl: -------------------------------------------------------------------------------- 1 | Versions/Current/FBSimulatorControl -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/FBSimulatorControl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapthaker/FBSimulatorClient/9951d0820f2e990e684ab71635e2bd6c9065306d/FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/FBSimulatorControl -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBConcurrentCollectionOperations.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Conveniences for concurent colection operations 14 | */ 15 | @interface FBConcurrentCollectionOperations : NSObject 16 | 17 | /** 18 | Generate an array of objects from indeces. Indeces where nil is returned will contain `NSNull.null` 19 | 20 | @param count the number of generations to execute 21 | @param block the block to generate objects from. 22 | */ 23 | + (NSArray *)generate:(NSInteger)count withBlock:( id(^)(NSUInteger index) )block; 24 | 25 | /** 26 | Map an array of objects concurrently. 27 | 28 | @param array the array to map. 29 | @param block the block to map objects with. 30 | */ 31 | + (NSArray *)map:(NSArray *)array withBlock:( id(^)(id object) )block; 32 | 33 | /** 34 | Map and then filter an array of objects concurrently. 35 | 36 | @param array the array to map/filter 37 | @param predicate the predicate to filter the mapped objects with. 38 | @param block the block to map objects with. 39 | */ 40 | + (NSArray *)filterMap:(NSArray *)array predicate:(NSPredicate *)predicate map:(id (^)(id))block; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBCoreSimulatorNotifier.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBSimulator; 15 | @class FBSimulatorPool; 16 | 17 | /** 18 | A class for wrapping Core Simulator Notifiers in a `FBTerminationHandle` 19 | */ 20 | @interface FBCoreSimulatorNotifier : NSObject 21 | 22 | /** 23 | Creates and returns an FBSimDeviceNotifier for the lifecycle events that SimDevice broadcasts for the provided Simulator. 24 | 25 | @param simulator the FBSimulator to relay events from. 26 | @param block the block to call when events are sent from the SimDevice. 27 | @param an instance of FBSimDeviceNotifier for later termination. 28 | */ 29 | + (instancetype)notifierForSimulator:(FBSimulator *)simulator block:(void (^)(NSDictionary *info))block; 30 | 31 | /** 32 | Creates and returns an FBSimDeviceNotifier for the lifecycle events that SimDeviceSet broadcasts for the provided Pool. 33 | 34 | @param simulator the FBSimulator to relay events from. 35 | @param block the block to call when events are sent from the SimDevice. 36 | @param an instance of FBSimDeviceNotifier for later termination. 37 | */ 38 | + (instancetype)notifierForPool:(FBSimulatorPool *)pool block:(void (^)(NSDictionary *info))block; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBDispatchSourceNotifier.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | A class for wrapping `dispatch_source` with some conveniences 16 | */ 17 | @interface FBDispatchSourceNotifier : NSObject 18 | 19 | /** 20 | Creates and returns an `FBDispatchSourceNotifier` that will call the `handler` when the provided `processIdentifier` quits 21 | 22 | @param processIdentifier the Process Identifier of the Process to Monitor 23 | @param handler the handler to call when the process exits 24 | */ 25 | + (instancetype)processTerminationNotifierForProcessIdentifier:(NSInteger)processIdentifier handler:(void (^)(FBDispatchSourceNotifier *))handler; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBInteraction () 13 | 14 | /** 15 | The NSMutableArray> to chain together. 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *interactions; 18 | 19 | /** 20 | Chains an interaction using the provided block 21 | 22 | @param block the block to perform the interaction with. Passes an NSError to return error information and the interaction for further chaining. 23 | */ 24 | - (instancetype)interact:(BOOL (^)(NSError **error, id interaction))block; 25 | 26 | /** 27 | Fails the Interaction with the provided error. 28 | 29 | @param error the error to fail the interaction with. 30 | */ 31 | - (instancetype)failWith:(NSError *)error; 32 | 33 | /** 34 | Passes the interaction. 35 | */ 36 | - (instancetype)succeed; 37 | 38 | /** 39 | Takes an NSArray> and returns an id. 40 | Any failing interaction will terminate the chain. 41 | 42 | @param interactions the interactions to chain together. 43 | */ 44 | + (id)chainInteractions:(NSArray *)interactions; 45 | 46 | @end 47 | 48 | /** 49 | Implementation of id using a block 50 | */ 51 | @interface FBInteraction_Block : NSObject 52 | 53 | @property (nonatomic, copy) BOOL (^block)(NSError **error); 54 | 55 | + (id)interactionWithBlock:( BOOL(^)(NSError **error) )block; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | Represents a failable transaction involving a Simulator. 16 | */ 17 | @protocol FBInteraction 18 | 19 | /** 20 | Perform the given interaction. 21 | 22 | @param error an errorOut if any ocurred. 23 | @returns YES if the interaction succeeded, NO otherwise. 24 | */ 25 | - (BOOL)performInteractionWithError:(NSError **)error; 26 | 27 | @end 28 | 29 | /** 30 | Overridable class for providing an interaction-based API. 31 | */ 32 | @interface FBInteraction : NSObject 33 | 34 | /** 35 | Retries the last chained interaction by `retries`, if it fails. 36 | */ 37 | - (instancetype)retry:(NSUInteger)retries; 38 | 39 | /** 40 | Ignores any failure that occurs in the last interaction if any occured. 41 | */ 42 | - (instancetype)ignoreFailure; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBProcessLaunchConfiguration+Helpers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | @interface FBProcessLaunchConfiguration (Helpers) 15 | 16 | /** 17 | Adds Environment to the Launch Configuration 18 | 19 | @param environmentAdditions the Environment to Add. Must be an NSDictionary> 20 | */ 21 | - (instancetype)withEnvironmentAdditions:(NSDictionary *)environmentAdditions; 22 | 23 | /** 24 | Adds Diagnostic Environment information to the reciever's environment configuration. 25 | 26 | @return a new Process Launch Configuration with the diagnostic environment applied. 27 | */ 28 | - (instancetype)withDiagnosticEnvironment; 29 | 30 | /** 31 | Uses DYLD_INSERT_LIBRARIES to inject a dylib into the launched application's process. 32 | 33 | @param dylibPath the File Path to the Dynamic Library. Must not be nil. 34 | */ 35 | - (instancetype)injectingLibrary:(NSString *)filePath; 36 | 37 | /** 38 | Injects the Shimulator Dylib into the launched process; 39 | */ 40 | - (instancetype)injectingShimulator; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBProcessLaunchConfiguration+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBProcessLaunchConfiguration () 13 | 14 | @property (nonatomic, copy, readwrite) NSArray *arguments; 15 | @property (nonatomic, copy, readwrite) NSDictionary *environment; 16 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 17 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 18 | 19 | @end 20 | 21 | @interface FBApplicationLaunchConfiguration () 22 | 23 | @property (nonatomic, copy, readwrite) FBSimulatorApplication *application; 24 | 25 | @end 26 | 27 | @interface FBAgentLaunchConfiguration () 28 | 29 | @property (nonatomic, copy, readwrite) FBSimulatorBinary *agentBinary; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulator+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorConfiguration; 13 | @class FBSimulatorControlConfiguration; 14 | 15 | @interface FBSimulator () 16 | 17 | @property (nonatomic, strong, readwrite) SimDevice *device; 18 | @property (nonatomic, weak, readwrite) FBSimulatorPool *pool; 19 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 20 | @property (nonatomic, copy, readwrite) FBSimulatorConfiguration *configuration; 21 | 22 | + (instancetype)inflateFromSimDevice:(SimDevice *)device configuration:(FBSimulatorConfiguration *)configuration pool:(FBSimulatorPool *)pool; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulator+Queries.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulator (Queries) 13 | 14 | /** 15 | Returns YES if the reciever has an active launchd_sim process. 16 | The Simulator.app is mostly a shell, with launchd_sim launching all the Simulator services. 17 | */ 18 | - (BOOL)hasActiveLaunchdSim; 19 | 20 | /** 21 | Returns an NSArray> of the subprocesses of launchd_sim. 22 | */ 23 | - (NSArray *)launchedProcesses; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorApplication.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Concrete value wrapper around a binary artifact. 14 | */ 15 | @interface FBSimulatorBinary : NSObject 16 | 17 | /** 18 | Makes a Binary with the given parameters. 19 | 20 | @param name The name of the executable 21 | @param path The path to the executable. 22 | @param architectures The supported architectures of the executable. 23 | @returns a new FBSimulatorBinary instance. 24 | */ 25 | + (instancetype)withName:(NSString *)name path:(NSString *)path architectures:(NSSet *)architectures; 26 | 27 | /** 28 | The name of the executable. 29 | */ 30 | @property (nonatomic, readonly, copy) NSString *name; 31 | 32 | /** 33 | The path to the executable. 34 | */ 35 | @property (nonatomic, readonly, copy) NSString *path; 36 | 37 | /** 38 | The supported architectures of the executable. 39 | */ 40 | @property (nonatomic, readonly, copy) NSSet *architectures; 41 | 42 | @end 43 | 44 | /** 45 | Concrete value wrapper around a Application artifact. 46 | */ 47 | @interface FBSimulatorApplication : NSObject 48 | 49 | /** 50 | Make an Application with the given parameters. 51 | 52 | @param path The Path to the Application Bundle. 53 | @param bundleID the Bundle ID of the Application. 54 | @param binary the Path to the binary inside the Application. 55 | @returns a new FBSimulatorApplication instance. 56 | */ 57 | + (instancetype)withName:(NSString *)name path:(NSString *)path bundleID:(NSString *)bundleID binary:(FBSimulatorBinary *)binary; 58 | 59 | /** 60 | The name of the Application. 61 | */ 62 | @property (nonatomic, readonly, copy) NSString *name; 63 | 64 | /** 65 | The path to the Application. 66 | */ 67 | @property (nonatomic, readonly, copy) NSString *path; 68 | 69 | /** 70 | The Bundle Identifier of the app, i.e. com.Facebook for Wilde. 71 | */ 72 | @property (nonatomic, readonly, copy) NSString *bundleID; 73 | 74 | /** 75 | The Binary contained within the Application 76 | */ 77 | @property (nonatomic, readonly, copy) FBSimulatorBinary *binary; 78 | 79 | @end 80 | 81 | /** 82 | Conveniences for building FBSimulatorApplication instances 83 | */ 84 | @interface FBSimulatorApplication (Helpers) 85 | 86 | /** 87 | Constructs a FBSimulatorApplication for the Application at the given path. 88 | 89 | @param path the path of the applocation to construct. 90 | @param error an error out. 91 | @returns a FBSimulatorApplication instance if one could be constructed, nil otherwise. 92 | */ 93 | + (instancetype)applicationWithPath:(NSString *)path error:(NSError **)error; 94 | 95 | /** 96 | Constructing FBSimulatorApplication instances can be expensive, this method can be used to construct them in parallel. 97 | 98 | @param paths an Array of File Paths to build FBSimulatorApplication instances for. 99 | @returns an array of FBSimulatorApplication instances from the paths, NSNull.null for instances that could not be constructed. 100 | */ 101 | + (NSArray *)simulatorApplicationsFromPaths:(NSArray *)paths; 102 | 103 | /** 104 | Returns the FBSimulatorApplication for the current version of Xcode's Simulator.app 105 | 106 | @param error an error out. 107 | */ 108 | + (instancetype)simulatorApplicationWithError:(NSError **)error; 109 | 110 | /** 111 | Returns all of the FBSimulatorApplications for the System Applications on the Simulator 112 | */ 113 | + (NSArray *)simulatorSystemApplications; 114 | 115 | /** 116 | Returns the System Application with the provided name. 117 | 118 | @param appName the System Application to fetch. 119 | @returns FBSimulatorApplication instance if one could for the given name could be found, nil otherwise. 120 | */ 121 | + (instancetype)systemApplicationNamed:(NSString *)appName; 122 | 123 | @end 124 | 125 | /** 126 | Conveniences for building FBSimulatorBinary instances 127 | */ 128 | @interface FBSimulatorBinary (Helpers) 129 | 130 | /** 131 | Returns the FBSimulatorBinary for the given binary path 132 | */ 133 | + (instancetype)binaryWithPath:(NSString *)path error:(NSError **)error; 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Some conveniences that make it easier to manipulate Simulator Configurations 14 | */ 15 | @interface FBSimulatorConfiguration (Convenience) 16 | 17 | /** 18 | Returns a new Simulator Configuration, for the oldest available OS for the current SDK. 19 | */ 20 | + (instancetype)oldestAvailableOS; 21 | 22 | /** 23 | Returns a new Simulator Configuration, for the newest available OS for the current SDK. 24 | */ 25 | + (instancetype)newestAvailableOS; 26 | 27 | /** 28 | An NSArray for available runtimes, sorted by oldest to newest. 29 | */ 30 | + (NSArray *)orderedOSVersionRuntimes; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+CoreSimulator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class SimDeviceType; 13 | @class SimRuntime; 14 | 15 | /** 16 | Adapting FBSimulatorConfiguration to CoreSimulator. 17 | */ 18 | @interface FBSimulatorConfiguration (CoreSimulator) 19 | 20 | /** 21 | The SimRuntime for the current configuration. 22 | Will return nil, if the runtime is unavailable 23 | */ 24 | @property (nonatomic, strong, readonly) SimRuntime *runtime; 25 | 26 | /** 27 | The SimRuntime for the current configuration. 28 | Will return nil, if the runtime is unavailable 29 | */ 30 | @property (nonatomic, strong, readonly) SimDeviceType *deviceType; 31 | 32 | /** 33 | The Defaults override for the Device-Specific scale key in NSUserDefaults. 34 | See 'defaults read com.apple.iphonesimulator' 35 | */ 36 | @property (nonatomic, copy, readonly) NSString *lastScaleKey; 37 | 38 | /** 39 | The Command Line switch to override the Device-Specific scale of a directly-launched the Simulator. 40 | See 'defaults read com.apple.iphonesimulator' 41 | */ 42 | @property (nonatomic, copy, readonly) NSString *lastScaleCommandLineSwitch; 43 | 44 | /** 45 | Returns a new Configuration, for the specific SimRuntime. 46 | */ 47 | - (instancetype)withRuntime:(SimRuntime *)runtime; 48 | 49 | /** 50 | Returns a new Configuration, for the specific DeviceType. 51 | */ 52 | - (instancetype)withDeviceType:(SimDeviceType *)deviceType; 53 | 54 | /** 55 | Returns an NSDictionary for the available runtimes. 56 | */ 57 | + (NSDictionary *)configurationsToAvailableRuntimes; 58 | 59 | /** 60 | Returns an NSDictionary for the available devices. 61 | */ 62 | + (NSDictionary *)configurationsToAvailableDeviceTypes; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @protocol FBSimulatorConfigurationNamedDevice 13 | 14 | - (NSString *)deviceName; 15 | 16 | @end 17 | 18 | @interface FBSimulatorConfigurationNamedDevice_iPhone4s : NSObject 19 | @end 20 | 21 | @interface FBSimulatorConfigurationNamedDevice_iPhone5 : NSObject 22 | @end 23 | 24 | @interface FBSimulatorConfigurationNamedDevice_iPhone5s : NSObject 25 | @end 26 | 27 | @interface FBSimulatorConfigurationNamedDevice_iPhone6 : NSObject 28 | @end 29 | 30 | @interface FBSimulatorConfigurationNamedDevice_iPhone6Plus : NSObject 31 | @end 32 | 33 | @interface FBSimulatorConfigurationNamedDevice_iPhone6S : NSObject 34 | @end 35 | 36 | @interface FBSimulatorConfigurationNamedDevice_iPhone6SPlus : NSObject 37 | @end 38 | 39 | @interface FBSimulatorConfigurationNamedDevice_iPad2 : NSObject 40 | @end 41 | 42 | @interface FBSimulatorConfigurationNamedDevice_iPadRetina : NSObject 43 | @end 44 | 45 | @interface FBSimulatorConfigurationNamedDevice_iPadAir : NSObject 46 | @end 47 | 48 | @interface FBSimulatorConfigurationNamedDevice_iPadAir2 : NSObject 49 | @end 50 | 51 | @interface FBSimulatorConfigurationNamedDevice_iPadPro : NSObject 52 | @end 53 | 54 | @protocol FBSimulatorConfigurationOSVersion 55 | 56 | - (NSString *)osVersion; 57 | 58 | @end 59 | 60 | @interface FBSimulatorConfigurationOSVersion_7_1 : NSObject 61 | @end 62 | 63 | @interface FBSimulatorConfigurationOSVersion_8_0 : NSObject 64 | @end 65 | 66 | @interface FBSimulatorConfigurationOSVersion_8_1 : NSObject 67 | @end 68 | 69 | @interface FBSimulatorConfigurationOSVersion_8_2 : NSObject 70 | @end 71 | 72 | @interface FBSimulatorConfigurationOSVersion_8_3 : NSObject 73 | @end 74 | 75 | @interface FBSimulatorConfigurationOSVersion_8_4 : NSObject 76 | @end 77 | 78 | @interface FBSimulatorConfigurationOSVersion_9_0 : NSObject 79 | @end 80 | 81 | @interface FBSimulatorConfigurationOSVersion_9_1 : NSObject 82 | @end 83 | 84 | @protocol FBSimulatorConfigurationScale 85 | 86 | - (NSString *)scaleString; 87 | 88 | @end 89 | 90 | @interface FBSimulatorConfigurationScale_25 : NSObject 91 | @end 92 | 93 | @interface FBSimulatorConfigurationScale_50 : NSObject 94 | @end 95 | 96 | @interface FBSimulatorConfigurationScale_75 : NSObject 97 | @end 98 | 99 | @interface FBSimulatorConfigurationScale_100 : NSObject 100 | @end 101 | 102 | @interface FBSimulatorConfiguration () 103 | 104 | @property (nonatomic, strong, readwrite) id namedDevice; 105 | @property (nonatomic, strong, readwrite) id osVersion; 106 | @property (nonatomic, strong, readwrite) id scale; 107 | @property (nonatomic, strong, readwrite) NSLocale *locale; 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | A Value object that represents the Configuration of a Simulator. 14 | 15 | Class is designed around maximum convenience for specifying a configuration. 16 | For example to specify an iPad 2 on iOS 8.2: 17 | `FBSimulatorConfiguration.iPad2.iOS_8_2`. 18 | 19 | It is also possible to specify configurations based on a NSString. 20 | This is helpful when creating a device from something specified in an Environment Variable: 21 | `[FBSimulatorConfiguration.iPhone5 iOS:NSProcessInfo.processInfo.environment[@"TARGET_OS"]]` 22 | */ 23 | @interface FBSimulatorConfiguration : NSObject 24 | 25 | #pragma mark Properties 26 | 27 | /** 28 | The Name of the Device to Simulate. Must not be nil. 29 | */ 30 | @property (nonatomic, copy, readonly) NSString *deviceName; 31 | 32 | /** 33 | A String Representation of the OS Version of the Simulator. Must not be nil. 34 | */ 35 | @property (nonatomic, copy, readonly) NSString *osVersionString; 36 | 37 | /** 38 | The Locale in which to Simulate, may be nil. 39 | */ 40 | @property (nonatomic, strong, readonly) NSLocale *locale; 41 | 42 | /** 43 | A String representing the Scale at which to launch the Simulator. 44 | */ 45 | @property (nonatomic, copy, readonly) NSString *scaleString; 46 | 47 | /** 48 | Returns the Default Configuration. 49 | The OS Version is derived from the SDK Version. 50 | */ 51 | + (instancetype)defaultConfiguration; 52 | 53 | #pragma mark Devices 54 | 55 | /** 56 | An iPhone 4s. 57 | */ 58 | + (instancetype)iPhone4s; 59 | - (instancetype)iPhone4s; 60 | 61 | /** 62 | An iPhone 5. 63 | */ 64 | + (instancetype)iPhone5; 65 | - (instancetype)iPhone5; 66 | 67 | /** 68 | An iPhone 5s. 69 | */ 70 | + (instancetype)iPhone5s; 71 | - (instancetype)iPhone5s; 72 | 73 | /** 74 | An iPhone 6. 75 | */ 76 | + (instancetype)iPhone6; 77 | - (instancetype)iPhone6; 78 | 79 | /** 80 | An iPhone 6 Plus. 81 | */ 82 | + (instancetype)iPhone6Plus; 83 | - (instancetype)iPhone6Plus; 84 | 85 | /** 86 | An iPad 2. 87 | */ 88 | + (instancetype)iPad2; 89 | - (instancetype)iPad2; 90 | 91 | /** 92 | An iPad Retina. 93 | */ 94 | + (instancetype)iPadRetina; 95 | - (instancetype)iPadRetina; 96 | 97 | /** 98 | An iPad Air. 99 | */ 100 | + (instancetype)iPadAir; 101 | - (instancetype)iPadAir; 102 | 103 | /** 104 | An iPad Air. 105 | */ 106 | + (instancetype)iPadAir2; 107 | - (instancetype)iPadAir2; 108 | 109 | /** 110 | A Device with the provided name. 111 | Will return nil, if no device with the given name could be found. 112 | */ 113 | + (instancetype)named:(NSString *)deviceType; 114 | - (instancetype)named:(NSString *)deviceType; 115 | 116 | #pragma mark OS Versions 117 | 118 | /** 119 | iOS 7.1 120 | */ 121 | - (instancetype)iOS_7_1; 122 | 123 | /** 124 | iOS 8.0 125 | */ 126 | - (instancetype)iOS_8_0; 127 | 128 | /** 129 | iOS 8.1 130 | */ 131 | - (instancetype)iOS_8_1; 132 | 133 | /** 134 | iOS 8.2 135 | */ 136 | - (instancetype)iOS_8_2; 137 | 138 | /** 139 | iOS 8.3 140 | */ 141 | - (instancetype)iOS_8_3; 142 | 143 | /** 144 | iOS 8.4 145 | */ 146 | - (instancetype)iOS_8_4; 147 | 148 | /** 149 | iOS 9.0 150 | */ 151 | - (instancetype)iOS_9_0; 152 | 153 | /** 154 | iOS Device with the given OS version. 155 | Will return nil, if no OS with the given name could be found. 156 | */ 157 | + (instancetype)iOS:(NSString *)version; 158 | 159 | /** 160 | iOS Device with the given OS version. 161 | Will return nil, if no OS with the given name could be found. 162 | */ 163 | - (instancetype)iOS:(NSString *)version; 164 | 165 | #pragma mark Device Scale 166 | 167 | /** 168 | Launch at 25% Scale. 169 | */ 170 | - (instancetype)scale25Percent; 171 | 172 | /** 173 | Launch at 50% Scale. 174 | */ 175 | - (instancetype)scale50Percent; 176 | 177 | /** 178 | Launch at 75% Scale. 179 | */ 180 | - (instancetype)scale75Percent; 181 | 182 | /** 183 | Launch at 100% Scale. 184 | */ 185 | - (instancetype)scale100Percent; 186 | 187 | #pragma mark Locale 188 | 189 | /** 190 | A new configuration with the provided locale 191 | */ 192 | - (instancetype)withLocale:(NSLocale *)locale; 193 | 194 | /** 195 | A new configuration with the provided localeIdentifier. 196 | */ 197 | - (instancetype)withLocaleNamed:(NSString *)localeIdentifier; 198 | 199 | @end 200 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorControl () 15 | 16 | @property (nonatomic, copy, readwrite) FBSimulatorControlConfiguration *configuration; 17 | 18 | @property (nonatomic, strong, readwrite) FBSimulatorSession *activeSession; 19 | @property (nonatomic, strong, readwrite) FBSimulatorPool *simulatorPool; 20 | @property (nonatomic, assign, readwrite) BOOL hasRunOnce; 21 | 22 | - (instancetype)initWithConfiguration:(FBSimulatorControlConfiguration *)configuration; 23 | - (BOOL)firstRunPreconditionsWithError:(NSError **)error; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorApplication; 13 | @class FBSimulatorConfiguration; 14 | @class FBSimulatorControlConfiguration; 15 | @class FBSimulatorPool; 16 | @class FBSimulatorSession; 17 | 18 | /** 19 | An Abstraction over the mechanics of creating, launching and cleaning-up Simulators. 20 | Currently only manages one Simulator. 21 | */ 22 | @interface FBSimulatorControl : NSObject 23 | 24 | /** 25 | Returns the Singleton `FBSimulatorControl` instance. Takes a Mandatory bucket id in setup. 26 | 27 | @param configuration the Configuration to setup the instance with. 28 | @returns a shared instance with the first configuration. 29 | */ 30 | + (instancetype)sharedInstanceWithConfiguration:(FBSimulatorControlConfiguration *)configuration; 31 | 32 | /** 33 | Creates and returns a new FBSimulatorSession instance. Does not launch the Simulator or any Applications. 34 | 35 | @param configuration the Configuration of the Simulator to Launch. 36 | @param error an outparam for describing any error that occured during the creation of the Session. 37 | @returns A new `FBSimulatorSession` instance, or nil if an error occured. 38 | */ 39 | - (FBSimulatorSession *)createSessionForSimulatorConfiguration:(FBSimulatorConfiguration *)simulatorConfiguration error:(NSError **)error; 40 | 41 | @property (nonatomic, readonly) FBSimulatorPool *simulatorPool; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControlConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorApplication; 13 | 14 | /** 15 | The default prefix for Pool-Managed Simulators 16 | */ 17 | extern NSString *const FBSimulatorControlConfigurationDefaultNamePrefix; 18 | 19 | typedef NS_OPTIONS(NSUInteger, FBSimulatorManagementOptions){ 20 | FBSimulatorManagementOptionsDeleteAllOnFirstStart = 1 << 0, 21 | FBSimulatorManagementOptionsKillSpuriousSimulatorsOnFirstStart = 1 << 1, 22 | FBSimulatorManagementOptionsIgnoreSpuriousKillFail = 1 << 2, 23 | FBSimulatorManagementOptionsDeleteOnFree = 1 << 3, 24 | FBSimulatorManagementOptionsEraseOnFree = 1 << 4, 25 | }; 26 | 27 | /** 28 | A Value object with the information required to create a Simulator Pool. 29 | */ 30 | @interface FBSimulatorControlConfiguration : NSObject 31 | 32 | /** 33 | Creates and returns a new Configuration with the provided parameters. 34 | 35 | @param simulatorApplication the FBSimulatorApplication for the Simulator.app. 36 | @param options the options for Simulator Management. 37 | @returns a new Configuration Object with the arguments applied. 38 | */ 39 | + (instancetype)configurationWithSimulatorApplication:(FBSimulatorApplication *)simulatorApplication 40 | deviceSetPath:(NSString *)deviceSetPath 41 | options:(FBSimulatorManagementOptions)options; 42 | 43 | /** 44 | The FBSimulatorApplication for the Simulator.app. 45 | */ 46 | @property (nonatomic, copy, readonly) FBSimulatorApplication *simulatorApplication; 47 | 48 | /** 49 | The Location of the SimDeviceSet. If no path is provided, the default device set will be used. 50 | */ 51 | @property (nonatomic, copy, readonly) NSString *deviceSetPath; 52 | 53 | /** 54 | The options for Simulator Management. 55 | */ 56 | @property (nonatomic, assign, readonly) FBSimulatorManagementOptions options; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControlStaticConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Environment Globals & other derived constants 14 | */ 15 | @interface FBSimulatorControlStaticConfiguration : NSObject 16 | 17 | /** 18 | The location of Xcode's Contents/Developer directory 19 | */ 20 | + (NSString *)developerDirectory; 21 | 22 | /** 23 | The SDK Version of the current Xcode Version as a Decimal Number. 24 | */ 25 | + (NSDecimalNumber *)sdkVersionNumber; 26 | 27 | /** 28 | Formatter for the SDK Version a string 29 | */ 30 | + (NSNumberFormatter *)sdkVersionNumberFormatter; 31 | 32 | /** 33 | The SDK Version of the current Xcode Version as a String. 34 | */ 35 | + (NSString *)sdkVersion; 36 | 37 | /** 38 | YES if passing a custom SimDeviceSet to the Simulator App is Supported. 39 | */ 40 | + (BOOL)supportsCustomDeviceSets; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorError.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | /** 15 | The Error Domain for FBSimulatorControl. 16 | */ 17 | extern NSString *const FBSimulatorControlErrorDomain; 18 | 19 | /** 20 | Helpers for constructing Errors representing errors in FBSimulatorControl & adding additional diagnosis. 21 | */ 22 | @interface FBSimulatorError : NSObject 23 | 24 | /** 25 | Describes the build error using the description. 26 | */ 27 | + (instancetype)describe:(NSString *)description; 28 | - (instancetype)describe:(NSString *)description; 29 | + (instancetype)describeFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 30 | - (instancetype)describeFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 31 | 32 | /* 33 | Adds the Cause of the Error. 34 | */ 35 | + (instancetype)causedBy:(NSError *)cause; 36 | - (instancetype)causedBy:(NSError *)cause; 37 | 38 | /** 39 | For returning early from failing conditions. 40 | */ 41 | - (BOOL)failBool:(NSError **)error; 42 | - (CGRect)failRect:(NSError **)error; 43 | - (id)fail:(NSError **)error; 44 | 45 | /** 46 | Attach additional diagnostic information. 47 | */ 48 | - (instancetype)extraInfo:(NSString *)key value:(id)value; 49 | 50 | /** 51 | Automatically attach Simulator diagnostic info. 52 | */ 53 | - (instancetype)inSimulator:(FBSimulator *)simulator; 54 | 55 | /** 56 | Prints a recursive description in the error. 57 | */ 58 | - (instancetype)recursiveDescription; 59 | 60 | /** 61 | Builds the Error with the applied arguments. 62 | */ 63 | - (NSError *)build; 64 | 65 | @end 66 | 67 | @interface FBSimulatorError (Constructors) 68 | 69 | /** 70 | Construct a simple error with the provided description. 71 | */ 72 | + (NSError *)errorForDescription:(NSString *)description; 73 | 74 | /** 75 | Return NO, wrapping `failureCause` in the FBSimulatorControl domain. 76 | */ 77 | + (BOOL)failBoolWithError:(NSError *)failureCause errorOut:(NSError **)errorOut; 78 | 79 | /** 80 | Return NO, wraping wrapping `failureCause` in the FBSimulatorControl domain with an additional description. 81 | */ 82 | + (BOOL)failBoolWithError:(NSError *)failureCause description:(NSString *)description errorOut:(NSError **)errorOut; 83 | 84 | /** 85 | Return NO with a simple failure message. 86 | */ 87 | + (BOOL)failBoolWithErrorMessage:(NSString *)errorMessage errorOut:(NSError **)errorOut; 88 | 89 | /** 90 | Return nil with a simple failure message. 91 | */ 92 | + (id)failWithErrorMessage:(NSString *)errorMessage errorOut:(NSError **)errorOut; 93 | 94 | /** 95 | Return nil, wrapping `failureCause` in the FBSimulatorControl domain. 96 | */ 97 | + (id)failWithError:(NSError *)failureCause errorOut:(NSError **)errorOut; 98 | 99 | /** 100 | Return nil, wrapping `failureCause` in the FBSimulatorControl domain with an additional description. 101 | */ 102 | + (id)failWithError:(NSError *)failureCause description:(NSString *)description errorOut:(NSError **)errorOut; 103 | 104 | @end 105 | 106 | /** 107 | When printing NSError, you'll only get one level of NSUnderlyingDescription, which doesn't encourage verbose errors 108 | This fixes that by printing more than just the first level's error. 109 | */ 110 | @interface NSError (RecursiveDescription) 111 | 112 | - (NSString *)recursiveUnderlyingDescription; 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorInteraction () 13 | 14 | @property (nonatomic, strong) FBSimulator *simulator; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBSimulator; 16 | @class FBSimulatorApplication; 17 | @class FBSimulatorConfiguration; 18 | 19 | /** 20 | Pre-session interactions used pre-launch of a Simulator 21 | */ 22 | @interface FBSimulatorInteraction : FBInteraction 23 | 24 | /** 25 | Returns a new Interaction for the provided Simulator. 26 | 27 | @param simulator the Simulator to interact with, must not be nil. 28 | */ 29 | + (instancetype)withSimulator:(FBSimulator *)simulator; 30 | 31 | /** 32 | Sets the locale for the simulator. 33 | 34 | @param locale the locale to set, must not be nil. 35 | */ 36 | - (instancetype)setLocale:(NSLocale *)locale; 37 | 38 | /** 39 | Authorizes the Location Settings for the provided application. 40 | 41 | @param application the Application to authorize settings for. 42 | */ 43 | - (instancetype)authorizeLocationSettingsForApplication:(FBSimulatorApplication *)application; 44 | 45 | /** 46 | Setups keyboard for simulator 47 | 1) Disables Caps Lock 48 | 2) Disables Auto Capitalize 49 | 3) Disables Auto Correction / QuickType 50 | */ 51 | - (instancetype)setupKeyboard; 52 | 53 | @end 54 | 55 | /** 56 | Some conveniences for making the interactions associated with a Simulator Configuration. 57 | */ 58 | @interface FBSimulatorInteraction (Convenience) 59 | 60 | /** 61 | Makes an interaction by: 62 | 1) Setting the Locale (if the configuration contains one) 63 | 2) Sets up the keyboard 64 | 65 | @param configuration the configuration to apply. 66 | */ 67 | - (instancetype)configureWith:(FBSimulatorConfiguration *)configuration; 68 | 69 | @end 70 | 71 | /** 72 | Helps make a more fluent API for interacting with Simulators. 73 | */ 74 | @interface FBSimulator (FBSimulatorInteraction) 75 | 76 | /** 77 | Creates an `FBSimulatorInteraction` for the reciever. 78 | */ 79 | - (FBSimulatorInteraction *)interact; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | A protocol for defining a class that recieves logger messages. 14 | */ 15 | @protocol FBSimulatorLogger 16 | 17 | - (void)logMessage:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 18 | 19 | @end 20 | 21 | @interface FBSimulatorLogger : NSObject 22 | 23 | /** 24 | An implementation of `FBSimulatorLogger` that logs to NSLog 25 | */ 26 | + (id)toNSLog; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogs+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorLogs () 13 | 14 | @property (nonatomic, strong, readwrite) FBSimulator *simulator; 15 | 16 | - (NSArray *)diagnosticReportsContents; 17 | 18 | @end 19 | 20 | @interface FBSimulatorSessionLogs () 21 | 22 | @property (nonatomic, strong, readwrite) FBSimulatorSession *session; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorSession; 14 | @class FBWritableLog; 15 | 16 | /** 17 | Exposes Simulator Logs & Diagnsotics as `FBWritableLog`s 18 | */ 19 | @interface FBSimulatorLogs : NSObject 20 | 21 | /** 22 | Creates and returns a `FBSimulatorLogs` instance. 23 | 24 | @param simulator the Simulator to Fetch logs for. 25 | @return A new `FBSimulatorLogFetcher` instance. 26 | */ 27 | + (instancetype)withSimulator:(FBSimulator *)simulator; 28 | 29 | /** 30 | The syslog of the Simulator. 31 | */ 32 | - (FBWritableLog *)systemLog; 33 | 34 | /** 35 | Crash logs of all the subprocesses that have crashed in the Simulator after the specified date. 36 | 37 | @param date the earliest to search for crash reports. If nil will find reports regardless of date. 38 | @return an NSArray of all the applicable crash reports. 39 | */ 40 | - (NSArray *)subprocessCrashesAfterDate:(NSDate *)date; 41 | 42 | @end 43 | 44 | /** 45 | Exposes Logs & Diagnsotics a Simulator & it's session as `FBWritableLog`s 46 | */ 47 | @interface FBSimulatorSessionLogs : FBSimulatorLogs 48 | 49 | /** 50 | Creates and returns a `FBSimulatorSessionLogs` instance. 51 | 52 | @param session the Session to fetch logs for. 53 | @return A new `FBSimulatorLogFetcher` instance. 54 | */ 55 | + (instancetype)withSession:(FBSimulatorSession *)session; 56 | 57 | /** 58 | Crashes that occured in the Simulator after the start of the Session. 59 | */ 60 | - (NSArray *)subprocessCrashes; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorPool+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorPool () 13 | 14 | @property (nonatomic, copy, readwrite) FBSimulatorControlConfiguration *configuration; 15 | 16 | @property (nonatomic, strong, readwrite) SimDeviceSet *deviceSet; 17 | @property (nonatomic, strong, readwrite) NSMutableOrderedSet *allocatedUDIDs; 18 | @property (nonatomic, strong, readwrite) NSRegularExpression *managedSimulatorPoolOffsetRegex; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorPredicates.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorConfiguration; 14 | @class FBSimulatorPool; 15 | 16 | /** 17 | Predicates for filtering collections of available Simulators. 18 | NSCompoundPredicate can be used to compose Predicates. 19 | */ 20 | @interface FBSimulatorPredicates : NSObject 21 | 22 | /** 23 | Predicate for Simulators that are allocated in a specific Pool. 24 | */ 25 | + (NSPredicate *)allocatedByPool:(FBSimulatorPool *)pool; 26 | 27 | /** 28 | Predicate for Simulators that are managed by a pool but not allocated. 29 | */ 30 | + (NSPredicate *)unallocatedByPool:(FBSimulatorPool *)pool; 31 | 32 | /** 33 | Predicate for Simulators that are launched. 34 | */ 35 | + (NSPredicate *)launched; 36 | 37 | /** 38 | Predicate for only the provided Simulator. 39 | */ 40 | + (NSPredicate *)only:(FBSimulator *)simulator; 41 | 42 | /** 43 | Predicate for matching SimDevices against a Configuration. 44 | */ 45 | + (NSPredicate *)matchingConfiguration:(FBSimulatorConfiguration *)configuration; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorProcess+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBUserLaunchedProcess () 13 | 14 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 15 | @property (nonatomic, copy, readwrite) NSDate *launchDate; 16 | @property (nonatomic, copy, readwrite) FBProcessLaunchConfiguration *launchConfiguration; 17 | @property (nonatomic, copy, readwrite) NSDictionary *diagnostics; 18 | 19 | @end 20 | 21 | @interface FBFoundProcess () 22 | 23 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 24 | @property (nonatomic, copy, readwrite) NSString *launchPath; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorProcess.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBProcessLaunchConfiguration; 13 | 14 | @protocol FBSimulatorProcess 15 | 16 | /** 17 | The Process Identifier for the running process 18 | */ 19 | @property (nonatomic, assign, readonly) NSInteger processIdentifier; 20 | 21 | /** 22 | The Launch Path of the running process 23 | */ 24 | @property (nonatomic, copy, readonly) NSString *launchPath; 25 | 26 | @end 27 | 28 | /** 29 | An Object representing the current state of a process launched via FBSimulatorControl 30 | Implements equality to uniquely identify a launched process. 31 | */ 32 | @interface FBUserLaunchedProcess : NSObject 33 | 34 | /** 35 | The Date the Process was launched 36 | */ 37 | @property (nonatomic, copy, readonly) NSDate *launchDate; 38 | 39 | /** 40 | The Launch Config of the Launched Process 41 | */ 42 | @property (nonatomic, copy, readonly) FBProcessLaunchConfiguration *launchConfiguration; 43 | 44 | /** 45 | A key-value store of arbitrary diagnostic information for the process 46 | */ 47 | @property (nonatomic, copy, readonly) NSDictionary *diagnostics; 48 | 49 | @end 50 | 51 | /** 52 | An Object representing the current state of a process launched automatically by the Simulator. 53 | Implements equality to uniquely identify a launched process. 54 | */ 55 | @interface FBFoundProcess : NSObject 56 | 57 | + (instancetype)withProcessIdentifier:(NSInteger)processIdentifier launchPath:(NSString *)launchPath; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBAgentLaunchConfiguration; 14 | @class FBApplicationLaunchConfiguration; 15 | 16 | /** 17 | Conveniences for starting managing the Session Lifecycle. 18 | */ 19 | @interface FBSimulatorSession (Convenience) 20 | 21 | /** 22 | Starts the Simulator Session with the configuration object. 23 | 1) Launches the Simulator 24 | 2) Installs the Application 25 | 3) Launches the Application 26 | 4) Launches the Agent 27 | 28 | @param error an Error Out for any error that occured. 29 | @returns YES if the interaction was successful, NO otherwise. 30 | */ 31 | - (BOOL)startWithAppLaunch:(FBApplicationLaunchConfiguration *)appLaunch agentLaunch:(FBAgentLaunchConfiguration *)agentLaunch error:(NSError **)error; 32 | 33 | /** 34 | Re-launches the last terminated application. 35 | */ 36 | - (BOOL)relaunchAppWithError:(NSError **)error; 37 | 38 | /** 39 | Terminates the last launched application. 40 | */ 41 | - (BOOL)terminateAppWithError:(NSError **)error; 42 | 43 | @end 44 | 45 | @interface FBSimulatorSessionInteraction (Convenience) 46 | 47 | - (instancetype)startWithAppLaunch:(FBApplicationLaunchConfiguration *)appLaunch agentLaunch:(FBAgentLaunchConfiguration *)agentLaunch; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBSimulatorSessionLifecycle; 15 | 16 | @interface FBSimulatorSession () 17 | 18 | @property (nonatomic, strong, readwrite) FBSimulator *simulator; 19 | @property (nonatomic, strong, readwrite) FBSimulatorSessionLifecycle *lifecycle; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorSessionInteraction; 14 | @class FBSimulatorSessionLogs; 15 | @class FBSimulatorSessionState; 16 | 17 | /** 18 | Represents the lifecycle of a connection to a Simulator. 19 | A Session is inert, until `start` is called. 20 | */ 21 | @interface FBSimulatorSession : NSObject 22 | 23 | /** 24 | Creates a new `FBSimulatorSession` with the provided parameters. Will not launch a session until `start:` is called. 25 | 26 | @param simulator the Simulator to manage the session for. 27 | @returns a new `FBSimulatorSession`. 28 | */ 29 | + (instancetype)sessionWithSimulator:(FBSimulator *)simulator; 30 | 31 | /** 32 | The Simulator for this session 33 | */ 34 | @property (nonatomic, strong, readonly) FBSimulator *simulator; 35 | 36 | /** 37 | Returns the Session Information for the reciever. 38 | */ 39 | @property (nonatomic, strong, readonly) FBSimulatorSessionState *state; 40 | 41 | /** 42 | Returns the Logs associated with this Session. 43 | */ 44 | @property (nonatomic, strong, readonly) FBSimulatorSessionLogs *logs; 45 | 46 | /** 47 | Returns an Interaction for Interacting with the Sessions. 48 | */ 49 | - (FBSimulatorSessionInteraction *)interact; 50 | 51 | /** 52 | Terminates the Session, freeing any allocated resources. 53 | */ 54 | - (BOOL)terminateWithError:(NSError **)error; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction+Diagnostics.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorSessionInteraction (Diagnostics) 15 | 16 | /** 17 | Uses sample(1) see what is going on in the Application. This is done asynchronously. 18 | The result is attached to the Session State. If an error occurs during the run of the sample(1), no result will be attached. 19 | 20 | @param application the Application to sample. Must be running, otherwise the interaction will error. 21 | @param durationInSeconds the duration for which to sample the Application. 22 | @param frequencyInMilliseconds the frequency with which to sample. 23 | @returns the reciever, for chaining. 24 | */ 25 | - (instancetype)sampleApplication:(FBSimulatorApplication *)application withDuration:(NSInteger)durationInSeconds frequency:(NSInteger)frequencyInMilliseconds; 26 | 27 | /** 28 | Executes a command with lldb(1). This is done asynchronously. 29 | The result is attached to the Session State. If an error occurs during the run of the lldb command, no result will be returned. 30 | 31 | @param application the Application to sample. Must be running, otherwise the interaction will fail. 32 | @param command to execute. 33 | @returns the reciever, for chaining. 34 | */ 35 | - (instancetype)onApplication:(FBSimulatorApplication *)application executeLLDBCommand:(NSString *)command; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | extern NSTimeInterval const FBSimulatorInteractionDefaultTimeout; 15 | 16 | @interface FBSimulatorSessionInteraction () 17 | 18 | @property (nonatomic, strong) FBSimulatorSession *session; 19 | 20 | /** 21 | Chains an interaction on an application process, for the given application. 22 | */ 23 | - (instancetype)application:(FBSimulatorApplication *)application interact:(BOOL (^)(NSInteger processIdentifier, NSError **error))block; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBAgentLaunchConfiguration; 15 | @class FBApplicationLaunchConfiguration; 16 | @class FBSimulator; 17 | @class FBSimulatorApplication; 18 | @class FBSimulatorBinary; 19 | @class FBSimulatorSession; 20 | @class FBSimulatorSessionLifecycle; 21 | @protocol FBSimulatorWindowTilingStrategy; 22 | 23 | /** 24 | The Concrete Interactions for a Simulator Session. 25 | Successive applications of interactions will occur in the order that they are sequenced. 26 | Interactions have no effect until `performInteractionWithError:` is called. 27 | */ 28 | @interface FBSimulatorSessionInteraction : FBInteraction 29 | 30 | /** 31 | Creates a new instance of the Interaction Builder. 32 | */ 33 | + (instancetype)builderWithSession:(FBSimulatorSession *)session; 34 | 35 | /** 36 | Boots the simulator. 37 | */ 38 | - (instancetype)bootSimulator; 39 | 40 | /** 41 | Tiles the Simulator according to the 'tilingStrategy'. 42 | */ 43 | - (instancetype)tileSimulator:(id)tilingStrategy; 44 | 45 | /** 46 | Tiles the Simulator according to the occlusion other Simulators. 47 | */ 48 | - (instancetype)tileSimulator; 49 | 50 | /** 51 | Records Video of the Simulator, until the Session is terminated. 52 | */ 53 | - (instancetype)recordVideo; 54 | 55 | /** 56 | Uploads photos to the Camera Roll of the Simulator 57 | 58 | @param param photoPaths an NSArray of File Paths for the Photos to Upload. 59 | */ 60 | - (instancetype)uploadPhotos:(NSArray *)photoPaths; 61 | 62 | /** 63 | Uploads videos to the Camera Roll of the Simulator 64 | 65 | @param videoPaths an NSArray of File Paths for the Videos to Upload. 66 | */ 67 | - (instancetype)uploadVideos:(NSArray *)videoPaths; 68 | 69 | /** 70 | Installs the given Application. 71 | */ 72 | - (instancetype)installApplication:(FBSimulatorApplication *)application; 73 | 74 | /** 75 | Launches the Application with the given Configuration. 76 | */ 77 | - (instancetype)launchApplication:(FBApplicationLaunchConfiguration *)appLaunch; 78 | 79 | /** 80 | Unix Signals the Application. 81 | */ 82 | - (instancetype)signal:(int)signal application:(FBSimulatorApplication *)application; 83 | 84 | /** 85 | Kills the provided Application. 86 | */ 87 | - (instancetype)killApplication:(FBSimulatorApplication *)application; 88 | 89 | /** 90 | Launches the provided Agent with the given Configuration. 91 | */ 92 | - (instancetype)launchAgent:(FBAgentLaunchConfiguration *)agentLaunch; 93 | 94 | /** 95 | Launches the provided Agent. 96 | */ 97 | - (instancetype)killAgent:(FBSimulatorBinary *)agent; 98 | 99 | /** 100 | Opens the provided URL on the Device 101 | */ 102 | - (instancetype)openURL:(NSURL *)url; 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorSessionState () 15 | 16 | @property (nonatomic, weak, readwrite) FBSimulatorSession *session; 17 | @property (nonatomic, copy, readwrite) FBSimulatorSessionState *previousState; 18 | 19 | @property (nonatomic, copy, readwrite) NSDate *timestamp; 20 | @property (nonatomic, assign, readwrite) FBSimulatorSessionLifecycleState lifecycle; 21 | @property (nonatomic, assign, readwrite) FBSimulatorState simulatorState; 22 | @property (nonatomic, strong, readwrite) NSMutableOrderedSet *runningProcessesSet; 23 | @property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDiagnostics; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState+Queries.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBAgentLaunchConfiguration; 15 | @class FBApplicationLaunchConfiguration; 16 | 17 | /** 18 | Queries for obtaining information from Session State 19 | */ 20 | @interface FBSimulatorSessionState (Queries) 21 | 22 | /** 23 | Returns the Application that was launched most recently. 24 | Reaches into previous states in order to find Applications that have been terminated. 25 | */ 26 | - (FBApplicationLaunchConfiguration *)lastLaunchedApplication; 27 | 28 | /** 29 | Returns the Agent that was launched most recently. 30 | Reaches into previous states in order to find Agents that have been terminated. 31 | */ 32 | - (FBAgentLaunchConfiguration *)lastLaunchedAgent; 33 | 34 | /** 35 | Returns the Process State for the given launch configuration, does not reach into previous states. 36 | */ 37 | - (FBUserLaunchedProcess *)processForLaunchConfiguration:(FBProcessLaunchConfiguration *)launchConfig; 38 | 39 | /** 40 | Returns the Process State for the given binary, does not reach into previous states. 41 | */ 42 | - (FBUserLaunchedProcess *)processForBinary:(FBSimulatorBinary *)binary; 43 | 44 | /** 45 | Returns the Process State for the given Application, does not reach into previous states. 46 | */ 47 | - (FBUserLaunchedProcess *)processForApplication:(FBSimulatorApplication *)application; 48 | 49 | /** 50 | Returns Agent State for all running agents, does not reach into previous states. 51 | */ 52 | - (NSArray *)runningAgents; 53 | 54 | /** 55 | Returns Application State for all running applications, does not reach into previous states. 56 | */ 57 | - (NSArray *)runningApplications; 58 | 59 | /** 60 | Finds the first diagnostic for the provided name, matching the application. 61 | Reaches into previous states in order to find Diagnostics for Applications that have been terminated. 62 | */ 63 | - (id)diagnosticNamed:(NSString *)name forApplication:(FBSimulatorApplication *)application; 64 | 65 | /** 66 | Reaches into previous states in order to find Diagnostics for Applications. 67 | */ 68 | - (NSDictionary *)allProcessDiagnostics; 69 | 70 | /** 71 | Describes the `simulatorState` changes. 72 | */ 73 | - (NSArray *)changesToSimulatorState; 74 | 75 | /** 76 | The date of the first session state. 77 | */ 78 | - (NSDate *)sessionStartDate; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBProcessLaunchConfiguration; 15 | @class FBSimulatorApplication; 16 | @class FBSimulatorBinary; 17 | @class FBSimulatorSession; 18 | 19 | typedef NS_ENUM(NSInteger, FBSimulatorSessionLifecycleState) { 20 | FBSimulatorSessionLifecycleStateNotStarted, 21 | FBSimulatorSessionLifecycleStateStarted, 22 | FBSimulatorSessionLifecycleStateEnded 23 | }; 24 | 25 | /** 26 | An Immutable value representing the current state of the Simulator Session. 27 | Can be used to interrogate the changes to the operation of the Simulator over time. 28 | */ 29 | @interface FBSimulatorSessionState : NSObject 30 | 31 | /** 32 | The Session that is producing this information. The Session is a reference, so represents the current state of the world. 33 | This does not behave like a value within the Session State, so it's contents may change over time. 34 | */ 35 | @property (nonatomic, weak, readonly) FBSimulatorSession *session; 36 | 37 | /** 38 | The Simulator for the Session. The Simulator is a reference, so represents the current state of the world. 39 | This does not behave like a value within the Session State, so it's contents may change over time. 40 | */ 41 | @property (nonatomic, weak, readonly) FBSimulator *simulator; 42 | 43 | /** 44 | The Timestamp for the creation of the reciever. 45 | */ 46 | @property (nonatomic, copy, readonly) NSDate *timestamp; 47 | 48 | /** 49 | The Enumerated state of the Simulator. 50 | */ 51 | @property (nonatomic, assign, readonly) FBSimulatorState simulatorState; 52 | 53 | /** 54 | The Position in the lifecycle of the session state. 55 | */ 56 | @property (nonatomic, assign, readonly) FBSimulatorSessionLifecycleState lifecycle; 57 | 58 | /** 59 | The Running processes on the Simulator. 60 | Ordering is determined by time of launch; the most recently launched process is first. 61 | Is an NSArray 62 | */ 63 | @property (nonatomic, copy, readonly) NSArray *runningProcesses; 64 | 65 | /** 66 | Per-Session Diagnostic Information. 67 | */ 68 | @property (nonatomic, copy, readonly) NSDictionary *diagnostics; 69 | 70 | /** 71 | The last state, may be nil if this is the first instance. 72 | */ 73 | @property (nonatomic, copy, readonly) FBSimulatorSessionState *previousState; 74 | 75 | /** 76 | A String description of FBSimulatorSessionLifecycleState 77 | */ 78 | + (NSString *)stringForLifecycleState:(FBSimulatorSessionLifecycleState)lifecycleState; 79 | 80 | /** 81 | A String description of the difference between the provided states. 82 | */ 83 | + (NSString *)describeDifferenceBetween:(FBSimulatorSessionState *)first and:(FBSimulatorSessionState *)second; 84 | 85 | /** 86 | Describes all the changes of the reciever, to the first change. 87 | */ 88 | - (NSString *)recursiveChangeDescription; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionStateGenerator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBProcessLaunchConfiguration; 16 | @class FBSimulatorBinary; 17 | @class FBSimulatorSession; 18 | 19 | /** 20 | An object responsible for creating `FBSimulatorSessionState` objects. 21 | Maintains the links to the previous state, so previous state can be queried. 22 | */ 23 | @interface FBSimulatorSessionStateGenerator : NSObject 24 | 25 | /** 26 | Creates and returns a new Generator for the given session 27 | */ 28 | + (instancetype)generatorWithSession:(FBSimulatorSession *)session; 29 | 30 | /** 31 | Updates the lifecycle of the session with the given enumeration 32 | */ 33 | - (instancetype)updateLifecycle:(FBSimulatorSessionLifecycleState)lifecycle; 34 | 35 | /** 36 | Updates the Simulator State. 37 | */ 38 | - (instancetype)updateSimulatorState:(FBSimulatorState)state; 39 | 40 | /** 41 | Creates Process State for the given launch config. 42 | */ 43 | - (instancetype)update:(FBProcessLaunchConfiguration *)launchConfig withProcessIdentifier:(NSInteger)processIdentifier; 44 | 45 | /** 46 | Updates the diagnostic information about for a given launched process. 47 | */ 48 | - (instancetype)update:(FBSimulatorApplication *)application withDiagnosticNamed:(NSString *)diagnosticName data:(id)data; 49 | 50 | /** 51 | Updates Diagnsotic Data. 52 | */ 53 | - (instancetype)updateWithDiagnosticNamed:(NSString *)diagnostic data:(id)data; 54 | 55 | /** 56 | Removes the Process State for the given binary. 57 | */ 58 | - (instancetype)remove:(FBSimulatorBinary *)binary; 59 | 60 | /** 61 | Returns the current Session State 62 | */ 63 | - (FBSimulatorSessionState *)currentState; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorVideoRecorder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBSimulator; 16 | 17 | /** 18 | A Class that Records Video for a given Simulator. 19 | 20 | Helpful reference from: 21 | - Apple Technical QA1740 22 | - https://github.com/square/zapp/ZappVideoController.m 23 | - https://github.com/appium/screen_recording 24 | */ 25 | @interface FBSimulatorVideoRecorder : NSObject 26 | 27 | /** 28 | Create a new FBSimulatorVideoRecorder for the provided Simulator. 29 | 30 | @param simulator the Simulator to Record. 31 | @param logger a logger to record interactions. May be nil. 32 | @return a new Video Recorder instance. 33 | */ 34 | + (instancetype)forSimulator:(FBSimulator *)simulator logger:(id)logger; 35 | 36 | /** 37 | Starts recording the Simulator to a File. 38 | Will delete and overwrite any existing video for the given filePath. 39 | 40 | @param filePath the File to Record into. 41 | @param error the error out, for any error that occurred. 42 | @returns YES if the recording started successfully, NO otherwise. 43 | */ 44 | - (BOOL)startRecordingToFilePath:(NSString *)filePath error:(NSError **)error; 45 | 46 | /** 47 | Ends recording of the Simulator. 48 | 49 | @param error the error out, for any error that occured. 50 | @return the Path of the recorded movie if successful, NO otherwise. 51 | */ 52 | - (NSString *)stopRecordingWithError:(NSError **)error; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowHelpers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBSimulator; 14 | 15 | @interface FBSimulatorWindowHelpers : NSObject 16 | 17 | /** 18 | Creates and returns an NSArray of the bounds of all Simulators except the provided Simulator. 19 | 20 | @param the simulator to exclude from the bounds fetch 21 | @return an NSArray of these bounds. 22 | */ 23 | + (NSArray *)obtainBoundsOfOtherSimulators:(FBSimulator *)simulator; 24 | 25 | /** 26 | Creates and returns an NSArray of Simulator.app Windows that belong to the Ordered Set of Simulator. 27 | The Dictionary contains Windows in format from 'Quartz Window Services' 28 | 29 | @param simulator the Simulators to find Windows For. 30 | @return array an Array of the windows that could be found for the provided Simulators. 31 | */ 32 | + (NSArray *)windowsForSimulators:(NSOrderedSet *)simulators; 33 | 34 | /** 35 | Returns the CGDirectDisplayID for the provided Simulator. 36 | 37 | @param simulator the Simulators to find the DisplayID For. 38 | @param cropRect an outparam for the Cropping Rectangle in Screen Bounds. 39 | @param screenSize the size of the Screen containing the Simulator. 40 | @return the Display ID of the Simulator or 0 if it could not be found. 41 | */ 42 | + (CGDirectDisplayID)displayIDForSimulator:(FBSimulator *)simulator cropRect:(CGRect *)cropRect screenSize:(CGSize *)screenSize; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowTiler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBSimulator; 14 | @protocol FBSimulatorWindowTilingStrategy; 15 | 16 | /** 17 | A Class responsible for tiling Simulator Windows and bringing them to the foreground. 18 | Tiling differes from 'calculating layout' in the traditional sense since it's undesirable to re-align Windows that have already been placed. 19 | Keeping a Simulator in the same position since it's first placement means that cropping a recorded video becomes trivial. 20 | */ 21 | @interface FBSimulatorWindowTiler : NSObject 22 | 23 | /** 24 | Creates and returns a new Window Tiler for the provided Simulator 25 | 26 | @param simulator the Simulator to position. 27 | @param strategy the Strategy to use for determining the position of Windows.s 28 | @return a new FBWindowTiler instance. 29 | */ 30 | + (instancetype)withSimulator:(FBSimulator *)simulator strategy:(id)strategy; 31 | 32 | /** 33 | Moves the Simuator into the foreground in the first available position that is not occluded by any other Simulator 34 | If the Window is too small then to contain this, as well as other Simulators, the position is undefined 35 | 36 | @param error an error out for any error that occurred. 37 | @return a CGRect representing the final position of the Window. CGRectNull if an error occured. 38 | */ 39 | - (CGRect)placeInForegroundWithError:(NSError **)error; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowTilingStrategy.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | /** 15 | A Protocol for defining a Strategy of the placement of Simulator Windows within the host's display. 16 | */ 17 | @protocol FBSimulatorWindowTilingStrategy 18 | 19 | /** 20 | Returns the best position for a window. 21 | 22 | @param size the Size of the Window to place. 23 | @param error an Error out for any error that occurred. 24 | @return the target position of the rectangle, or CGRectNull if there is no possible placement for the Window.s 25 | */ 26 | - (CGRect)targetPositionOfWindowWithSize:(CGSize)windowSize inScreenSize:(CGSize)screenSize withError:(NSError **)error; 27 | 28 | @end 29 | 30 | /** 31 | Implementations of Tiling Strategy 32 | */ 33 | @interface FBSimulatorWindowTilingStrategy : NSObject 34 | 35 | /** 36 | A Strategy that tiles windows horizontally based on the presence of occluding Simulators, determined by the existence of Simulators other than the 'target'. 37 | 38 | @param targetSimulator the existing Simulator to place. Simulators other than the 'targetSimulator' will be considered occluded areas. 39 | @return a Window Tiling Strategy 40 | */ 41 | + (id)horizontalOcclusionStrategy:(FBSimulator *)targetSimulator; 42 | 43 | /** 44 | A Strategy that tiles windows horizontally based on a offset in a horizontally divided screen. 45 | 46 | @param offset the offset 47 | @param total the total number of offsets 48 | @return a Window Tiling Strategy 49 | */ 50 | + (id)isolatedRegionStrategyWithOffset:(NSInteger)offset total:(NSInteger)total; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTask+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTask : NSObject 13 | 14 | @property (nonatomic, strong, readwrite) NSTask *task; 15 | @property (nonatomic, copy, readwrite) NSSet *acceptableStatusCodes; 16 | 17 | @property (nonatomic, assign, readwrite) BOOL hasTerminated; 18 | @property (nonatomic, copy, readwrite) void (^terminationHandler)(id); 19 | @property (atomic, strong, readwrite) NSError *runningError; 20 | 21 | + (instancetype)taskWithNSTask:(NSTask *)nsTask acceptableStatusCodes:(NSSet *)acceptableStatusCodes stdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 22 | 23 | - (NSTask *)decorateTask:(NSTask *)task __attribute__((objc_requires_super)); 24 | 25 | - (void)teardownTask; 26 | - (void)teardownResources; 27 | - (void)completeTermination; 28 | 29 | @end 30 | 31 | @interface FBTask_InMemory : FBTask 32 | 33 | @property (nonatomic, strong, readwrite) NSPipe *stdOutPipe; 34 | @property (nonatomic, strong, readwrite) NSMutableData *stdOutData; 35 | @property (nonatomic, strong, readwrite) NSPipe *stdErrPipe; 36 | @property (nonatomic, strong, readwrite) NSMutableData *stdErrData; 37 | 38 | @end 39 | 40 | @interface FBTask_FileBacked : FBTask 41 | 42 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 43 | @property (nonatomic, strong, readwrite) NSFileHandle *stdOutFileHandle; 44 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 45 | @property (nonatomic, strong, readwrite) NSFileHandle *stdErrFileHandle; 46 | 47 | - (instancetype)initWithTask:(NSTask *)task acceptableStatusCodes:(NSSet *)acceptableStatusCodes stdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTask.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | The Default Timeout for Tasks 16 | */ 17 | extern NSTimeInterval const FBTaskDefaultTimeout; 18 | 19 | /** 20 | Programmatic interface to a Task. 21 | */ 22 | @protocol FBTask 23 | 24 | /** 25 | Runs the reciever, returning when the Task has completed or when the timeout is hit. 26 | 27 | @param timeout the the maximum time to evaluate the task. 28 | @return the reciever, for chaining. 29 | */ 30 | - (instancetype)startSynchronouslyWithTimeout:(NSTimeInterval)timeout; 31 | 32 | /** 33 | Asynchronously launches the task, returning immediately after the Task has launched. 34 | 35 | @param handler the handler to call when the Task has terminated. 36 | @return the reciever, for chaining. 37 | */ 38 | - (instancetype)startAsynchronouslyWithTerminationHandler:(void (^)(id task))handler; 39 | 40 | /** 41 | Asynchronously launches the task, returning immediately after the Task has launched. 42 | 43 | @return the reciever, for chaining. 44 | */ 45 | - (instancetype)startAsynchronously; 46 | 47 | /** 48 | Returns the Process Identifier of the Launched Process. 49 | */ 50 | - (NSInteger)processIdentifier; 51 | 52 | /** 53 | Returns a copy of the current state of stdout. May be called from any thread. 54 | */ 55 | - (NSString *)stdOut; 56 | 57 | /** 58 | Returns a copy of the current state of stderr. May be called from any thread. 59 | */ 60 | - (NSString *)stdErr; 61 | 62 | /** 63 | Returns the Error associated with the shell command (if any). May be called from any thread. 64 | */ 65 | - (NSError *)error; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTaskExecutor (Convenience) 13 | 14 | /** 15 | @see executeShellCommand:returningError: 16 | */ 17 | - (NSString *)executeShellCommand:(NSString *)command; 18 | 19 | /** 20 | Executes the given command using the shell and returns the result. 21 | The returned string has leading/trailing whitespace and new lines trimmed. 22 | Will error if the time taken to execute the command exceeds the default timeout. 23 | 24 | @param command The shell command to execute. File Paths must be quoted or escaped. Must not be nil. 25 | @param error NSError byref to be populated if an error occurs while executing the command. May be nil. Populates the userInfo with stdout. 26 | @return The stdout from the command. Returns nil if an Error occured. 27 | */ 28 | - (NSString *)executeShellCommand:(NSString *)command returningError:(NSError **)error; 29 | 30 | /** 31 | Repeatedly runs the given command, passing the output to the block. 32 | When the block returns YES or the timeout is reached, the method will exit. 33 | If a non-zero exit code is returned, the method will exit. 34 | 35 | @param command the Command String to run. 36 | @param the Error Outparam for any error that occures 37 | @param block the predicate to verify stdOut against 38 | @return YES if the untilTrue block returns YES before the timeout, NO otherwise. 39 | */ 40 | - (BOOL)repeatedlyRunCommand:(NSString *)command withError:(NSError **)error untilTrue:( BOOL(^)(NSString *stdOut) )block; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTaskExecutor () 13 | 14 | @property (nonatomic, copy, readwrite) NSString *shellPath; 15 | @property (nonatomic, copy, readwrite) NSString *launchPath; 16 | @property (nonatomic, copy, readwrite) NSArray *arguments; 17 | @property (nonatomic, copy, readwrite) NSDictionary *environment; 18 | @property (nonatomic, copy, readwrite) NSString *shellCommand; 19 | @property (nonatomic, copy, readwrite) NSSet *acceptableStatusCodes; 20 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 21 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 22 | 23 | + (NSError *)errorForDescription:(NSString *)description; 24 | 25 | - (NSTask *)buildTask; 26 | 27 | @end 28 | 29 | @interface FBTaskExecutor_ShellTask : FBTaskExecutor 30 | 31 | @end 32 | 33 | @interface FBTaskExecutor_Task : FBTaskExecutor 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | Error Doman for all FBTaskExecutor errors 16 | */ 17 | extern NSString *const FBTaskExecutorErrorDomain; 18 | 19 | /** 20 | An interface to building FBTask instances 21 | */ 22 | @protocol FBTaskBuilder 23 | 24 | /** 25 | The Set of Return Codes that are considered non-erroneous. 26 | 27 | @param statusCodes the non-erroneous stats codes. 28 | @return a builder, with the arguments applied. 29 | */ 30 | - (instancetype)withAcceptableTerminationStatusCodes:(NSSet *)statusCodes; 31 | 32 | /** 33 | The Launch Path of the Task. Will override any shell command set with `shellCommand`. 34 | 35 | @param launchPath the Launch Path. Will remove shellCommand. 36 | @return a builder, with the arguments applied. 37 | */ 38 | - (instancetype)withLaunchPath:(NSString *)launchPath; 39 | 40 | /** 41 | The Arguments of the Task. Will override any shell command set with `shellCommand`. 42 | 43 | @param arguments the arguments for the launch path. 44 | @return a builder, with the arguments applied. 45 | */ 46 | - (instancetype)withArguments:(NSArray *)arguments; 47 | 48 | /** 49 | Adds the provided dictionary to the environment of the built task. 50 | 51 | @param environment an Environment Dictionary of NSDictionary 52 | @returns a builder, with the argument applied 53 | */ 54 | - (instancetype)withEnvironmentAdditions:(NSDictionary *)environment; 55 | 56 | /** 57 | The Shell Command to execute. Will override any launch path or arguments set with `withArguments` or `withLaunchPath`. 58 | 59 | @param shellCommand the Shell Command to execute. 60 | @return a builder, with the arguments applied. 61 | */ 62 | - (instancetype)withShellTaskCommand:(NSString *)shellCommand; 63 | 64 | /** 65 | Assigns a path for StdOut and StdErr for the built task. 66 | 67 | @param stdOutPath the path to write stdout to. Must not be nil. 68 | @param stdErrPath the path to write stderr to. May be nil. 69 | @returns a builder, with the arguments applied. 70 | */ 71 | - (instancetype)withStdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 72 | 73 | /** 74 | Builds a Task that will write stdout and stderr to the heap when the task executes. 75 | 76 | @returns a builder, with the arguments applied. 77 | */ 78 | - (instancetype)withWritingInMemory; 79 | 80 | /** 81 | Builds the Task 82 | 83 | @return a FBTask. 84 | */ 85 | - (id)build; 86 | 87 | @end 88 | 89 | /** 90 | Executes shell commands and return the results of standard output/error. 91 | */ 92 | @interface FBTaskExecutor : NSObject 93 | 94 | /** 95 | Returns the shared `FBTaskExecutor` instance. 96 | */ 97 | + (instancetype)sharedInstance; 98 | 99 | /** 100 | Creates a Task for execution. 101 | When the task is launched it will be retained until the task has terminated. 102 | Terminate must be called to free up resources. 103 | 104 | @param launchPath the Executable Path to launch. 105 | @param arguments the arguments to send to the launched tasks. 106 | @return a Task ready to be started. 107 | */ 108 | - (id)taskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments; 109 | 110 | /** 111 | Creates a Shell Command for execution. May be executed according to the `id` API. 112 | 113 | @param command the Shell Command to execute. File Paths must be quoted or escaped. Must not be nil. 114 | @return a Shell Task ready to be started. 115 | */ 116 | - (id)shellTask:(NSString *)command; 117 | 118 | /** 119 | Escapes the given path, so that it can be placed into a shell command string. 120 | 121 | @param path the File Path to escape 122 | @return a shell-escaped file path 123 | */ 124 | + (NSString *)escapePathForShell:(NSString *)path; 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTerminationHandle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Simple protocol that defines termination of something 14 | */ 15 | @protocol FBTerminationHandle 16 | 17 | - (void)terminate; 18 | 19 | @end 20 | 21 | @interface FBTerminationHandle : NSObject 22 | 23 | /** 24 | Creates a termination handle that will call the block when `terminate` is called. 25 | */ 26 | + (id)terminationHandleWithBlock:( void(^)(void) )block; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBWritableLog+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBWritableLog () 13 | 14 | @property (nonatomic, copy, readwrite) NSString *shortName; 15 | @property (nonatomic, copy, readwrite) NSString *fileType; 16 | @property (nonatomic, copy, readwrite) NSString *humanReadableName; 17 | @property (nonatomic, copy, readwrite) NSString *destination; 18 | 19 | @property (nonatomic, copy, readwrite) NSData *logData; 20 | @property (nonatomic, copy, readwrite) NSString *logString; 21 | @property (nonatomic, copy, readwrite) NSString *logPath; 22 | 23 | @end 24 | 25 | /** 26 | A representation of a Writable Log, backed by NSData. 27 | */ 28 | @interface FBWritableLog_Data : FBWritableLog 29 | 30 | @end 31 | 32 | /** 33 | A representation of a Writable Log, backed by an NSString. 34 | */ 35 | @interface FBWritableLog_String : FBWritableLog 36 | 37 | @end 38 | 39 | /** 40 | A representation of a Writable Log, backed by a File Path. 41 | */ 42 | @interface FBWritableLog_Path : FBWritableLog 43 | 44 | @end 45 | 46 | /** 47 | A representation of a Writable Log, where the log is known to not exist. 48 | */ 49 | @interface FBWritableLog_Empty : FBWritableLog 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/NSRunLoop+SimulatorControlAdditions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Conveniences to aid synchronous waiting on events, whilst not blocking other event sources. 14 | */ 15 | @interface NSRunLoop (SimulatorControlAdditions) 16 | 17 | /** 18 | Spins the Run Loop until `untilTrue` returns YES or a timeout is reached. 19 | 20 | @oaram timeout the Timeout in Seconds. 21 | @param untilTrue the condition to meet. 22 | @returns YES if the condition was met, NO if the timeout was reached first. 23 | */ 24 | - (BOOL)spinRunLoopWithTimeout:(NSTimeInterval)timeout untilTrue:( BOOL (^)(void) )untilTrue; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F27 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | FBSimulatorControl 11 | CFBundleIdentifier 12 | facebook.FBSimulatorControl 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | FBSimulatorControl 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 6E35b 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 14D125 33 | DTSDKName 34 | macosx10.10 35 | DTXcode 36 | 0640 37 | DTXcodeBuild 38 | 6E35b 39 | NSHumanReadableCopyright 40 | Copyright © 2013 Facebook, Inc. All rights reserved. 41 | 42 | 43 | -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapthaker/FBSimulatorClient/9951d0820f2e990e684ab71635e2bd6c9065306d/FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib -------------------------------------------------------------------------------- /FBSimulatorCLI/Frameworks/FBSimulatorControl.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /FBSimulatorCLI/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /FBSimulatorCLI/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.tt.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 TT. All rights reserved. 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /FBSimulatorCLI/KillRequestHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KillRequestHandler.swift 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class KillRequestHandler: RequestHandler { 12 | func handle(request: Map) -> Either { 13 | 14 | let processIdentifier = request["processIdentifier"] as String? 15 | var error : NSError?; 16 | if let processIdentifierUnwrapped = processIdentifier { 17 | let identifier = processIdentifierUnwrapped.toInt() 18 | if let uIntIndentifier = identifier { 19 | SimulatorController.sharedController().killSimulator(UInt(uIntIndentifier), withError: &error) 20 | } 21 | } else { 22 | SimulatorController.sharedController().killAllSimulatorsWithError(&error) 23 | } 24 | 25 | if let errorUnwrapped = error { 26 | return Either.right(errorUnwrapped) 27 | } else { 28 | return Either.left(["success":"true"]) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /FBSimulatorCLI/LaunchRequestHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LaunchRequestHandler.swift 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class LaunchRequestHandler : RequestHandler { 12 | 13 | func handle(request: Map) -> Either { 14 | let simulatorType = request["simulatorType"]; 15 | let appPath = request["appPath"]; 16 | var launchError : NSError? 17 | let processIdentifier = SimulatorController.sharedController().launchSimulatorOfType(simulatorType!, withApp: appPath!, withError: &launchError) 18 | 19 | if let error = launchError { 20 | return Either.right(error) 21 | } 22 | return Either.left(["processIdentifier":String(processIdentifier)]) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FBSimulatorCLI/RequestHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AbstractRequestHandler.swift 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | typealias Map = Dictionary 12 | protocol RequestHandler { 13 | func handle(request : Map) -> Either; 14 | } 15 | -------------------------------------------------------------------------------- /FBSimulatorCLI/SimulatorController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimulatorController.h 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SimulatorController : NSObject 12 | 13 | + (instancetype)sharedController; 14 | 15 | - (NSInteger)launchSimulatorOfType:(NSString*)simulatorType WithApp:(NSString*)appPath withError:(NSError **)error; 16 | - (void) killSimulator:(NSUInteger)processIdentifier withError:(NSError**)error; 17 | - (void) killAllSimulatorsWithError:(NSError**)error; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FBSimulatorCLI/SimulatorController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimulatorController.m 3 | // FBSimulatorClient 4 | // 5 | // Created by Tapan Thaker on 08/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import "SimulatorController.h" 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | 23 | @interface SimulatorController () { 24 | FBSimulatorControl *control; 25 | } 26 | 27 | @end 28 | 29 | @implementation FBSimulatorPool (Query) 30 | 31 | -(FBSimulator*) simulatorWithProcessIdentifier:(NSUInteger)processIdentifier { 32 | NSOrderedSet *simulators = self.allSimulators; 33 | for (FBSimulator *simulator in simulators) { 34 | if (simulator.processIdentifier == processIdentifier) { 35 | return simulator; 36 | } 37 | } 38 | return nil; 39 | } 40 | 41 | @end 42 | 43 | @implementation SimulatorController 44 | 45 | + (instancetype)sharedController 46 | { 47 | static dispatch_once_t onceQueue; 48 | static SimulatorController *simulatorController = nil; 49 | 50 | dispatch_once(&onceQueue, ^{ simulatorController = [[self alloc] init]; }); 51 | return simulatorController; 52 | } 53 | 54 | -(instancetype) init { 55 | self = [super init]; 56 | 57 | if (self) { 58 | FBSimulatorManagementOptions options = FBSimulatorManagementOptionsDeleteAllOnFirstStart | FBSimulatorManagementOptionsKillSpuriousSimulatorsOnFirstStart; 59 | NSError *simulatorError; 60 | FBSimulatorControlConfiguration *configuration = [FBSimulatorControlConfiguration configurationWithSimulatorApplication:[FBSimulatorApplication simulatorApplicationWithError:&simulatorError] deviceSetPath:nil options:options];; 61 | control = [[FBSimulatorControl alloc] initWithConfiguration:configuration]; 62 | } 63 | return self; 64 | } 65 | 66 | - (NSInteger)launchSimulatorOfType:(NSString*)simulatorType WithApp:(NSString*)appPath withError:(NSError **)error { 67 | NSError *simulatorApplicationError; 68 | FBSimulatorApplication *application = [FBSimulatorApplication applicationWithPath:appPath error:&simulatorApplicationError]; 69 | 70 | NSError *sessionError = nil; 71 | FBSimulatorConfiguration *simulatorConfig = [FBSimulatorConfiguration iPhone5s]; 72 | FBSimulatorSession *session = [control createSessionForSimulatorConfiguration:simulatorConfig error:&sessionError]; 73 | 74 | FBApplicationLaunchConfiguration *launchConfig = [FBApplicationLaunchConfiguration 75 | configurationWithApplication:application 76 | arguments:@[] 77 | environment:@{}]; 78 | 79 | FBSimulatorSessionInteraction *interaction = session.interact; 80 | [[[[interaction bootSimulator] installApplication:application] launchApplication:launchConfig]performInteractionWithError:&sessionError]; 81 | 82 | return session.simulator.processIdentifier; 83 | } 84 | 85 | - (void) killSimulator:(NSUInteger)processIdentifier withError:(NSError**)error{ 86 | FBSimulator *simulator = [control.simulatorPool simulatorWithProcessIdentifier:processIdentifier]; 87 | [control.simulatorPool freeSimulator:simulator error:error]; 88 | } 89 | 90 | - (void) killAllSimulatorsWithError:(NSError**)error { 91 | [control.simulatorPool killAllWithError:error]; 92 | } 93 | 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /FBSimulatorCLI/WebServer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import GCDWebServer 3 | 4 | class WebServer : NSObject { 5 | private let webserver : GCDWebServer! 6 | private let portNumber : UInt 7 | 8 | private let handlers = [ ["method":"POST","path":"/simulator/launch", "handler":LaunchRequestHandler()], 9 | ["method":"POST","path":"/simulator/kill", "handler" : KillRequestHandler()], 10 | ["method":"PUT","path":"/control", "handler" : ControlHandler()]] 11 | 12 | init(port: UInt) { 13 | webserver = GCDWebServer() 14 | portNumber = port 15 | super.init() 16 | self.addHandlers() 17 | } 18 | 19 | private func addHandlers() { 20 | for handlerMapping in handlers { 21 | let method = handlerMapping["method"] as! String 22 | let path = handlerMapping["path"] as! String 23 | let handler = handlerMapping["handler"] as! RequestHandler 24 | self.addHandler(method, path: path, handler: handler) 25 | } 26 | } 27 | 28 | private func addHandler(method: String, path: String, handler: RequestHandler) { 29 | webserver.addHandlerForMethod(method, path: path, requestClass: GCDWebServerDataRequest.self) { (request, completionCallback) -> Void in 30 | self .handleRequest(request, handler: handler, completionBlock: completionCallback) 31 | } 32 | } 33 | 34 | private func handleRequest(request : GCDWebServerRequest, handler : RequestHandler, completionBlock : GCDWebServerCompletionBlock) { 35 | 36 | let dataRequest = request as! GCDWebServerDataRequest 37 | var serializationError : NSError? 38 | let map = NSJSONSerialization.JSONObjectWithData(dataRequest.data, options: NSJSONReadingOptions.allZeros, error: &serializationError) as? Map 39 | 40 | if let error = serializationError { 41 | completionBlock(self.dataResponseForError(error)) 42 | } else { 43 | if let requestMap = map { 44 | dispatch_async(dispatch_get_main_queue(), { () -> Void in 45 | let response = handler.handle(requestMap) 46 | var dataResponse : GCDWebServerDataResponse; 47 | if response.isLeft() { 48 | dataResponse = GCDWebServerDataResponse(data: NSJSONSerialization.dataWithJSONObject(response.left!, options: NSJSONWritingOptions.allZeros, error: nil) , contentType: "application/json") 49 | dataResponse.statusCode = 200; 50 | } else { 51 | dataResponse = self.dataResponseForError(response.right!) 52 | } 53 | completionBlock(dataResponse) 54 | }) 55 | } 56 | } 57 | } 58 | 59 | private func dataResponseForError(error :NSError) -> GCDWebServerDataResponse { 60 | let errorResponse = ["success":"false","error":error.localizedDescription] 61 | let dataResponse = GCDWebServerDataResponse(data: NSJSONSerialization.dataWithJSONObject(errorResponse, options: NSJSONWritingOptions.allZeros, error: nil) , contentType: "application/json") 62 | dataResponse.statusCode = 500 63 | return dataResponse 64 | } 65 | 66 | func startServer() { 67 | webserver.startWithPort(portNumber, bonjourName: "FBSimulatorClient") 68 | } 69 | 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /FBSimulatorCLI/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FBSimulatorCLI 4 | // 5 | // Created by Tapan Thaker on 07/11/15. 6 | // Copyright (c) 2015 TT. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, const char * argv[]) { 13 | AppDelegate * delegate = [[AppDelegate alloc] init]; 14 | [[NSApplication sharedApplication] setDelegate:delegate]; 15 | [NSApp run]; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /FBSimulatorCLITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.tt.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /FBSimulatorClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FBSimulatorClient.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/FBSimulatorControl: -------------------------------------------------------------------------------- 1 | Versions/Current/FBSimulatorControl -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/FBSimulatorControl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapthaker/FBSimulatorClient/9951d0820f2e990e684ab71635e2bd6c9065306d/Frameworks/FBSimulatorControl.framework/Versions/A/FBSimulatorControl -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBConcurrentCollectionOperations.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Conveniences for concurent colection operations 14 | */ 15 | @interface FBConcurrentCollectionOperations : NSObject 16 | 17 | /** 18 | Generate an array of objects from indeces. Indeces where nil is returned will contain `NSNull.null` 19 | 20 | @param count the number of generations to execute 21 | @param block the block to generate objects from. 22 | */ 23 | + (NSArray *)generate:(NSInteger)count withBlock:( id(^)(NSUInteger index) )block; 24 | 25 | /** 26 | Map an array of objects concurrently. 27 | 28 | @param array the array to map. 29 | @param block the block to map objects with. 30 | */ 31 | + (NSArray *)map:(NSArray *)array withBlock:( id(^)(id object) )block; 32 | 33 | /** 34 | Map and then filter an array of objects concurrently. 35 | 36 | @param array the array to map/filter 37 | @param predicate the predicate to filter the mapped objects with. 38 | @param block the block to map objects with. 39 | */ 40 | + (NSArray *)filterMap:(NSArray *)array predicate:(NSPredicate *)predicate map:(id (^)(id))block; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBCoreSimulatorNotifier.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBSimulator; 15 | @class FBSimulatorPool; 16 | 17 | /** 18 | A class for wrapping Core Simulator Notifiers in a `FBTerminationHandle` 19 | */ 20 | @interface FBCoreSimulatorNotifier : NSObject 21 | 22 | /** 23 | Creates and returns an FBSimDeviceNotifier for the lifecycle events that SimDevice broadcasts for the provided Simulator. 24 | 25 | @param simulator the FBSimulator to relay events from. 26 | @param block the block to call when events are sent from the SimDevice. 27 | @param an instance of FBSimDeviceNotifier for later termination. 28 | */ 29 | + (instancetype)notifierForSimulator:(FBSimulator *)simulator block:(void (^)(NSDictionary *info))block; 30 | 31 | /** 32 | Creates and returns an FBSimDeviceNotifier for the lifecycle events that SimDeviceSet broadcasts for the provided Pool. 33 | 34 | @param simulator the FBSimulator to relay events from. 35 | @param block the block to call when events are sent from the SimDevice. 36 | @param an instance of FBSimDeviceNotifier for later termination. 37 | */ 38 | + (instancetype)notifierForPool:(FBSimulatorPool *)pool block:(void (^)(NSDictionary *info))block; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBDispatchSourceNotifier.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | A class for wrapping `dispatch_source` with some conveniences 16 | */ 17 | @interface FBDispatchSourceNotifier : NSObject 18 | 19 | /** 20 | Creates and returns an `FBDispatchSourceNotifier` that will call the `handler` when the provided `processIdentifier` quits 21 | 22 | @param processIdentifier the Process Identifier of the Process to Monitor 23 | @param handler the handler to call when the process exits 24 | */ 25 | + (instancetype)processTerminationNotifierForProcessIdentifier:(NSInteger)processIdentifier handler:(void (^)(FBDispatchSourceNotifier *))handler; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBInteraction () 13 | 14 | /** 15 | The NSMutableArray> to chain together. 16 | */ 17 | @property (nonatomic, strong) NSMutableArray *interactions; 18 | 19 | /** 20 | Chains an interaction using the provided block 21 | 22 | @param block the block to perform the interaction with. Passes an NSError to return error information and the interaction for further chaining. 23 | */ 24 | - (instancetype)interact:(BOOL (^)(NSError **error, id interaction))block; 25 | 26 | /** 27 | Fails the Interaction with the provided error. 28 | 29 | @param error the error to fail the interaction with. 30 | */ 31 | - (instancetype)failWith:(NSError *)error; 32 | 33 | /** 34 | Passes the interaction. 35 | */ 36 | - (instancetype)succeed; 37 | 38 | /** 39 | Takes an NSArray> and returns an id. 40 | Any failing interaction will terminate the chain. 41 | 42 | @param interactions the interactions to chain together. 43 | */ 44 | + (id)chainInteractions:(NSArray *)interactions; 45 | 46 | @end 47 | 48 | /** 49 | Implementation of id using a block 50 | */ 51 | @interface FBInteraction_Block : NSObject 52 | 53 | @property (nonatomic, copy) BOOL (^block)(NSError **error); 54 | 55 | + (id)interactionWithBlock:( BOOL(^)(NSError **error) )block; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | Represents a failable transaction involving a Simulator. 16 | */ 17 | @protocol FBInteraction 18 | 19 | /** 20 | Perform the given interaction. 21 | 22 | @param error an errorOut if any ocurred. 23 | @returns YES if the interaction succeeded, NO otherwise. 24 | */ 25 | - (BOOL)performInteractionWithError:(NSError **)error; 26 | 27 | @end 28 | 29 | /** 30 | Overridable class for providing an interaction-based API. 31 | */ 32 | @interface FBInteraction : NSObject 33 | 34 | /** 35 | Retries the last chained interaction by `retries`, if it fails. 36 | */ 37 | - (instancetype)retry:(NSUInteger)retries; 38 | 39 | /** 40 | Ignores any failure that occurs in the last interaction if any occured. 41 | */ 42 | - (instancetype)ignoreFailure; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBProcessLaunchConfiguration+Helpers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | @interface FBProcessLaunchConfiguration (Helpers) 15 | 16 | /** 17 | Adds Environment to the Launch Configuration 18 | 19 | @param environmentAdditions the Environment to Add. Must be an NSDictionary> 20 | */ 21 | - (instancetype)withEnvironmentAdditions:(NSDictionary *)environmentAdditions; 22 | 23 | /** 24 | Adds Diagnostic Environment information to the reciever's environment configuration. 25 | 26 | @return a new Process Launch Configuration with the diagnostic environment applied. 27 | */ 28 | - (instancetype)withDiagnosticEnvironment; 29 | 30 | /** 31 | Uses DYLD_INSERT_LIBRARIES to inject a dylib into the launched application's process. 32 | 33 | @param dylibPath the File Path to the Dynamic Library. Must not be nil. 34 | */ 35 | - (instancetype)injectingLibrary:(NSString *)filePath; 36 | 37 | /** 38 | Injects the Shimulator Dylib into the launched process; 39 | */ 40 | - (instancetype)injectingShimulator; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBProcessLaunchConfiguration+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBProcessLaunchConfiguration () 13 | 14 | @property (nonatomic, copy, readwrite) NSArray *arguments; 15 | @property (nonatomic, copy, readwrite) NSDictionary *environment; 16 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 17 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 18 | 19 | @end 20 | 21 | @interface FBApplicationLaunchConfiguration () 22 | 23 | @property (nonatomic, copy, readwrite) FBSimulatorApplication *application; 24 | 25 | @end 26 | 27 | @interface FBAgentLaunchConfiguration () 28 | 29 | @property (nonatomic, copy, readwrite) FBSimulatorBinary *agentBinary; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulator+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorConfiguration; 13 | @class FBSimulatorControlConfiguration; 14 | 15 | @interface FBSimulator () 16 | 17 | @property (nonatomic, strong, readwrite) SimDevice *device; 18 | @property (nonatomic, weak, readwrite) FBSimulatorPool *pool; 19 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 20 | @property (nonatomic, copy, readwrite) FBSimulatorConfiguration *configuration; 21 | 22 | + (instancetype)inflateFromSimDevice:(SimDevice *)device configuration:(FBSimulatorConfiguration *)configuration pool:(FBSimulatorPool *)pool; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulator+Queries.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulator (Queries) 13 | 14 | /** 15 | Returns YES if the reciever has an active launchd_sim process. 16 | The Simulator.app is mostly a shell, with launchd_sim launching all the Simulator services. 17 | */ 18 | - (BOOL)hasActiveLaunchdSim; 19 | 20 | /** 21 | Returns an NSArray> of the subprocesses of launchd_sim. 22 | */ 23 | - (NSArray *)launchedProcesses; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorApplication.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Concrete value wrapper around a binary artifact. 14 | */ 15 | @interface FBSimulatorBinary : NSObject 16 | 17 | /** 18 | Makes a Binary with the given parameters. 19 | 20 | @param name The name of the executable 21 | @param path The path to the executable. 22 | @param architectures The supported architectures of the executable. 23 | @returns a new FBSimulatorBinary instance. 24 | */ 25 | + (instancetype)withName:(NSString *)name path:(NSString *)path architectures:(NSSet *)architectures; 26 | 27 | /** 28 | The name of the executable. 29 | */ 30 | @property (nonatomic, readonly, copy) NSString *name; 31 | 32 | /** 33 | The path to the executable. 34 | */ 35 | @property (nonatomic, readonly, copy) NSString *path; 36 | 37 | /** 38 | The supported architectures of the executable. 39 | */ 40 | @property (nonatomic, readonly, copy) NSSet *architectures; 41 | 42 | @end 43 | 44 | /** 45 | Concrete value wrapper around a Application artifact. 46 | */ 47 | @interface FBSimulatorApplication : NSObject 48 | 49 | /** 50 | Make an Application with the given parameters. 51 | 52 | @param path The Path to the Application Bundle. 53 | @param bundleID the Bundle ID of the Application. 54 | @param binary the Path to the binary inside the Application. 55 | @returns a new FBSimulatorApplication instance. 56 | */ 57 | + (instancetype)withName:(NSString *)name path:(NSString *)path bundleID:(NSString *)bundleID binary:(FBSimulatorBinary *)binary; 58 | 59 | /** 60 | The name of the Application. 61 | */ 62 | @property (nonatomic, readonly, copy) NSString *name; 63 | 64 | /** 65 | The path to the Application. 66 | */ 67 | @property (nonatomic, readonly, copy) NSString *path; 68 | 69 | /** 70 | The Bundle Identifier of the app, i.e. com.Facebook for Wilde. 71 | */ 72 | @property (nonatomic, readonly, copy) NSString *bundleID; 73 | 74 | /** 75 | The Binary contained within the Application 76 | */ 77 | @property (nonatomic, readonly, copy) FBSimulatorBinary *binary; 78 | 79 | @end 80 | 81 | /** 82 | Conveniences for building FBSimulatorApplication instances 83 | */ 84 | @interface FBSimulatorApplication (Helpers) 85 | 86 | /** 87 | Constructs a FBSimulatorApplication for the Application at the given path. 88 | 89 | @param path the path of the applocation to construct. 90 | @param error an error out. 91 | @returns a FBSimulatorApplication instance if one could be constructed, nil otherwise. 92 | */ 93 | + (instancetype)applicationWithPath:(NSString *)path error:(NSError **)error; 94 | 95 | /** 96 | Constructing FBSimulatorApplication instances can be expensive, this method can be used to construct them in parallel. 97 | 98 | @param paths an Array of File Paths to build FBSimulatorApplication instances for. 99 | @returns an array of FBSimulatorApplication instances from the paths, NSNull.null for instances that could not be constructed. 100 | */ 101 | + (NSArray *)simulatorApplicationsFromPaths:(NSArray *)paths; 102 | 103 | /** 104 | Returns the FBSimulatorApplication for the current version of Xcode's Simulator.app 105 | 106 | @param error an error out. 107 | */ 108 | + (instancetype)simulatorApplicationWithError:(NSError **)error; 109 | 110 | /** 111 | Returns all of the FBSimulatorApplications for the System Applications on the Simulator 112 | */ 113 | + (NSArray *)simulatorSystemApplications; 114 | 115 | /** 116 | Returns the System Application with the provided name. 117 | 118 | @param appName the System Application to fetch. 119 | @returns FBSimulatorApplication instance if one could for the given name could be found, nil otherwise. 120 | */ 121 | + (instancetype)systemApplicationNamed:(NSString *)appName; 122 | 123 | @end 124 | 125 | /** 126 | Conveniences for building FBSimulatorBinary instances 127 | */ 128 | @interface FBSimulatorBinary (Helpers) 129 | 130 | /** 131 | Returns the FBSimulatorBinary for the given binary path 132 | */ 133 | + (instancetype)binaryWithPath:(NSString *)path error:(NSError **)error; 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Some conveniences that make it easier to manipulate Simulator Configurations 14 | */ 15 | @interface FBSimulatorConfiguration (Convenience) 16 | 17 | /** 18 | Returns a new Simulator Configuration, for the oldest available OS for the current SDK. 19 | */ 20 | + (instancetype)oldestAvailableOS; 21 | 22 | /** 23 | Returns a new Simulator Configuration, for the newest available OS for the current SDK. 24 | */ 25 | + (instancetype)newestAvailableOS; 26 | 27 | /** 28 | An NSArray for available runtimes, sorted by oldest to newest. 29 | */ 30 | + (NSArray *)orderedOSVersionRuntimes; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+CoreSimulator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class SimDeviceType; 13 | @class SimRuntime; 14 | 15 | /** 16 | Adapting FBSimulatorConfiguration to CoreSimulator. 17 | */ 18 | @interface FBSimulatorConfiguration (CoreSimulator) 19 | 20 | /** 21 | The SimRuntime for the current configuration. 22 | Will return nil, if the runtime is unavailable 23 | */ 24 | @property (nonatomic, strong, readonly) SimRuntime *runtime; 25 | 26 | /** 27 | The SimRuntime for the current configuration. 28 | Will return nil, if the runtime is unavailable 29 | */ 30 | @property (nonatomic, strong, readonly) SimDeviceType *deviceType; 31 | 32 | /** 33 | The Defaults override for the Device-Specific scale key in NSUserDefaults. 34 | See 'defaults read com.apple.iphonesimulator' 35 | */ 36 | @property (nonatomic, copy, readonly) NSString *lastScaleKey; 37 | 38 | /** 39 | The Command Line switch to override the Device-Specific scale of a directly-launched the Simulator. 40 | See 'defaults read com.apple.iphonesimulator' 41 | */ 42 | @property (nonatomic, copy, readonly) NSString *lastScaleCommandLineSwitch; 43 | 44 | /** 45 | Returns a new Configuration, for the specific SimRuntime. 46 | */ 47 | - (instancetype)withRuntime:(SimRuntime *)runtime; 48 | 49 | /** 50 | Returns a new Configuration, for the specific DeviceType. 51 | */ 52 | - (instancetype)withDeviceType:(SimDeviceType *)deviceType; 53 | 54 | /** 55 | Returns an NSDictionary for the available runtimes. 56 | */ 57 | + (NSDictionary *)configurationsToAvailableRuntimes; 58 | 59 | /** 60 | Returns an NSDictionary for the available devices. 61 | */ 62 | + (NSDictionary *)configurationsToAvailableDeviceTypes; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @protocol FBSimulatorConfigurationNamedDevice 13 | 14 | - (NSString *)deviceName; 15 | 16 | @end 17 | 18 | @interface FBSimulatorConfigurationNamedDevice_iPhone4s : NSObject 19 | @end 20 | 21 | @interface FBSimulatorConfigurationNamedDevice_iPhone5 : NSObject 22 | @end 23 | 24 | @interface FBSimulatorConfigurationNamedDevice_iPhone5s : NSObject 25 | @end 26 | 27 | @interface FBSimulatorConfigurationNamedDevice_iPhone6 : NSObject 28 | @end 29 | 30 | @interface FBSimulatorConfigurationNamedDevice_iPhone6Plus : NSObject 31 | @end 32 | 33 | @interface FBSimulatorConfigurationNamedDevice_iPhone6S : NSObject 34 | @end 35 | 36 | @interface FBSimulatorConfigurationNamedDevice_iPhone6SPlus : NSObject 37 | @end 38 | 39 | @interface FBSimulatorConfigurationNamedDevice_iPad2 : NSObject 40 | @end 41 | 42 | @interface FBSimulatorConfigurationNamedDevice_iPadRetina : NSObject 43 | @end 44 | 45 | @interface FBSimulatorConfigurationNamedDevice_iPadAir : NSObject 46 | @end 47 | 48 | @interface FBSimulatorConfigurationNamedDevice_iPadAir2 : NSObject 49 | @end 50 | 51 | @interface FBSimulatorConfigurationNamedDevice_iPadPro : NSObject 52 | @end 53 | 54 | @protocol FBSimulatorConfigurationOSVersion 55 | 56 | - (NSString *)osVersion; 57 | 58 | @end 59 | 60 | @interface FBSimulatorConfigurationOSVersion_7_1 : NSObject 61 | @end 62 | 63 | @interface FBSimulatorConfigurationOSVersion_8_0 : NSObject 64 | @end 65 | 66 | @interface FBSimulatorConfigurationOSVersion_8_1 : NSObject 67 | @end 68 | 69 | @interface FBSimulatorConfigurationOSVersion_8_2 : NSObject 70 | @end 71 | 72 | @interface FBSimulatorConfigurationOSVersion_8_3 : NSObject 73 | @end 74 | 75 | @interface FBSimulatorConfigurationOSVersion_8_4 : NSObject 76 | @end 77 | 78 | @interface FBSimulatorConfigurationOSVersion_9_0 : NSObject 79 | @end 80 | 81 | @interface FBSimulatorConfigurationOSVersion_9_1 : NSObject 82 | @end 83 | 84 | @protocol FBSimulatorConfigurationScale 85 | 86 | - (NSString *)scaleString; 87 | 88 | @end 89 | 90 | @interface FBSimulatorConfigurationScale_25 : NSObject 91 | @end 92 | 93 | @interface FBSimulatorConfigurationScale_50 : NSObject 94 | @end 95 | 96 | @interface FBSimulatorConfigurationScale_75 : NSObject 97 | @end 98 | 99 | @interface FBSimulatorConfigurationScale_100 : NSObject 100 | @end 101 | 102 | @interface FBSimulatorConfiguration () 103 | 104 | @property (nonatomic, strong, readwrite) id namedDevice; 105 | @property (nonatomic, strong, readwrite) id osVersion; 106 | @property (nonatomic, strong, readwrite) id scale; 107 | @property (nonatomic, strong, readwrite) NSLocale *locale; 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | A Value object that represents the Configuration of a Simulator. 14 | 15 | Class is designed around maximum convenience for specifying a configuration. 16 | For example to specify an iPad 2 on iOS 8.2: 17 | `FBSimulatorConfiguration.iPad2.iOS_8_2`. 18 | 19 | It is also possible to specify configurations based on a NSString. 20 | This is helpful when creating a device from something specified in an Environment Variable: 21 | `[FBSimulatorConfiguration.iPhone5 iOS:NSProcessInfo.processInfo.environment[@"TARGET_OS"]]` 22 | */ 23 | @interface FBSimulatorConfiguration : NSObject 24 | 25 | #pragma mark Properties 26 | 27 | /** 28 | The Name of the Device to Simulate. Must not be nil. 29 | */ 30 | @property (nonatomic, copy, readonly) NSString *deviceName; 31 | 32 | /** 33 | A String Representation of the OS Version of the Simulator. Must not be nil. 34 | */ 35 | @property (nonatomic, copy, readonly) NSString *osVersionString; 36 | 37 | /** 38 | The Locale in which to Simulate, may be nil. 39 | */ 40 | @property (nonatomic, strong, readonly) NSLocale *locale; 41 | 42 | /** 43 | A String representing the Scale at which to launch the Simulator. 44 | */ 45 | @property (nonatomic, copy, readonly) NSString *scaleString; 46 | 47 | /** 48 | Returns the Default Configuration. 49 | The OS Version is derived from the SDK Version. 50 | */ 51 | + (instancetype)defaultConfiguration; 52 | 53 | #pragma mark Devices 54 | 55 | /** 56 | An iPhone 4s. 57 | */ 58 | + (instancetype)iPhone4s; 59 | - (instancetype)iPhone4s; 60 | 61 | /** 62 | An iPhone 5. 63 | */ 64 | + (instancetype)iPhone5; 65 | - (instancetype)iPhone5; 66 | 67 | /** 68 | An iPhone 5s. 69 | */ 70 | + (instancetype)iPhone5s; 71 | - (instancetype)iPhone5s; 72 | 73 | /** 74 | An iPhone 6. 75 | */ 76 | + (instancetype)iPhone6; 77 | - (instancetype)iPhone6; 78 | 79 | /** 80 | An iPhone 6 Plus. 81 | */ 82 | + (instancetype)iPhone6Plus; 83 | - (instancetype)iPhone6Plus; 84 | 85 | /** 86 | An iPad 2. 87 | */ 88 | + (instancetype)iPad2; 89 | - (instancetype)iPad2; 90 | 91 | /** 92 | An iPad Retina. 93 | */ 94 | + (instancetype)iPadRetina; 95 | - (instancetype)iPadRetina; 96 | 97 | /** 98 | An iPad Air. 99 | */ 100 | + (instancetype)iPadAir; 101 | - (instancetype)iPadAir; 102 | 103 | /** 104 | An iPad Air. 105 | */ 106 | + (instancetype)iPadAir2; 107 | - (instancetype)iPadAir2; 108 | 109 | /** 110 | A Device with the provided name. 111 | Will return nil, if no device with the given name could be found. 112 | */ 113 | + (instancetype)named:(NSString *)deviceType; 114 | - (instancetype)named:(NSString *)deviceType; 115 | 116 | #pragma mark OS Versions 117 | 118 | /** 119 | iOS 7.1 120 | */ 121 | - (instancetype)iOS_7_1; 122 | 123 | /** 124 | iOS 8.0 125 | */ 126 | - (instancetype)iOS_8_0; 127 | 128 | /** 129 | iOS 8.1 130 | */ 131 | - (instancetype)iOS_8_1; 132 | 133 | /** 134 | iOS 8.2 135 | */ 136 | - (instancetype)iOS_8_2; 137 | 138 | /** 139 | iOS 8.3 140 | */ 141 | - (instancetype)iOS_8_3; 142 | 143 | /** 144 | iOS 8.4 145 | */ 146 | - (instancetype)iOS_8_4; 147 | 148 | /** 149 | iOS 9.0 150 | */ 151 | - (instancetype)iOS_9_0; 152 | 153 | /** 154 | iOS Device with the given OS version. 155 | Will return nil, if no OS with the given name could be found. 156 | */ 157 | + (instancetype)iOS:(NSString *)version; 158 | 159 | /** 160 | iOS Device with the given OS version. 161 | Will return nil, if no OS with the given name could be found. 162 | */ 163 | - (instancetype)iOS:(NSString *)version; 164 | 165 | #pragma mark Device Scale 166 | 167 | /** 168 | Launch at 25% Scale. 169 | */ 170 | - (instancetype)scale25Percent; 171 | 172 | /** 173 | Launch at 50% Scale. 174 | */ 175 | - (instancetype)scale50Percent; 176 | 177 | /** 178 | Launch at 75% Scale. 179 | */ 180 | - (instancetype)scale75Percent; 181 | 182 | /** 183 | Launch at 100% Scale. 184 | */ 185 | - (instancetype)scale100Percent; 186 | 187 | #pragma mark Locale 188 | 189 | /** 190 | A new configuration with the provided locale 191 | */ 192 | - (instancetype)withLocale:(NSLocale *)locale; 193 | 194 | /** 195 | A new configuration with the provided localeIdentifier. 196 | */ 197 | - (instancetype)withLocaleNamed:(NSString *)localeIdentifier; 198 | 199 | @end 200 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorControl () 15 | 16 | @property (nonatomic, copy, readwrite) FBSimulatorControlConfiguration *configuration; 17 | 18 | @property (nonatomic, strong, readwrite) FBSimulatorSession *activeSession; 19 | @property (nonatomic, strong, readwrite) FBSimulatorPool *simulatorPool; 20 | @property (nonatomic, assign, readwrite) BOOL hasRunOnce; 21 | 22 | - (instancetype)initWithConfiguration:(FBSimulatorControlConfiguration *)configuration; 23 | - (BOOL)firstRunPreconditionsWithError:(NSError **)error; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorApplication; 13 | @class FBSimulatorConfiguration; 14 | @class FBSimulatorControlConfiguration; 15 | @class FBSimulatorPool; 16 | @class FBSimulatorSession; 17 | 18 | /** 19 | An Abstraction over the mechanics of creating, launching and cleaning-up Simulators. 20 | Currently only manages one Simulator. 21 | */ 22 | @interface FBSimulatorControl : NSObject 23 | 24 | /** 25 | Returns the Singleton `FBSimulatorControl` instance. Takes a Mandatory bucket id in setup. 26 | 27 | @param configuration the Configuration to setup the instance with. 28 | @returns a shared instance with the first configuration. 29 | */ 30 | + (instancetype)sharedInstanceWithConfiguration:(FBSimulatorControlConfiguration *)configuration; 31 | 32 | /** 33 | Creates and returns a new FBSimulatorSession instance. Does not launch the Simulator or any Applications. 34 | 35 | @param configuration the Configuration of the Simulator to Launch. 36 | @param error an outparam for describing any error that occured during the creation of the Session. 37 | @returns A new `FBSimulatorSession` instance, or nil if an error occured. 38 | */ 39 | - (FBSimulatorSession *)createSessionForSimulatorConfiguration:(FBSimulatorConfiguration *)simulatorConfiguration error:(NSError **)error; 40 | 41 | @property (nonatomic, readonly) FBSimulatorPool *simulatorPool; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControlConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulatorApplication; 13 | 14 | /** 15 | The default prefix for Pool-Managed Simulators 16 | */ 17 | extern NSString *const FBSimulatorControlConfigurationDefaultNamePrefix; 18 | 19 | typedef NS_OPTIONS(NSUInteger, FBSimulatorManagementOptions){ 20 | FBSimulatorManagementOptionsDeleteAllOnFirstStart = 1 << 0, 21 | FBSimulatorManagementOptionsKillSpuriousSimulatorsOnFirstStart = 1 << 1, 22 | FBSimulatorManagementOptionsIgnoreSpuriousKillFail = 1 << 2, 23 | FBSimulatorManagementOptionsDeleteOnFree = 1 << 3, 24 | FBSimulatorManagementOptionsEraseOnFree = 1 << 4, 25 | }; 26 | 27 | /** 28 | A Value object with the information required to create a Simulator Pool. 29 | */ 30 | @interface FBSimulatorControlConfiguration : NSObject 31 | 32 | /** 33 | Creates and returns a new Configuration with the provided parameters. 34 | 35 | @param simulatorApplication the FBSimulatorApplication for the Simulator.app. 36 | @param options the options for Simulator Management. 37 | @returns a new Configuration Object with the arguments applied. 38 | */ 39 | + (instancetype)configurationWithSimulatorApplication:(FBSimulatorApplication *)simulatorApplication 40 | deviceSetPath:(NSString *)deviceSetPath 41 | options:(FBSimulatorManagementOptions)options; 42 | 43 | /** 44 | The FBSimulatorApplication for the Simulator.app. 45 | */ 46 | @property (nonatomic, copy, readonly) FBSimulatorApplication *simulatorApplication; 47 | 48 | /** 49 | The Location of the SimDeviceSet. If no path is provided, the default device set will be used. 50 | */ 51 | @property (nonatomic, copy, readonly) NSString *deviceSetPath; 52 | 53 | /** 54 | The options for Simulator Management. 55 | */ 56 | @property (nonatomic, assign, readonly) FBSimulatorManagementOptions options; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControlStaticConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Environment Globals & other derived constants 14 | */ 15 | @interface FBSimulatorControlStaticConfiguration : NSObject 16 | 17 | /** 18 | The location of Xcode's Contents/Developer directory 19 | */ 20 | + (NSString *)developerDirectory; 21 | 22 | /** 23 | The SDK Version of the current Xcode Version as a Decimal Number. 24 | */ 25 | + (NSDecimalNumber *)sdkVersionNumber; 26 | 27 | /** 28 | Formatter for the SDK Version a string 29 | */ 30 | + (NSNumberFormatter *)sdkVersionNumberFormatter; 31 | 32 | /** 33 | The SDK Version of the current Xcode Version as a String. 34 | */ 35 | + (NSString *)sdkVersion; 36 | 37 | /** 38 | YES if passing a custom SimDeviceSet to the Simulator App is Supported. 39 | */ 40 | + (BOOL)supportsCustomDeviceSets; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorError.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | /** 15 | The Error Domain for FBSimulatorControl. 16 | */ 17 | extern NSString *const FBSimulatorControlErrorDomain; 18 | 19 | /** 20 | Helpers for constructing Errors representing errors in FBSimulatorControl & adding additional diagnosis. 21 | */ 22 | @interface FBSimulatorError : NSObject 23 | 24 | /** 25 | Describes the build error using the description. 26 | */ 27 | + (instancetype)describe:(NSString *)description; 28 | - (instancetype)describe:(NSString *)description; 29 | + (instancetype)describeFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 30 | - (instancetype)describeFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 31 | 32 | /* 33 | Adds the Cause of the Error. 34 | */ 35 | + (instancetype)causedBy:(NSError *)cause; 36 | - (instancetype)causedBy:(NSError *)cause; 37 | 38 | /** 39 | For returning early from failing conditions. 40 | */ 41 | - (BOOL)failBool:(NSError **)error; 42 | - (CGRect)failRect:(NSError **)error; 43 | - (id)fail:(NSError **)error; 44 | 45 | /** 46 | Attach additional diagnostic information. 47 | */ 48 | - (instancetype)extraInfo:(NSString *)key value:(id)value; 49 | 50 | /** 51 | Automatically attach Simulator diagnostic info. 52 | */ 53 | - (instancetype)inSimulator:(FBSimulator *)simulator; 54 | 55 | /** 56 | Prints a recursive description in the error. 57 | */ 58 | - (instancetype)recursiveDescription; 59 | 60 | /** 61 | Builds the Error with the applied arguments. 62 | */ 63 | - (NSError *)build; 64 | 65 | @end 66 | 67 | @interface FBSimulatorError (Constructors) 68 | 69 | /** 70 | Construct a simple error with the provided description. 71 | */ 72 | + (NSError *)errorForDescription:(NSString *)description; 73 | 74 | /** 75 | Return NO, wrapping `failureCause` in the FBSimulatorControl domain. 76 | */ 77 | + (BOOL)failBoolWithError:(NSError *)failureCause errorOut:(NSError **)errorOut; 78 | 79 | /** 80 | Return NO, wraping wrapping `failureCause` in the FBSimulatorControl domain with an additional description. 81 | */ 82 | + (BOOL)failBoolWithError:(NSError *)failureCause description:(NSString *)description errorOut:(NSError **)errorOut; 83 | 84 | /** 85 | Return NO with a simple failure message. 86 | */ 87 | + (BOOL)failBoolWithErrorMessage:(NSString *)errorMessage errorOut:(NSError **)errorOut; 88 | 89 | /** 90 | Return nil with a simple failure message. 91 | */ 92 | + (id)failWithErrorMessage:(NSString *)errorMessage errorOut:(NSError **)errorOut; 93 | 94 | /** 95 | Return nil, wrapping `failureCause` in the FBSimulatorControl domain. 96 | */ 97 | + (id)failWithError:(NSError *)failureCause errorOut:(NSError **)errorOut; 98 | 99 | /** 100 | Return nil, wrapping `failureCause` in the FBSimulatorControl domain with an additional description. 101 | */ 102 | + (id)failWithError:(NSError *)failureCause description:(NSString *)description errorOut:(NSError **)errorOut; 103 | 104 | @end 105 | 106 | /** 107 | When printing NSError, you'll only get one level of NSUnderlyingDescription, which doesn't encourage verbose errors 108 | This fixes that by printing more than just the first level's error. 109 | */ 110 | @interface NSError (RecursiveDescription) 111 | 112 | - (NSString *)recursiveUnderlyingDescription; 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorInteraction () 13 | 14 | @property (nonatomic, strong) FBSimulator *simulator; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBSimulator; 16 | @class FBSimulatorApplication; 17 | @class FBSimulatorConfiguration; 18 | 19 | /** 20 | Pre-session interactions used pre-launch of a Simulator 21 | */ 22 | @interface FBSimulatorInteraction : FBInteraction 23 | 24 | /** 25 | Returns a new Interaction for the provided Simulator. 26 | 27 | @param simulator the Simulator to interact with, must not be nil. 28 | */ 29 | + (instancetype)withSimulator:(FBSimulator *)simulator; 30 | 31 | /** 32 | Sets the locale for the simulator. 33 | 34 | @param locale the locale to set, must not be nil. 35 | */ 36 | - (instancetype)setLocale:(NSLocale *)locale; 37 | 38 | /** 39 | Authorizes the Location Settings for the provided application. 40 | 41 | @param application the Application to authorize settings for. 42 | */ 43 | - (instancetype)authorizeLocationSettingsForApplication:(FBSimulatorApplication *)application; 44 | 45 | /** 46 | Setups keyboard for simulator 47 | 1) Disables Caps Lock 48 | 2) Disables Auto Capitalize 49 | 3) Disables Auto Correction / QuickType 50 | */ 51 | - (instancetype)setupKeyboard; 52 | 53 | @end 54 | 55 | /** 56 | Some conveniences for making the interactions associated with a Simulator Configuration. 57 | */ 58 | @interface FBSimulatorInteraction (Convenience) 59 | 60 | /** 61 | Makes an interaction by: 62 | 1) Setting the Locale (if the configuration contains one) 63 | 2) Sets up the keyboard 64 | 65 | @param configuration the configuration to apply. 66 | */ 67 | - (instancetype)configureWith:(FBSimulatorConfiguration *)configuration; 68 | 69 | @end 70 | 71 | /** 72 | Helps make a more fluent API for interacting with Simulators. 73 | */ 74 | @interface FBSimulator (FBSimulatorInteraction) 75 | 76 | /** 77 | Creates an `FBSimulatorInteraction` for the reciever. 78 | */ 79 | - (FBSimulatorInteraction *)interact; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogger.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | A protocol for defining a class that recieves logger messages. 14 | */ 15 | @protocol FBSimulatorLogger 16 | 17 | - (void)logMessage:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); 18 | 19 | @end 20 | 21 | @interface FBSimulatorLogger : NSObject 22 | 23 | /** 24 | An implementation of `FBSimulatorLogger` that logs to NSLog 25 | */ 26 | + (id)toNSLog; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogs+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorLogs () 13 | 14 | @property (nonatomic, strong, readwrite) FBSimulator *simulator; 15 | 16 | - (NSArray *)diagnosticReportsContents; 17 | 18 | @end 19 | 20 | @interface FBSimulatorSessionLogs () 21 | 22 | @property (nonatomic, strong, readwrite) FBSimulatorSession *session; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorLogs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorSession; 14 | @class FBWritableLog; 15 | 16 | /** 17 | Exposes Simulator Logs & Diagnsotics as `FBWritableLog`s 18 | */ 19 | @interface FBSimulatorLogs : NSObject 20 | 21 | /** 22 | Creates and returns a `FBSimulatorLogs` instance. 23 | 24 | @param simulator the Simulator to Fetch logs for. 25 | @return A new `FBSimulatorLogFetcher` instance. 26 | */ 27 | + (instancetype)withSimulator:(FBSimulator *)simulator; 28 | 29 | /** 30 | The syslog of the Simulator. 31 | */ 32 | - (FBWritableLog *)systemLog; 33 | 34 | /** 35 | Crash logs of all the subprocesses that have crashed in the Simulator after the specified date. 36 | 37 | @param date the earliest to search for crash reports. If nil will find reports regardless of date. 38 | @return an NSArray of all the applicable crash reports. 39 | */ 40 | - (NSArray *)subprocessCrashesAfterDate:(NSDate *)date; 41 | 42 | @end 43 | 44 | /** 45 | Exposes Logs & Diagnsotics a Simulator & it's session as `FBWritableLog`s 46 | */ 47 | @interface FBSimulatorSessionLogs : FBSimulatorLogs 48 | 49 | /** 50 | Creates and returns a `FBSimulatorSessionLogs` instance. 51 | 52 | @param session the Session to fetch logs for. 53 | @return A new `FBSimulatorLogFetcher` instance. 54 | */ 55 | + (instancetype)withSession:(FBSimulatorSession *)session; 56 | 57 | /** 58 | Crashes that occured in the Simulator after the start of the Session. 59 | */ 60 | - (NSArray *)subprocessCrashes; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorPool+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBSimulatorPool () 13 | 14 | @property (nonatomic, copy, readwrite) FBSimulatorControlConfiguration *configuration; 15 | 16 | @property (nonatomic, strong, readwrite) SimDeviceSet *deviceSet; 17 | @property (nonatomic, strong, readwrite) NSMutableOrderedSet *allocatedUDIDs; 18 | @property (nonatomic, strong, readwrite) NSRegularExpression *managedSimulatorPoolOffsetRegex; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorPredicates.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorConfiguration; 14 | @class FBSimulatorPool; 15 | 16 | /** 17 | Predicates for filtering collections of available Simulators. 18 | NSCompoundPredicate can be used to compose Predicates. 19 | */ 20 | @interface FBSimulatorPredicates : NSObject 21 | 22 | /** 23 | Predicate for Simulators that are allocated in a specific Pool. 24 | */ 25 | + (NSPredicate *)allocatedByPool:(FBSimulatorPool *)pool; 26 | 27 | /** 28 | Predicate for Simulators that are managed by a pool but not allocated. 29 | */ 30 | + (NSPredicate *)unallocatedByPool:(FBSimulatorPool *)pool; 31 | 32 | /** 33 | Predicate for Simulators that are launched. 34 | */ 35 | + (NSPredicate *)launched; 36 | 37 | /** 38 | Predicate for only the provided Simulator. 39 | */ 40 | + (NSPredicate *)only:(FBSimulator *)simulator; 41 | 42 | /** 43 | Predicate for matching SimDevices against a Configuration. 44 | */ 45 | + (NSPredicate *)matchingConfiguration:(FBSimulatorConfiguration *)configuration; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorProcess+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBUserLaunchedProcess () 13 | 14 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 15 | @property (nonatomic, copy, readwrite) NSDate *launchDate; 16 | @property (nonatomic, copy, readwrite) FBProcessLaunchConfiguration *launchConfiguration; 17 | @property (nonatomic, copy, readwrite) NSDictionary *diagnostics; 18 | 19 | @end 20 | 21 | @interface FBFoundProcess () 22 | 23 | @property (nonatomic, assign, readwrite) NSInteger processIdentifier; 24 | @property (nonatomic, copy, readwrite) NSString *launchPath; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorProcess.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBProcessLaunchConfiguration; 13 | 14 | @protocol FBSimulatorProcess 15 | 16 | /** 17 | The Process Identifier for the running process 18 | */ 19 | @property (nonatomic, assign, readonly) NSInteger processIdentifier; 20 | 21 | /** 22 | The Launch Path of the running process 23 | */ 24 | @property (nonatomic, copy, readonly) NSString *launchPath; 25 | 26 | @end 27 | 28 | /** 29 | An Object representing the current state of a process launched via FBSimulatorControl 30 | Implements equality to uniquely identify a launched process. 31 | */ 32 | @interface FBUserLaunchedProcess : NSObject 33 | 34 | /** 35 | The Date the Process was launched 36 | */ 37 | @property (nonatomic, copy, readonly) NSDate *launchDate; 38 | 39 | /** 40 | The Launch Config of the Launched Process 41 | */ 42 | @property (nonatomic, copy, readonly) FBProcessLaunchConfiguration *launchConfiguration; 43 | 44 | /** 45 | A key-value store of arbitrary diagnostic information for the process 46 | */ 47 | @property (nonatomic, copy, readonly) NSDictionary *diagnostics; 48 | 49 | @end 50 | 51 | /** 52 | An Object representing the current state of a process launched automatically by the Simulator. 53 | Implements equality to uniquely identify a launched process. 54 | */ 55 | @interface FBFoundProcess : NSObject 56 | 57 | + (instancetype)withProcessIdentifier:(NSInteger)processIdentifier launchPath:(NSString *)launchPath; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBAgentLaunchConfiguration; 14 | @class FBApplicationLaunchConfiguration; 15 | 16 | /** 17 | Conveniences for starting managing the Session Lifecycle. 18 | */ 19 | @interface FBSimulatorSession (Convenience) 20 | 21 | /** 22 | Starts the Simulator Session with the configuration object. 23 | 1) Launches the Simulator 24 | 2) Installs the Application 25 | 3) Launches the Application 26 | 4) Launches the Agent 27 | 28 | @param error an Error Out for any error that occured. 29 | @returns YES if the interaction was successful, NO otherwise. 30 | */ 31 | - (BOOL)startWithAppLaunch:(FBApplicationLaunchConfiguration *)appLaunch agentLaunch:(FBAgentLaunchConfiguration *)agentLaunch error:(NSError **)error; 32 | 33 | /** 34 | Re-launches the last terminated application. 35 | */ 36 | - (BOOL)relaunchAppWithError:(NSError **)error; 37 | 38 | /** 39 | Terminates the last launched application. 40 | */ 41 | - (BOOL)terminateAppWithError:(NSError **)error; 42 | 43 | @end 44 | 45 | @interface FBSimulatorSessionInteraction (Convenience) 46 | 47 | - (instancetype)startWithAppLaunch:(FBApplicationLaunchConfiguration *)appLaunch agentLaunch:(FBAgentLaunchConfiguration *)agentLaunch; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBSimulatorSessionLifecycle; 15 | 16 | @interface FBSimulatorSession () 17 | 18 | @property (nonatomic, strong, readwrite) FBSimulator *simulator; 19 | @property (nonatomic, strong, readwrite) FBSimulatorSessionLifecycle *lifecycle; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSession.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | @class FBSimulatorSessionInteraction; 14 | @class FBSimulatorSessionLogs; 15 | @class FBSimulatorSessionState; 16 | 17 | /** 18 | Represents the lifecycle of a connection to a Simulator. 19 | A Session is inert, until `start` is called. 20 | */ 21 | @interface FBSimulatorSession : NSObject 22 | 23 | /** 24 | Creates a new `FBSimulatorSession` with the provided parameters. Will not launch a session until `start:` is called. 25 | 26 | @param simulator the Simulator to manage the session for. 27 | @returns a new `FBSimulatorSession`. 28 | */ 29 | + (instancetype)sessionWithSimulator:(FBSimulator *)simulator; 30 | 31 | /** 32 | The Simulator for this session 33 | */ 34 | @property (nonatomic, strong, readonly) FBSimulator *simulator; 35 | 36 | /** 37 | Returns the Session Information for the reciever. 38 | */ 39 | @property (nonatomic, strong, readonly) FBSimulatorSessionState *state; 40 | 41 | /** 42 | Returns the Logs associated with this Session. 43 | */ 44 | @property (nonatomic, strong, readonly) FBSimulatorSessionLogs *logs; 45 | 46 | /** 47 | Returns an Interaction for Interacting with the Sessions. 48 | */ 49 | - (FBSimulatorSessionInteraction *)interact; 50 | 51 | /** 52 | Terminates the Session, freeing any allocated resources. 53 | */ 54 | - (BOOL)terminateWithError:(NSError **)error; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction+Diagnostics.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorSessionInteraction (Diagnostics) 15 | 16 | /** 17 | Uses sample(1) see what is going on in the Application. This is done asynchronously. 18 | The result is attached to the Session State. If an error occurs during the run of the sample(1), no result will be attached. 19 | 20 | @param application the Application to sample. Must be running, otherwise the interaction will error. 21 | @param durationInSeconds the duration for which to sample the Application. 22 | @param frequencyInMilliseconds the frequency with which to sample. 23 | @returns the reciever, for chaining. 24 | */ 25 | - (instancetype)sampleApplication:(FBSimulatorApplication *)application withDuration:(NSInteger)durationInSeconds frequency:(NSInteger)frequencyInMilliseconds; 26 | 27 | /** 28 | Executes a command with lldb(1). This is done asynchronously. 29 | The result is attached to the Session State. If an error occurs during the run of the lldb command, no result will be returned. 30 | 31 | @param application the Application to sample. Must be running, otherwise the interaction will fail. 32 | @param command to execute. 33 | @returns the reciever, for chaining. 34 | */ 35 | - (instancetype)onApplication:(FBSimulatorApplication *)application executeLLDBCommand:(NSString *)command; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | extern NSTimeInterval const FBSimulatorInteractionDefaultTimeout; 15 | 16 | @interface FBSimulatorSessionInteraction () 17 | 18 | @property (nonatomic, strong) FBSimulatorSession *session; 19 | 20 | /** 21 | Chains an interaction on an application process, for the given application. 22 | */ 23 | - (instancetype)application:(FBSimulatorApplication *)application interact:(BOOL (^)(NSInteger processIdentifier, NSError **error))block; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionInteraction.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBAgentLaunchConfiguration; 15 | @class FBApplicationLaunchConfiguration; 16 | @class FBSimulator; 17 | @class FBSimulatorApplication; 18 | @class FBSimulatorBinary; 19 | @class FBSimulatorSession; 20 | @class FBSimulatorSessionLifecycle; 21 | @protocol FBSimulatorWindowTilingStrategy; 22 | 23 | /** 24 | The Concrete Interactions for a Simulator Session. 25 | Successive applications of interactions will occur in the order that they are sequenced. 26 | Interactions have no effect until `performInteractionWithError:` is called. 27 | */ 28 | @interface FBSimulatorSessionInteraction : FBInteraction 29 | 30 | /** 31 | Creates a new instance of the Interaction Builder. 32 | */ 33 | + (instancetype)builderWithSession:(FBSimulatorSession *)session; 34 | 35 | /** 36 | Boots the simulator. 37 | */ 38 | - (instancetype)bootSimulator; 39 | 40 | /** 41 | Tiles the Simulator according to the 'tilingStrategy'. 42 | */ 43 | - (instancetype)tileSimulator:(id)tilingStrategy; 44 | 45 | /** 46 | Tiles the Simulator according to the occlusion other Simulators. 47 | */ 48 | - (instancetype)tileSimulator; 49 | 50 | /** 51 | Records Video of the Simulator, until the Session is terminated. 52 | */ 53 | - (instancetype)recordVideo; 54 | 55 | /** 56 | Uploads photos to the Camera Roll of the Simulator 57 | 58 | @param param photoPaths an NSArray of File Paths for the Photos to Upload. 59 | */ 60 | - (instancetype)uploadPhotos:(NSArray *)photoPaths; 61 | 62 | /** 63 | Uploads videos to the Camera Roll of the Simulator 64 | 65 | @param videoPaths an NSArray of File Paths for the Videos to Upload. 66 | */ 67 | - (instancetype)uploadVideos:(NSArray *)videoPaths; 68 | 69 | /** 70 | Installs the given Application. 71 | */ 72 | - (instancetype)installApplication:(FBSimulatorApplication *)application; 73 | 74 | /** 75 | Launches the Application with the given Configuration. 76 | */ 77 | - (instancetype)launchApplication:(FBApplicationLaunchConfiguration *)appLaunch; 78 | 79 | /** 80 | Unix Signals the Application. 81 | */ 82 | - (instancetype)signal:(int)signal application:(FBSimulatorApplication *)application; 83 | 84 | /** 85 | Kills the provided Application. 86 | */ 87 | - (instancetype)killApplication:(FBSimulatorApplication *)application; 88 | 89 | /** 90 | Launches the provided Agent with the given Configuration. 91 | */ 92 | - (instancetype)launchAgent:(FBAgentLaunchConfiguration *)agentLaunch; 93 | 94 | /** 95 | Launches the provided Agent. 96 | */ 97 | - (instancetype)killAgent:(FBSimulatorBinary *)agent; 98 | 99 | /** 100 | Opens the provided URL on the Device 101 | */ 102 | - (instancetype)openURL:(NSURL *)url; 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface FBSimulatorSessionState () 15 | 16 | @property (nonatomic, weak, readwrite) FBSimulatorSession *session; 17 | @property (nonatomic, copy, readwrite) FBSimulatorSessionState *previousState; 18 | 19 | @property (nonatomic, copy, readwrite) NSDate *timestamp; 20 | @property (nonatomic, assign, readwrite) FBSimulatorSessionLifecycleState lifecycle; 21 | @property (nonatomic, assign, readwrite) FBSimulatorState simulatorState; 22 | @property (nonatomic, strong, readwrite) NSMutableOrderedSet *runningProcessesSet; 23 | @property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDiagnostics; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState+Queries.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBAgentLaunchConfiguration; 15 | @class FBApplicationLaunchConfiguration; 16 | 17 | /** 18 | Queries for obtaining information from Session State 19 | */ 20 | @interface FBSimulatorSessionState (Queries) 21 | 22 | /** 23 | Returns the Application that was launched most recently. 24 | Reaches into previous states in order to find Applications that have been terminated. 25 | */ 26 | - (FBApplicationLaunchConfiguration *)lastLaunchedApplication; 27 | 28 | /** 29 | Returns the Agent that was launched most recently. 30 | Reaches into previous states in order to find Agents that have been terminated. 31 | */ 32 | - (FBAgentLaunchConfiguration *)lastLaunchedAgent; 33 | 34 | /** 35 | Returns the Process State for the given launch configuration, does not reach into previous states. 36 | */ 37 | - (FBUserLaunchedProcess *)processForLaunchConfiguration:(FBProcessLaunchConfiguration *)launchConfig; 38 | 39 | /** 40 | Returns the Process State for the given binary, does not reach into previous states. 41 | */ 42 | - (FBUserLaunchedProcess *)processForBinary:(FBSimulatorBinary *)binary; 43 | 44 | /** 45 | Returns the Process State for the given Application, does not reach into previous states. 46 | */ 47 | - (FBUserLaunchedProcess *)processForApplication:(FBSimulatorApplication *)application; 48 | 49 | /** 50 | Returns Agent State for all running agents, does not reach into previous states. 51 | */ 52 | - (NSArray *)runningAgents; 53 | 54 | /** 55 | Returns Application State for all running applications, does not reach into previous states. 56 | */ 57 | - (NSArray *)runningApplications; 58 | 59 | /** 60 | Finds the first diagnostic for the provided name, matching the application. 61 | Reaches into previous states in order to find Diagnostics for Applications that have been terminated. 62 | */ 63 | - (id)diagnosticNamed:(NSString *)name forApplication:(FBSimulatorApplication *)application; 64 | 65 | /** 66 | Reaches into previous states in order to find Diagnostics for Applications. 67 | */ 68 | - (NSDictionary *)allProcessDiagnostics; 69 | 70 | /** 71 | Describes the `simulatorState` changes. 72 | */ 73 | - (NSArray *)changesToSimulatorState; 74 | 75 | /** 76 | The date of the first session state. 77 | */ 78 | - (NSDate *)sessionStartDate; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionState.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class FBProcessLaunchConfiguration; 15 | @class FBSimulatorApplication; 16 | @class FBSimulatorBinary; 17 | @class FBSimulatorSession; 18 | 19 | typedef NS_ENUM(NSInteger, FBSimulatorSessionLifecycleState) { 20 | FBSimulatorSessionLifecycleStateNotStarted, 21 | FBSimulatorSessionLifecycleStateStarted, 22 | FBSimulatorSessionLifecycleStateEnded 23 | }; 24 | 25 | /** 26 | An Immutable value representing the current state of the Simulator Session. 27 | Can be used to interrogate the changes to the operation of the Simulator over time. 28 | */ 29 | @interface FBSimulatorSessionState : NSObject 30 | 31 | /** 32 | The Session that is producing this information. The Session is a reference, so represents the current state of the world. 33 | This does not behave like a value within the Session State, so it's contents may change over time. 34 | */ 35 | @property (nonatomic, weak, readonly) FBSimulatorSession *session; 36 | 37 | /** 38 | The Simulator for the Session. The Simulator is a reference, so represents the current state of the world. 39 | This does not behave like a value within the Session State, so it's contents may change over time. 40 | */ 41 | @property (nonatomic, weak, readonly) FBSimulator *simulator; 42 | 43 | /** 44 | The Timestamp for the creation of the reciever. 45 | */ 46 | @property (nonatomic, copy, readonly) NSDate *timestamp; 47 | 48 | /** 49 | The Enumerated state of the Simulator. 50 | */ 51 | @property (nonatomic, assign, readonly) FBSimulatorState simulatorState; 52 | 53 | /** 54 | The Position in the lifecycle of the session state. 55 | */ 56 | @property (nonatomic, assign, readonly) FBSimulatorSessionLifecycleState lifecycle; 57 | 58 | /** 59 | The Running processes on the Simulator. 60 | Ordering is determined by time of launch; the most recently launched process is first. 61 | Is an NSArray 62 | */ 63 | @property (nonatomic, copy, readonly) NSArray *runningProcesses; 64 | 65 | /** 66 | Per-Session Diagnostic Information. 67 | */ 68 | @property (nonatomic, copy, readonly) NSDictionary *diagnostics; 69 | 70 | /** 71 | The last state, may be nil if this is the first instance. 72 | */ 73 | @property (nonatomic, copy, readonly) FBSimulatorSessionState *previousState; 74 | 75 | /** 76 | A String description of FBSimulatorSessionLifecycleState 77 | */ 78 | + (NSString *)stringForLifecycleState:(FBSimulatorSessionLifecycleState)lifecycleState; 79 | 80 | /** 81 | A String description of the difference between the provided states. 82 | */ 83 | + (NSString *)describeDifferenceBetween:(FBSimulatorSessionState *)first and:(FBSimulatorSessionState *)second; 84 | 85 | /** 86 | Describes all the changes of the reciever, to the first change. 87 | */ 88 | - (NSString *)recursiveChangeDescription; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorSessionStateGenerator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBProcessLaunchConfiguration; 16 | @class FBSimulatorBinary; 17 | @class FBSimulatorSession; 18 | 19 | /** 20 | An object responsible for creating `FBSimulatorSessionState` objects. 21 | Maintains the links to the previous state, so previous state can be queried. 22 | */ 23 | @interface FBSimulatorSessionStateGenerator : NSObject 24 | 25 | /** 26 | Creates and returns a new Generator for the given session 27 | */ 28 | + (instancetype)generatorWithSession:(FBSimulatorSession *)session; 29 | 30 | /** 31 | Updates the lifecycle of the session with the given enumeration 32 | */ 33 | - (instancetype)updateLifecycle:(FBSimulatorSessionLifecycleState)lifecycle; 34 | 35 | /** 36 | Updates the Simulator State. 37 | */ 38 | - (instancetype)updateSimulatorState:(FBSimulatorState)state; 39 | 40 | /** 41 | Creates Process State for the given launch config. 42 | */ 43 | - (instancetype)update:(FBProcessLaunchConfiguration *)launchConfig withProcessIdentifier:(NSInteger)processIdentifier; 44 | 45 | /** 46 | Updates the diagnostic information about for a given launched process. 47 | */ 48 | - (instancetype)update:(FBSimulatorApplication *)application withDiagnosticNamed:(NSString *)diagnosticName data:(id)data; 49 | 50 | /** 51 | Updates Diagnsotic Data. 52 | */ 53 | - (instancetype)updateWithDiagnosticNamed:(NSString *)diagnostic data:(id)data; 54 | 55 | /** 56 | Removes the Process State for the given binary. 57 | */ 58 | - (instancetype)remove:(FBSimulatorBinary *)binary; 59 | 60 | /** 61 | Returns the current Session State 62 | */ 63 | - (FBSimulatorSessionState *)currentState; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorVideoRecorder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | @class FBSimulator; 16 | 17 | /** 18 | A Class that Records Video for a given Simulator. 19 | 20 | Helpful reference from: 21 | - Apple Technical QA1740 22 | - https://github.com/square/zapp/ZappVideoController.m 23 | - https://github.com/appium/screen_recording 24 | */ 25 | @interface FBSimulatorVideoRecorder : NSObject 26 | 27 | /** 28 | Create a new FBSimulatorVideoRecorder for the provided Simulator. 29 | 30 | @param simulator the Simulator to Record. 31 | @param logger a logger to record interactions. May be nil. 32 | @return a new Video Recorder instance. 33 | */ 34 | + (instancetype)forSimulator:(FBSimulator *)simulator logger:(id)logger; 35 | 36 | /** 37 | Starts recording the Simulator to a File. 38 | Will delete and overwrite any existing video for the given filePath. 39 | 40 | @param filePath the File to Record into. 41 | @param error the error out, for any error that occurred. 42 | @returns YES if the recording started successfully, NO otherwise. 43 | */ 44 | - (BOOL)startRecordingToFilePath:(NSString *)filePath error:(NSError **)error; 45 | 46 | /** 47 | Ends recording of the Simulator. 48 | 49 | @param error the error out, for any error that occured. 50 | @return the Path of the recorded movie if successful, NO otherwise. 51 | */ 52 | - (NSString *)stopRecordingWithError:(NSError **)error; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowHelpers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBSimulator; 14 | 15 | @interface FBSimulatorWindowHelpers : NSObject 16 | 17 | /** 18 | Creates and returns an NSArray of the bounds of all Simulators except the provided Simulator. 19 | 20 | @param the simulator to exclude from the bounds fetch 21 | @return an NSArray of these bounds. 22 | */ 23 | + (NSArray *)obtainBoundsOfOtherSimulators:(FBSimulator *)simulator; 24 | 25 | /** 26 | Creates and returns an NSArray of Simulator.app Windows that belong to the Ordered Set of Simulator. 27 | The Dictionary contains Windows in format from 'Quartz Window Services' 28 | 29 | @param simulator the Simulators to find Windows For. 30 | @return array an Array of the windows that could be found for the provided Simulators. 31 | */ 32 | + (NSArray *)windowsForSimulators:(NSOrderedSet *)simulators; 33 | 34 | /** 35 | Returns the CGDirectDisplayID for the provided Simulator. 36 | 37 | @param simulator the Simulators to find the DisplayID For. 38 | @param cropRect an outparam for the Cropping Rectangle in Screen Bounds. 39 | @param screenSize the size of the Screen containing the Simulator. 40 | @return the Display ID of the Simulator or 0 if it could not be found. 41 | */ 42 | + (CGDirectDisplayID)displayIDForSimulator:(FBSimulator *)simulator cropRect:(CGRect *)cropRect screenSize:(CGSize *)screenSize; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowTiler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class FBSimulator; 14 | @protocol FBSimulatorWindowTilingStrategy; 15 | 16 | /** 17 | A Class responsible for tiling Simulator Windows and bringing them to the foreground. 18 | Tiling differes from 'calculating layout' in the traditional sense since it's undesirable to re-align Windows that have already been placed. 19 | Keeping a Simulator in the same position since it's first placement means that cropping a recorded video becomes trivial. 20 | */ 21 | @interface FBSimulatorWindowTiler : NSObject 22 | 23 | /** 24 | Creates and returns a new Window Tiler for the provided Simulator 25 | 26 | @param simulator the Simulator to position. 27 | @param strategy the Strategy to use for determining the position of Windows.s 28 | @return a new FBWindowTiler instance. 29 | */ 30 | + (instancetype)withSimulator:(FBSimulator *)simulator strategy:(id)strategy; 31 | 32 | /** 33 | Moves the Simuator into the foreground in the first available position that is not occluded by any other Simulator 34 | If the Window is too small then to contain this, as well as other Simulators, the position is undefined 35 | 36 | @param error an error out for any error that occurred. 37 | @return a CGRect representing the final position of the Window. CGRectNull if an error occured. 38 | */ 39 | - (CGRect)placeInForegroundWithError:(NSError **)error; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorWindowTilingStrategy.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBSimulator; 13 | 14 | /** 15 | A Protocol for defining a Strategy of the placement of Simulator Windows within the host's display. 16 | */ 17 | @protocol FBSimulatorWindowTilingStrategy 18 | 19 | /** 20 | Returns the best position for a window. 21 | 22 | @param size the Size of the Window to place. 23 | @param error an Error out for any error that occurred. 24 | @return the target position of the rectangle, or CGRectNull if there is no possible placement for the Window.s 25 | */ 26 | - (CGRect)targetPositionOfWindowWithSize:(CGSize)windowSize inScreenSize:(CGSize)screenSize withError:(NSError **)error; 27 | 28 | @end 29 | 30 | /** 31 | Implementations of Tiling Strategy 32 | */ 33 | @interface FBSimulatorWindowTilingStrategy : NSObject 34 | 35 | /** 36 | A Strategy that tiles windows horizontally based on the presence of occluding Simulators, determined by the existence of Simulators other than the 'target'. 37 | 38 | @param targetSimulator the existing Simulator to place. Simulators other than the 'targetSimulator' will be considered occluded areas. 39 | @return a Window Tiling Strategy 40 | */ 41 | + (id)horizontalOcclusionStrategy:(FBSimulator *)targetSimulator; 42 | 43 | /** 44 | A Strategy that tiles windows horizontally based on a offset in a horizontally divided screen. 45 | 46 | @param offset the offset 47 | @param total the total number of offsets 48 | @return a Window Tiling Strategy 49 | */ 50 | + (id)isolatedRegionStrategyWithOffset:(NSInteger)offset total:(NSInteger)total; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTask+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTask : NSObject 13 | 14 | @property (nonatomic, strong, readwrite) NSTask *task; 15 | @property (nonatomic, copy, readwrite) NSSet *acceptableStatusCodes; 16 | 17 | @property (nonatomic, assign, readwrite) BOOL hasTerminated; 18 | @property (nonatomic, copy, readwrite) void (^terminationHandler)(id); 19 | @property (atomic, strong, readwrite) NSError *runningError; 20 | 21 | + (instancetype)taskWithNSTask:(NSTask *)nsTask acceptableStatusCodes:(NSSet *)acceptableStatusCodes stdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 22 | 23 | - (NSTask *)decorateTask:(NSTask *)task __attribute__((objc_requires_super)); 24 | 25 | - (void)teardownTask; 26 | - (void)teardownResources; 27 | - (void)completeTermination; 28 | 29 | @end 30 | 31 | @interface FBTask_InMemory : FBTask 32 | 33 | @property (nonatomic, strong, readwrite) NSPipe *stdOutPipe; 34 | @property (nonatomic, strong, readwrite) NSMutableData *stdOutData; 35 | @property (nonatomic, strong, readwrite) NSPipe *stdErrPipe; 36 | @property (nonatomic, strong, readwrite) NSMutableData *stdErrData; 37 | 38 | @end 39 | 40 | @interface FBTask_FileBacked : FBTask 41 | 42 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 43 | @property (nonatomic, strong, readwrite) NSFileHandle *stdOutFileHandle; 44 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 45 | @property (nonatomic, strong, readwrite) NSFileHandle *stdErrFileHandle; 46 | 47 | - (instancetype)initWithTask:(NSTask *)task acceptableStatusCodes:(NSSet *)acceptableStatusCodes stdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTask.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | The Default Timeout for Tasks 16 | */ 17 | extern NSTimeInterval const FBTaskDefaultTimeout; 18 | 19 | /** 20 | Programmatic interface to a Task. 21 | */ 22 | @protocol FBTask 23 | 24 | /** 25 | Runs the reciever, returning when the Task has completed or when the timeout is hit. 26 | 27 | @param timeout the the maximum time to evaluate the task. 28 | @return the reciever, for chaining. 29 | */ 30 | - (instancetype)startSynchronouslyWithTimeout:(NSTimeInterval)timeout; 31 | 32 | /** 33 | Asynchronously launches the task, returning immediately after the Task has launched. 34 | 35 | @param handler the handler to call when the Task has terminated. 36 | @return the reciever, for chaining. 37 | */ 38 | - (instancetype)startAsynchronouslyWithTerminationHandler:(void (^)(id task))handler; 39 | 40 | /** 41 | Asynchronously launches the task, returning immediately after the Task has launched. 42 | 43 | @return the reciever, for chaining. 44 | */ 45 | - (instancetype)startAsynchronously; 46 | 47 | /** 48 | Returns the Process Identifier of the Launched Process. 49 | */ 50 | - (NSInteger)processIdentifier; 51 | 52 | /** 53 | Returns a copy of the current state of stdout. May be called from any thread. 54 | */ 55 | - (NSString *)stdOut; 56 | 57 | /** 58 | Returns a copy of the current state of stderr. May be called from any thread. 59 | */ 60 | - (NSString *)stdErr; 61 | 62 | /** 63 | Returns the Error associated with the shell command (if any). May be called from any thread. 64 | */ 65 | - (NSError *)error; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor+Convenience.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTaskExecutor (Convenience) 13 | 14 | /** 15 | @see executeShellCommand:returningError: 16 | */ 17 | - (NSString *)executeShellCommand:(NSString *)command; 18 | 19 | /** 20 | Executes the given command using the shell and returns the result. 21 | The returned string has leading/trailing whitespace and new lines trimmed. 22 | Will error if the time taken to execute the command exceeds the default timeout. 23 | 24 | @param command The shell command to execute. File Paths must be quoted or escaped. Must not be nil. 25 | @param error NSError byref to be populated if an error occurs while executing the command. May be nil. Populates the userInfo with stdout. 26 | @return The stdout from the command. Returns nil if an Error occured. 27 | */ 28 | - (NSString *)executeShellCommand:(NSString *)command returningError:(NSError **)error; 29 | 30 | /** 31 | Repeatedly runs the given command, passing the output to the block. 32 | When the block returns YES or the timeout is reached, the method will exit. 33 | If a non-zero exit code is returned, the method will exit. 34 | 35 | @param command the Command String to run. 36 | @param the Error Outparam for any error that occures 37 | @param block the predicate to verify stdOut against 38 | @return YES if the untilTrue block returns YES before the timeout, NO otherwise. 39 | */ 40 | - (BOOL)repeatedlyRunCommand:(NSString *)command withError:(NSError **)error untilTrue:( BOOL(^)(NSString *stdOut) )block; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBTaskExecutor () 13 | 14 | @property (nonatomic, copy, readwrite) NSString *shellPath; 15 | @property (nonatomic, copy, readwrite) NSString *launchPath; 16 | @property (nonatomic, copy, readwrite) NSArray *arguments; 17 | @property (nonatomic, copy, readwrite) NSDictionary *environment; 18 | @property (nonatomic, copy, readwrite) NSString *shellCommand; 19 | @property (nonatomic, copy, readwrite) NSSet *acceptableStatusCodes; 20 | @property (nonatomic, copy, readwrite) NSString *stdOutPath; 21 | @property (nonatomic, copy, readwrite) NSString *stdErrPath; 22 | 23 | + (NSError *)errorForDescription:(NSString *)description; 24 | 25 | - (NSTask *)buildTask; 26 | 27 | @end 28 | 29 | @interface FBTaskExecutor_ShellTask : FBTaskExecutor 30 | 31 | @end 32 | 33 | @interface FBTaskExecutor_Task : FBTaskExecutor 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTaskExecutor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | /** 15 | Error Doman for all FBTaskExecutor errors 16 | */ 17 | extern NSString *const FBTaskExecutorErrorDomain; 18 | 19 | /** 20 | An interface to building FBTask instances 21 | */ 22 | @protocol FBTaskBuilder 23 | 24 | /** 25 | The Set of Return Codes that are considered non-erroneous. 26 | 27 | @param statusCodes the non-erroneous stats codes. 28 | @return a builder, with the arguments applied. 29 | */ 30 | - (instancetype)withAcceptableTerminationStatusCodes:(NSSet *)statusCodes; 31 | 32 | /** 33 | The Launch Path of the Task. Will override any shell command set with `shellCommand`. 34 | 35 | @param launchPath the Launch Path. Will remove shellCommand. 36 | @return a builder, with the arguments applied. 37 | */ 38 | - (instancetype)withLaunchPath:(NSString *)launchPath; 39 | 40 | /** 41 | The Arguments of the Task. Will override any shell command set with `shellCommand`. 42 | 43 | @param arguments the arguments for the launch path. 44 | @return a builder, with the arguments applied. 45 | */ 46 | - (instancetype)withArguments:(NSArray *)arguments; 47 | 48 | /** 49 | Adds the provided dictionary to the environment of the built task. 50 | 51 | @param environment an Environment Dictionary of NSDictionary 52 | @returns a builder, with the argument applied 53 | */ 54 | - (instancetype)withEnvironmentAdditions:(NSDictionary *)environment; 55 | 56 | /** 57 | The Shell Command to execute. Will override any launch path or arguments set with `withArguments` or `withLaunchPath`. 58 | 59 | @param shellCommand the Shell Command to execute. 60 | @return a builder, with the arguments applied. 61 | */ 62 | - (instancetype)withShellTaskCommand:(NSString *)shellCommand; 63 | 64 | /** 65 | Assigns a path for StdOut and StdErr for the built task. 66 | 67 | @param stdOutPath the path to write stdout to. Must not be nil. 68 | @param stdErrPath the path to write stderr to. May be nil. 69 | @returns a builder, with the arguments applied. 70 | */ 71 | - (instancetype)withStdOutPath:(NSString *)stdOutPath stdErrPath:(NSString *)stdErrPath; 72 | 73 | /** 74 | Builds a Task that will write stdout and stderr to the heap when the task executes. 75 | 76 | @returns a builder, with the arguments applied. 77 | */ 78 | - (instancetype)withWritingInMemory; 79 | 80 | /** 81 | Builds the Task 82 | 83 | @return a FBTask. 84 | */ 85 | - (id)build; 86 | 87 | @end 88 | 89 | /** 90 | Executes shell commands and return the results of standard output/error. 91 | */ 92 | @interface FBTaskExecutor : NSObject 93 | 94 | /** 95 | Returns the shared `FBTaskExecutor` instance. 96 | */ 97 | + (instancetype)sharedInstance; 98 | 99 | /** 100 | Creates a Task for execution. 101 | When the task is launched it will be retained until the task has terminated. 102 | Terminate must be called to free up resources. 103 | 104 | @param launchPath the Executable Path to launch. 105 | @param arguments the arguments to send to the launched tasks. 106 | @return a Task ready to be started. 107 | */ 108 | - (id)taskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments; 109 | 110 | /** 111 | Creates a Shell Command for execution. May be executed according to the `id` API. 112 | 113 | @param command the Shell Command to execute. File Paths must be quoted or escaped. Must not be nil. 114 | @return a Shell Task ready to be started. 115 | */ 116 | - (id)shellTask:(NSString *)command; 117 | 118 | /** 119 | Escapes the given path, so that it can be placed into a shell command string. 120 | 121 | @param path the File Path to escape 122 | @return a shell-escaped file path 123 | */ 124 | + (NSString *)escapePathForShell:(NSString *)path; 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBTerminationHandle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Simple protocol that defines termination of something 14 | */ 15 | @protocol FBTerminationHandle 16 | 17 | - (void)terminate; 18 | 19 | @end 20 | 21 | @interface FBTerminationHandle : NSObject 22 | 23 | /** 24 | Creates a termination handle that will call the block when `terminate` is called. 25 | */ 26 | + (id)terminationHandleWithBlock:( void(^)(void) )block; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBWritableLog+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface FBWritableLog () 13 | 14 | @property (nonatomic, copy, readwrite) NSString *shortName; 15 | @property (nonatomic, copy, readwrite) NSString *fileType; 16 | @property (nonatomic, copy, readwrite) NSString *humanReadableName; 17 | @property (nonatomic, copy, readwrite) NSString *destination; 18 | 19 | @property (nonatomic, copy, readwrite) NSData *logData; 20 | @property (nonatomic, copy, readwrite) NSString *logString; 21 | @property (nonatomic, copy, readwrite) NSString *logPath; 22 | 23 | @end 24 | 25 | /** 26 | A representation of a Writable Log, backed by NSData. 27 | */ 28 | @interface FBWritableLog_Data : FBWritableLog 29 | 30 | @end 31 | 32 | /** 33 | A representation of a Writable Log, backed by an NSString. 34 | */ 35 | @interface FBWritableLog_String : FBWritableLog 36 | 37 | @end 38 | 39 | /** 40 | A representation of a Writable Log, backed by a File Path. 41 | */ 42 | @interface FBWritableLog_Path : FBWritableLog 43 | 44 | @end 45 | 46 | /** 47 | A representation of a Writable Log, where the log is known to not exist. 48 | */ 49 | @interface FBWritableLog_Empty : FBWritableLog 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Headers/NSRunLoop+SimulatorControlAdditions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Conveniences to aid synchronous waiting on events, whilst not blocking other event sources. 14 | */ 15 | @interface NSRunLoop (SimulatorControlAdditions) 16 | 17 | /** 18 | Spins the Run Loop until `untilTrue` returns YES or a timeout is reached. 19 | 20 | @oaram timeout the Timeout in Seconds. 21 | @param untilTrue the condition to meet. 22 | @returns YES if the condition was met, NO if the timeout was reached first. 23 | */ 24 | - (BOOL)spinRunLoopWithTimeout:(NSTimeInterval)timeout untilTrue:( BOOL (^)(void) )untilTrue; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F27 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | FBSimulatorControl 11 | CFBundleIdentifier 12 | facebook.FBSimulatorControl 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | FBSimulatorControl 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 6E35b 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 14D125 33 | DTSDKName 34 | macosx10.10 35 | DTXcode 36 | 0640 37 | DTXcodeBuild 38 | 6E35b 39 | NSHumanReadableCopyright 40 | Copyright © 2013 Facebook, Inc. All rights reserved. 41 | 42 | 43 | -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapthaker/FBSimulatorClient/9951d0820f2e990e684ab71635e2bd6c9065306d/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib -------------------------------------------------------------------------------- /Frameworks/FBSimulatorControl.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | pod "GCDWebServer", "~> 3.0" 2 | 3 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GCDWebServer (3.2.7): 3 | - GCDWebServer/Core (= 3.2.7) 4 | - GCDWebServer/Core (3.2.7) 5 | 6 | DEPENDENCIES: 7 | - GCDWebServer (~> 3.0) 8 | 9 | SPEC CHECKSUMS: 10 | GCDWebServer: 76a9540371d5f12f850b32ec7f555dd2d266e543 11 | 12 | COCOAPODS: 0.39.0 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FBSimulatorClient 2 | FBSimulatorClient is a simple way to interface talk to [FBSimulatorControl](https://github.com/facebook/FBSimulatorControl) framework to control using Rest Web Services. 3 | FBSimulatorControl is a Mac OS X library for managing and manipulating iOS Simulators. 4 | 5 | ## Setup ( ๑○ิ﹏○ิ) 6 | 7 | The FBSimulatorClient depends a opensource lib called as [GCD WebServer](https://github.com/swisspol/GCDWebServer) 8 | To install a the dependencies you need [CocoaPods](https://cocoapods.org/). If you don't know whats cocoapods please refer to its [getting started with CocoaPods guide](https://guides.cocoapods.org/using/getting-started.html). The nearest thing that i can tell you is that CocoaPods is like [Maven](https://maven.apache.org/) but for XCode. 9 | 10 | ## Usage (•ิ_•ิ)? 11 | 12 | Once your build the app, you can launch it in command line with the following command: 13 | `./FBSimulatorClient.app/Contents/MacOS/FBSimulatorClient --start-server --port 9898` 14 | 15 | Following are the endpoints which can be hit 16 | 17 | 1. *Launch the simulator* 18 | - endpoint : /simulator/launch 19 | - method : POST 20 | - body : `{"simulatorType":"iPhone5s", "appPath":"/path/to/app"}` 21 | - curl : `curl -H "Content-Type: application/json" -X POST -d '{"simulatorType":"iPhone 5s","appPath":"/Users/tapan/awesome-app/Debug-iphonesimulator/awesome.app"}' localhost:9898/simulator/launch` 22 | 23 | 2. *Kill the simulator(s)* 24 | - endpoint : /simulator/kill 25 | - method : POST 26 | - body : `{"processIdentifer" :"Process identifier of the sim to kill"} or nothing to kill all simulators` 27 | - curl : `url -H "Content-Type: application/json" -X PUT -d '{"processIdentifier":"6410"' localhost:9898/control` 28 | 29 | 3. *Quit the application* 30 | - endpoint : /control 31 | - method : PUT 32 | - body : `{"command" : "quit"}` 33 | - curl : `curl -H "Content-Type: application/json" -X PUT -d '{"command":"quit"}' localhost:9898/control` 34 | 35 | There are obviously more things to be done. But its a start. Look at the power of this thing - 36 | 37 | ![Screenshot](./screen_shot.png) 38 | 39 | 40 | ## Contact 41 | 42 | Follow me on Twitter ([@tapthaker](https://twitter.com/tapthaker)) 43 | 44 | ## Problems ? (✖╭╮✖) 45 | 46 | * Add a new issue on github. 47 | * Add a question on stackoverflow and mention me in a tweet with the link. 48 | 49 | ## To improve 50 | 51 | * More control on the simulators. 52 | * Introduce FBSimulatorControl as podfile instead of prebuild framework 53 | * Integrate this with some automation frameworks like [Calabash](http://calaba.sh/) for parallel execution of features 54 | * Stability issues 55 | 56 | -------------------------------------------------------------------------------- /screen_shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapthaker/FBSimulatorClient/9951d0820f2e990e684ab71635e2bd6c9065306d/screen_shot.png --------------------------------------------------------------------------------