FBControlCore
The base framework of the idb project: FBSimulatorControl, FBDeviceControl and FBXCTestCore are all built on it. It defines the interfaces that make an iOS Simulator and an iOS Device interchangeable to callers, and provides the machinery those frameworks share.
It is written in Swift, apart from a small Objective-C guard that catches exceptions thrown by Apple's private Objective-C API.
What it provides
- Targets.
Targetdescribes a single iOS Simulator or Device;SimulatorandDeviceimplement it in their respective frameworks, so higher layers can treat a target uniformly regardless of its kind.TargetSetis the counterpart for collections of targets. - Command protocols. Functionality is defined as protocols, such as
ApplicationCommands, implemented separately for Simulators and Devices. Protocols common to both are part ofTarget; target-specific ones are declared on the concrete classes. A capability built in a module of its own is a protocol refiningTargetthat the module conforms each target to, so this framework does not have to know it:VideoTarget, inFBVideoCore, is one. The protocols are Swift, withasyncmethods. - Configuration values. Value types such as
ApplicationLaunchConfigurationgather the arguments to a call, providing defaults instead of long parameter lists. - Asynchrony. Asynchronous work uses Swift Concurrency throughout.
AsyncEventsignals that something has happened, or failed, to any number of waiters, andAsyncPollingwaits on a condition against a timeout that says what it was waiting for. - IO and processes. Abstractions for reading and writing between sources and sinks (
DescriptorReader,FileWriter), and for spawning and supervising processes, backed bylibdispatch. - Logging.
ControlCoreLoggerprovides a common logging interface for all of the frameworks.
The architecture documentation covers how these pieces fit together in idb.