simtap 0.0.0-stage → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +192 -2
- package/THIRD_PARTY_LICENSES +61 -0
- package/bin/simtap.js +4 -0
- package/dist/act/diff.js +67 -0
- package/dist/act/resolve.js +49 -0
- package/dist/act/steps.js +188 -0
- package/dist/cli.js +123 -0
- package/dist/engine/apps.js +153 -0
- package/dist/engine/axe.js +107 -0
- package/dist/engine/exec.js +36 -0
- package/dist/engine/jobs.js +95 -0
- package/dist/engine/logs.js +115 -0
- package/dist/engine/simctl.js +191 -0
- package/dist/engine/state.js +30 -0
- package/dist/engine/xcode.js +253 -0
- package/dist/engine/xcresult.js +95 -0
- package/dist/errors.js +11 -0
- package/dist/look/read.js +50 -0
- package/dist/look/snapshot.js +455 -0
- package/dist/mcp.js +108 -0
- package/dist/registry.js +65 -0
- package/dist/tools/app-control.js +127 -0
- package/dist/tools/app-logs.js +128 -0
- package/dist/tools/app-run.js +94 -0
- package/dist/tools/device-use.js +68 -0
- package/dist/tools/devices.js +26 -0
- package/dist/tools/jobs.js +55 -0
- package/dist/tools/launch-app.js +68 -0
- package/dist/tools/screen-record.js +79 -0
- package/dist/tools/tests-run.js +81 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/ui-act.js +435 -0
- package/dist/tools/ui-look.js +40 -0
- package/package.json +45 -4
- package/skill/SKILL.md +23 -0
- package/vendor/axe/.version +1 -0
- package/vendor/axe/AXe_AXe.bundle/skills/axe/SKILL.md +87 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/FBControlCore +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBAccessibilityTraits.h +23 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBArchitecture.h +20 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBArchiveOperations.h +136 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBBinaryDescriptor.h +73 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCore-Swift.h +3232 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCore-SwiftImport.h +28 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCore.h +47 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCoreFrameworkLoader.h +104 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCoreLogger+OSLog.h +30 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBControlCoreLogger.h +107 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBCrashLog.h +20 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBDataBuffer.h +75 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBDataConsumer.h +173 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFileContainer.h +46 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFileReader.h +25 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFourCharCode.h +30 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFuture+Sync.h +104 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFuture.h +580 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFutureContextManager.h +61 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstalledApplication.h +30 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstrumentsCommands.h +29 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstrumentsOperation.h +83 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBObjCExceptionGuard.h +59 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBProcessBuilder.h +272 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBProcessFetcher.h +128 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBProcessIO.h +126 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBProcessStream.h +175 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBProcessTerminationStrategy.h +25 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBScreenshotCommands.h +15 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBSettingsCommands.h +22 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBSocketServer.h +63 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBSubprocess.h +131 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBVideoStream.h +255 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBVideoStreamConfiguration.h +51 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBXCTraceOperation.h +13 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBiOSTarget.h +69 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBiOSTargetConfiguration.h +322 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBiOSTargetConstants.h +48 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBiOSTargetOperation.h +18 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/arm64-apple-macos.abi.json +51890 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/arm64-apple-macos.private.swiftinterface +1341 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/arm64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/arm64-apple-macos.swiftinterface +1341 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/arm64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/x86_64-apple-macos.abi.json +51890 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/x86_64-apple-macos.private.swiftinterface +1341 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/x86_64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/x86_64-apple-macos.swiftinterface +1341 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/FBControlCore.swiftmodule/x86_64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Modules/module.modulemap +10 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Resources/Info.plist +50 -0
- package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/_CodeSignature/CodeResources +492 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/FBDeviceControl +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAFCConnection.h +135 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMDServiceConnection.h +239 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMDefines.h +256 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMDevice.h +105 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMDeviceManager.h +59 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMRestorableDevice.h +72 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBAMRestorableDeviceManager.h +32 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDevice.h +89 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceCommands.h +147 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceControl-Swift.h +1500 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceControl.h +24 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceControlFrameworkLoader.h +25 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceDebugSymbolsCommands.h +29 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBDeviceManager.h +118 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Headers/FBInstrumentsClient.h +49 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/arm64-apple-macos.abi.json +16073 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/arm64-apple-macos.private.swiftinterface +398 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/arm64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/arm64-apple-macos.swiftinterface +398 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/arm64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/x86_64-apple-macos.abi.json +16073 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/x86_64-apple-macos.private.swiftinterface +398 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/x86_64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/x86_64-apple-macos.swiftinterface +398 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/FBDeviceControl.swiftmodule/x86_64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Modules/module.modulemap +10 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/Resources/Info.plist +50 -0
- package/vendor/axe/Frameworks/FBDeviceControl.framework/Versions/A/_CodeSignature/CodeResources +324 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/FBSimulatorControl +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBFramebuffer.h +24 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBPeriodicStatsTimer.h +43 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimDeviceWrapper.h +86 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulator.h +160 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorBootConfiguration.h +18 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl-Swift.h +2270 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControl.h +21 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorControlFrameworkLoader.h +45 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Headers/FBSimulatorVideoStream.h +153 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/arm64-apple-macos.abi.json +46980 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/arm64-apple-macos.private.swiftinterface +1072 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/arm64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/arm64-apple-macos.swiftinterface +1072 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/arm64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/x86_64-apple-macos.abi.json +46980 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/x86_64-apple-macos.private.swiftinterface +1072 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/x86_64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/x86_64-apple-macos.swiftinterface +1072 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/FBSimulatorControl.swiftmodule/x86_64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Modules/module.modulemap +10 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/Info.plist +50 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/README.md +124 -0
- package/vendor/axe/Frameworks/FBSimulatorControl.framework/Versions/A/_CodeSignature/CodeResources +293 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBActivityRecord.h +33 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBAttachment.h +25 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBCodeCoverageConfiguration.h +15 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBTestBundleConnection.h +37 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBTestConfiguration.h +74 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBTestManagerAPIMediator.h +46 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBTestManagerResultSummary.h +19 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBTestReporterAdapter.h +27 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/FBXCTestConfiguration.h +30 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/XCTestBootstrap-Swift.h +1570 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/XCTestBootstrap.h +22 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Headers/XCTestBootstrapError.h +25 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/arm64-apple-macos.abi.json +15972 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/arm64-apple-macos.private.swiftinterface +397 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/arm64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/arm64-apple-macos.swiftinterface +397 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/arm64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/x86_64-apple-macos.abi.json +15972 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/x86_64-apple-macos.private.swiftinterface +397 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/x86_64-apple-macos.swiftdoc +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/x86_64-apple-macos.swiftinterface +397 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/XCTestBootstrap.swiftmodule/x86_64-apple-macos.swiftmodule +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Modules/module.modulemap +13 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/Info.plist +50 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/XCTestBootstrap +0 -0
- package/vendor/axe/Frameworks/XCTestBootstrap.framework/Versions/A/_CodeSignature/CodeResources +303 -0
- package/vendor/axe/axe +0 -0
package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBFutureContextManager.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@class FBFuture<T>;
|
|
11
|
+
@class FBFutureContext<T>;
|
|
12
|
+
|
|
13
|
+
@protocol FBControlCoreLogger;
|
|
14
|
+
@protocol FBFutureContextManagerDelegate;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
Manages an asynchronous context that can only be used by a single consumer
|
|
18
|
+
*/
|
|
19
|
+
@interface FBFutureContextManager <ContextType : id> : NSObject
|
|
20
|
+
|
|
21
|
+
#pragma mark Initializers.
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
The Designated Initializer.
|
|
25
|
+
|
|
26
|
+
@param queue the queue to use.
|
|
27
|
+
@param delegate the delegate to use.
|
|
28
|
+
@param logger the logger to use.
|
|
29
|
+
@return a new FBFutureContextManager Instance.
|
|
30
|
+
*/
|
|
31
|
+
+ (nonnull instancetype)managerWithQueue:(nonnull dispatch_queue_t)queue delegate:(nonnull id<FBFutureContextManagerDelegate>)delegate logger:(nonnull id<FBControlCoreLogger>)logger;
|
|
32
|
+
|
|
33
|
+
#pragma mark Public Methods.
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
Aquire the Resource.
|
|
37
|
+
|
|
38
|
+
@param purpose the purpose for utilization.
|
|
39
|
+
@return a context that is available at some point in the future.
|
|
40
|
+
*/
|
|
41
|
+
- (nonnull FBFutureContext<ContextType> *)utilizeWithPurpose:(nonnull NSString *)purpose;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
Synchronously attempt to utilize the context.
|
|
45
|
+
|
|
46
|
+
@param purpose the purpose for utilization.
|
|
47
|
+
@param error an error out for any error that occurs.
|
|
48
|
+
@return the context if one could be synchronously used.
|
|
49
|
+
*/
|
|
50
|
+
- (nullable ContextType)utilizeNowWithPurpose:(nonnull NSString *)purpose error:(NSError * _Nullable * _Nullable)error;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
Synchronously attempt to return the context.
|
|
54
|
+
|
|
55
|
+
@param purpose the purpose for utilization.
|
|
56
|
+
@param error an error out for any error that occurs.
|
|
57
|
+
@return the context if one could be synchronously returned.
|
|
58
|
+
*/
|
|
59
|
+
- (BOOL)returnNowWithPurpose:(nonnull NSString *)purpose error:(NSError * _Nullable * _Nullable)error;
|
|
60
|
+
|
|
61
|
+
@end
|
package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstalledApplication.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
The Installed Type of the Application.
|
|
12
|
+
*/
|
|
13
|
+
typedef NS_ENUM(NSUInteger, FBApplicationInstallType) {
|
|
14
|
+
FBApplicationInstallTypeUnknown = 0, /** The Application is unknown */
|
|
15
|
+
FBApplicationInstallTypeSystem = 1, /** The Application is part of the Operating System */
|
|
16
|
+
FBApplicationInstallTypeMac = 2, /** The Application is part of macOS */
|
|
17
|
+
FBApplicationInstallTypeUser = 3, /** The Application has been installed by the user */
|
|
18
|
+
FBApplicationInstallTypeUserEnterprise = 4, /** The Application has been installed by the user and signed with a distribution certificate */
|
|
19
|
+
FBApplicationInstallTypeUserDevelopment = 5, /** The Application has been installed by the user and signed with a development certificate */
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
Keys from UserInfo about Applications
|
|
24
|
+
*/
|
|
25
|
+
typedef NSString *FBApplicationInstallInfoKey NS_EXTENSIBLE_STRING_ENUM;
|
|
26
|
+
extern FBApplicationInstallInfoKey _Nonnull const FBApplicationInstallInfoKeyApplicationType;
|
|
27
|
+
extern FBApplicationInstallInfoKey _Nonnull const FBApplicationInstallInfoKeyBundleIdentifier;
|
|
28
|
+
extern FBApplicationInstallInfoKey _Nonnull const FBApplicationInstallInfoKeyBundleName;
|
|
29
|
+
extern FBApplicationInstallInfoKey _Nonnull const FBApplicationInstallInfoKeyPath;
|
|
30
|
+
extern FBApplicationInstallInfoKey _Nonnull const FBApplicationInstallInfoKeySignerIdentity;
|
package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstrumentsCommands.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
#import <FBControlCore/FBFuture.h>
|
|
11
|
+
|
|
12
|
+
@protocol FBiOSTarget;
|
|
13
|
+
@protocol FBControlCoreLogger;
|
|
14
|
+
|
|
15
|
+
@class FBInstrumentsConfiguration;
|
|
16
|
+
@class FBInstrumentsOperation;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
Concrete instruments command implementation, target-bound.
|
|
20
|
+
*/
|
|
21
|
+
// @lint-ignore FBOBJCDEPRECATEDCHECK
|
|
22
|
+
@interface FBInstrumentsCommands : NSObject
|
|
23
|
+
|
|
24
|
+
@property (nonnull, nonatomic, readonly, strong) id<FBiOSTarget> target;
|
|
25
|
+
|
|
26
|
+
+ (nonnull instancetype)commandsWithTarget:(nonnull id<FBiOSTarget>)target;
|
|
27
|
+
- (nonnull FBFuture<FBInstrumentsOperation *> *)startInstruments:(nonnull FBInstrumentsConfiguration *)configuration logger:(nonnull id<FBControlCoreLogger>)logger;
|
|
28
|
+
|
|
29
|
+
@end
|
package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBInstrumentsOperation.h
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
#import <FBControlCore/FBSubprocess.h>
|
|
11
|
+
#import <FBControlCore/FBiOSTargetOperation.h>
|
|
12
|
+
|
|
13
|
+
extern const NSTimeInterval DefaultInstrumentsOperationDuration; // Operation duration
|
|
14
|
+
extern const NSTimeInterval DefaultInstrumentsTerminateTimeout; // When stopping instruments with SIGINT, wait this long before SIGKILLing it
|
|
15
|
+
extern const NSTimeInterval DefaultInstrumentsLaunchRetryTimeout; // Wait this long to ensure instruments started properly
|
|
16
|
+
extern const NSTimeInterval DefaultInstrumentsLaunchErrorTimeout; // Fail instruments if the launch error message appears within this timeout
|
|
17
|
+
|
|
18
|
+
@class FBInstrumentsConfiguration;
|
|
19
|
+
|
|
20
|
+
@protocol FBControlCoreLogger;
|
|
21
|
+
@protocol FBiOSTarget;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
Represents an operation of the instruments command-line.
|
|
25
|
+
*/
|
|
26
|
+
@interface FBInstrumentsOperation : NSObject
|
|
27
|
+
|
|
28
|
+
#pragma mark Initializers
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
Constructs an 'instruments' operation, of indefinite length.
|
|
32
|
+
|
|
33
|
+
@param target the target to run against.
|
|
34
|
+
@param configuration the configuration to use.
|
|
35
|
+
@param logger the logger to log to.
|
|
36
|
+
@return a running instruments operation.
|
|
37
|
+
*/
|
|
38
|
+
+ (nonnull FBFuture<FBInstrumentsOperation *> *)operationWithTarget:(nonnull id<FBiOSTarget>)target configuration:(nonnull FBInstrumentsConfiguration *)configuration logger:(nonnull id<FBControlCoreLogger>)logger;
|
|
39
|
+
|
|
40
|
+
- (nonnull instancetype)initWithTask:(nonnull FBSubprocess *)task traceFile:(nonnull NSURL *)traceFile configuration:(nonnull FBInstrumentsConfiguration *)configuration queue:(nonnull dispatch_queue_t)queue logger:(nonnull id<FBControlCoreLogger>)logger;
|
|
41
|
+
|
|
42
|
+
#pragma mark Properties
|
|
43
|
+
|
|
44
|
+
@property (nonnull, nonatomic, readonly, strong) FBSubprocess *task;
|
|
45
|
+
@property (nonnull, nonatomic, readonly, strong) dispatch_queue_t queue;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
Trace output file path.
|
|
49
|
+
*/
|
|
50
|
+
@property (nonnull, nonatomic, readonly, copy) NSURL *traceFile;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
The configuration of the operation.
|
|
54
|
+
*/
|
|
55
|
+
@property (nonnull, nonatomic, readonly, strong) FBInstrumentsConfiguration *configuration;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
The logger to use.
|
|
59
|
+
*/
|
|
60
|
+
@property (nonnull, nonatomic, readonly, strong) id<FBControlCoreLogger> logger;
|
|
61
|
+
|
|
62
|
+
#pragma mark Public Methods
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
Stops the Operation.
|
|
66
|
+
Waits for the trace file to be written out to disk.
|
|
67
|
+
|
|
68
|
+
@return a Future that returns the trace file if successful.
|
|
69
|
+
*/
|
|
70
|
+
- (nonnull FBFuture<NSURL *> *)stop;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
Post-process an instruments trace.
|
|
74
|
+
|
|
75
|
+
@param arguments the arguments to post-process with, if relevant.
|
|
76
|
+
@param traceFile Location of the trace file.
|
|
77
|
+
@param queue the queue to serialize on.
|
|
78
|
+
@param logger the logger to log to.
|
|
79
|
+
@return a delta that post-processes.
|
|
80
|
+
*/
|
|
81
|
+
+ (nonnull FBFuture<NSURL *> *)postProcess:(nullable NSArray<NSString *> *)arguments traceFile:(nonnull NSURL *)traceFile queue:(nonnull dispatch_queue_t)queue logger:(nullable id<FBControlCoreLogger>)logger;
|
|
82
|
+
|
|
83
|
+
@end
|
package/vendor/axe/Frameworks/FBControlCore.framework/Versions/A/Headers/FBObjCExceptionGuard.h
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
/// Error domain for NSException -> NSError conversions performed by FBObjCExceptionGuard.
|
|
13
|
+
extern NSString *const FBObjCExceptionGuardErrorDomain;
|
|
14
|
+
|
|
15
|
+
/// Keys added to the converted NSError's userInfo.
|
|
16
|
+
extern NSString *const FBObjCExceptionGuardExceptionNameKey;
|
|
17
|
+
extern NSString *const FBObjCExceptionGuardExceptionUserInfoKey;
|
|
18
|
+
extern NSString *const FBObjCExceptionGuardCallStackSymbolsKey;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
Bridges Objective-C `NSException` raises into a form Swift can handle.
|
|
22
|
+
|
|
23
|
+
Swift's `do/catch` only handles types conforming to `Swift.Error`. An
|
|
24
|
+
uncaught `NSException` crossing a Swift frame goes straight to `libc++abi`
|
|
25
|
+
and terminates the process. Any Swift call site that messages an
|
|
26
|
+
Objective-C API which may raise (private framework forwarders,
|
|
27
|
+
`NSProxy`-based remote proxies, anything where the receiver does not
|
|
28
|
+
strictly implement every selector its declared protocols claim) should
|
|
29
|
+
funnel the call through this guard.
|
|
30
|
+
|
|
31
|
+
The guard wraps a block in `@try`/`@catch (NSException *)`. If the block
|
|
32
|
+
raises, the exception is converted to an `NSError` in the
|
|
33
|
+
`FBObjCExceptionGuardErrorDomain`. The error's `localizedDescription`
|
|
34
|
+
carries the exception's `reason`; the original `name`, `userInfo`, and
|
|
35
|
+
`callStackSymbols` are preserved under the keys above.
|
|
36
|
+
|
|
37
|
+
Only one ObjC entry point is provided. The Swift extension on this class
|
|
38
|
+
(`FBObjCExceptionGuard.guarded`) wraps it into a generic throwing API
|
|
39
|
+
that captures the closure's return value via local state. That is the
|
|
40
|
+
form Swift call sites should normally use.
|
|
41
|
+
*/
|
|
42
|
+
@interface FBObjCExceptionGuard : NSObject
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
Run a block under @try/@catch (NSException *).
|
|
46
|
+
|
|
47
|
+
In Swift this is auto-bridged to a throwing form:
|
|
48
|
+
`try FBObjCExceptionGuard.tryBlock { … }`
|
|
49
|
+
|
|
50
|
+
@param block The block to invoke.
|
|
51
|
+
@param error On failure, populated with an NSError describing the caught NSException.
|
|
52
|
+
@return YES on success, NO if the block raised an NSException.
|
|
53
|
+
*/
|
|
54
|
+
+ (BOOL)tryBlock:(NS_NOESCAPE void (^)(void))block error:(NSError *_Nullable *_Nullable)error
|
|
55
|
+
NS_SWIFT_NAME(run(_:));
|
|
56
|
+
|
|
57
|
+
@end
|
|
58
|
+
|
|
59
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
#import <FBControlCore/FBSubprocess.h>
|
|
11
|
+
|
|
12
|
+
@protocol FBAccumulatingBuffer;
|
|
13
|
+
@protocol FBControlCoreLogger;
|
|
14
|
+
@protocol FBDataConsumer;
|
|
15
|
+
|
|
16
|
+
@class FBFuture;
|
|
17
|
+
@class FBProcessInput;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
An interface to building FBProcess instances.
|
|
21
|
+
*/
|
|
22
|
+
@interface FBProcessBuilder <StdInType : id, StdOutType : id, StdErrType : id> : NSObject
|
|
23
|
+
|
|
24
|
+
#pragma mark Initializers
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Creates a new Process Builder with the provided launch path.
|
|
28
|
+
stdin is not not connected.
|
|
29
|
+
stdout is written to NSData.
|
|
30
|
+
stderr is written to NSData.
|
|
31
|
+
|
|
32
|
+
@param launchPath the launch path to use. Must not be nil.
|
|
33
|
+
@return a new Process Builder.
|
|
34
|
+
*/
|
|
35
|
+
+ (nonnull FBProcessBuilder<NSNull *, NSData *, NSData *> *)withLaunchPath:(nonnull NSString *)launchPath;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
Creates a new Process Builder with the provided launch path.
|
|
39
|
+
stdin is not not connected.
|
|
40
|
+
stdout is written to NSData.
|
|
41
|
+
stderr is written to NSData.
|
|
42
|
+
|
|
43
|
+
@param launchPath the launch path to use. Must not be nil.
|
|
44
|
+
@param arguments the arguments to launch with.
|
|
45
|
+
@return a new Process Builder.
|
|
46
|
+
*/
|
|
47
|
+
+ (nonnull FBProcessBuilder<NSNull *, NSData *, NSData *> *)withLaunchPath:(nonnull NSString *)launchPath arguments:(nonnull NSArray<NSString *> *)arguments;
|
|
48
|
+
|
|
49
|
+
#pragma mark Spawn Configuration
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
The Launch Path of the Proces
|
|
53
|
+
|
|
54
|
+
@param launchPath the Launch Path. Will remove shellCommand.
|
|
55
|
+
@return the receiver, for chaining.
|
|
56
|
+
*/
|
|
57
|
+
- (nonnull instancetype)withLaunchPath:(nonnull NSString *)launchPath;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
The Arguments of the Process..
|
|
61
|
+
|
|
62
|
+
@param arguments the arguments for the launch path.
|
|
63
|
+
@return the receiver, for chaining.
|
|
64
|
+
*/
|
|
65
|
+
- (nonnull instancetype)withArguments:(nonnull NSArray<NSString *> *)arguments;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
Replaces the environment with the provided environment dictionary.
|
|
69
|
+
|
|
70
|
+
@param environment an Environment Dictionary. Must not be nil.
|
|
71
|
+
@return the receiver, for chaining.
|
|
72
|
+
*/
|
|
73
|
+
- (nonnull instancetype)withEnvironment:(nonnull NSDictionary<NSString *, NSString *> *)environment;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
Adds the provided dictionary to the environment of the built process.
|
|
77
|
+
|
|
78
|
+
@param environment an Environment Dictionary. Must not be nil.
|
|
79
|
+
@return the receiver, for chaining.
|
|
80
|
+
*/
|
|
81
|
+
- (nonnull instancetype)withEnvironmentAdditions:(nonnull NSDictionary<NSString *, NSString *> *)environment;
|
|
82
|
+
|
|
83
|
+
#pragma mark stdin
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
Passes an process input to stdin.
|
|
87
|
+
|
|
88
|
+
@param input the input to pass
|
|
89
|
+
@return the reciver, for chaining.
|
|
90
|
+
*/
|
|
91
|
+
- (nonnull FBProcessBuilder<id, StdOutType, StdErrType> *)withStdIn:(nonnull FBProcessInput *)input;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
Creates a Data Consumer for stdin.
|
|
95
|
+
|
|
96
|
+
@return the reciver, for chaining.
|
|
97
|
+
*/
|
|
98
|
+
- (nonnull FBProcessBuilder<id<FBDataConsumer>, StdOutType, StdErrType> *)withStdInConnected;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
Creates a Data Consumer for stdin.
|
|
102
|
+
|
|
103
|
+
@param data the data to send.
|
|
104
|
+
@return the reciver, for chaining.
|
|
105
|
+
*/
|
|
106
|
+
- (nonnull FBProcessBuilder<NSData *, StdOutType, StdErrType> *)withStdInFromData:(nonnull NSData *)data;
|
|
107
|
+
|
|
108
|
+
#pragma mark stdout
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
Reads stdout into memory, as a Data.
|
|
112
|
+
|
|
113
|
+
@return the receiver, for chaining.
|
|
114
|
+
*/
|
|
115
|
+
- (nonnull FBProcessBuilder<StdInType, NSData *, StdErrType> *)withStdOutInMemoryAsData;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
Reads stdout into memory, as a String.
|
|
119
|
+
|
|
120
|
+
@return the receiver, for chaining.
|
|
121
|
+
*/
|
|
122
|
+
- (nonnull FBProcessBuilder<StdInType, NSString *, StdErrType> *)withStdOutInMemoryAsString;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
Assigns a path to write stdout to.
|
|
126
|
+
|
|
127
|
+
@param stdOutPath the path to write stdout to. Must not be nil.
|
|
128
|
+
@return the receiver, for chaining.
|
|
129
|
+
*/
|
|
130
|
+
- (nonnull FBProcessBuilder<StdInType, NSString *, StdErrType> *)withStdOutPath:(nonnull NSString *)stdOutPath;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
Redirects stdout to /dev/null
|
|
134
|
+
|
|
135
|
+
@return the receiver, for chaining.
|
|
136
|
+
*/
|
|
137
|
+
- (nonnull FBProcessBuilder<StdInType, NSNull *, StdErrType> *)withStdOutToDevNull;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
Redirects stdout to an input stream.
|
|
141
|
+
|
|
142
|
+
@return the receiver, for chaining.
|
|
143
|
+
*/
|
|
144
|
+
- (nonnull FBProcessBuilder<StdInType, NSInputStream *, StdErrType> *)withStdOutToInputStream;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
Redirects stdout data to the consumer.
|
|
148
|
+
|
|
149
|
+
@param consumer the consumer to consume the data.
|
|
150
|
+
@return the receiver, for chaining.
|
|
151
|
+
*/
|
|
152
|
+
- (nonnull FBProcessBuilder<StdInType, id<FBDataConsumer>, StdErrType> *)withStdOutConsumer:(nonnull id<FBDataConsumer>)consumer;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
Redirects stdout to the reader block, on a per line basis.
|
|
156
|
+
|
|
157
|
+
@param reader the block to use for reading lines
|
|
158
|
+
@return the receiver, for chaining.
|
|
159
|
+
*/
|
|
160
|
+
- (nonnull FBProcessBuilder<StdInType, id<FBDataConsumer>, StdErrType> *)withStdOutLineReader:(nonnull void (^)(NSString * _Nonnull))reader;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
Redirects stdout to the provided logger, on a per line basis.
|
|
164
|
+
|
|
165
|
+
@param logger the logger to use for logging lines.
|
|
166
|
+
@return the reciver, for chaining.
|
|
167
|
+
*/
|
|
168
|
+
- (nonnull FBProcessBuilder<StdInType, id<FBControlCoreLogger>, StdErrType> *)withStdOutToLogger:(nonnull id<FBControlCoreLogger>)logger;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
Redirects stdout to the provided logger and prints the output in any error message that occurs.
|
|
172
|
+
|
|
173
|
+
@param logger the logger to use for logging lines.
|
|
174
|
+
@return the reciver, for chaining.
|
|
175
|
+
*/
|
|
176
|
+
- (nonnull FBProcessBuilder<StdInType, id<FBAccumulatingBuffer>, StdErrType> *)withStdOutToLoggerAndErrorMessage:(nonnull id<FBControlCoreLogger>)logger;
|
|
177
|
+
|
|
178
|
+
#pragma mark stderr
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
Reads stderr into memory, as a Data.
|
|
182
|
+
|
|
183
|
+
@return the receiver, for chaining.
|
|
184
|
+
*/
|
|
185
|
+
- (nonnull FBProcessBuilder<StdInType, StdInType, NSData *> *)withStdErrInMemoryAsData;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
Reads stderr into memory, as a String.
|
|
189
|
+
|
|
190
|
+
@return the receiver, for chaining.
|
|
191
|
+
*/
|
|
192
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, NSString *> *)withStdErrInMemoryAsString;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
Assigns a path to write stderr to.
|
|
196
|
+
|
|
197
|
+
@param stdErrPath the path to write stderr to. Must not be nil.
|
|
198
|
+
@return the receiver, for chaining.
|
|
199
|
+
*/
|
|
200
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, NSString *> *)withStdErrPath:(nonnull NSString *)stdErrPath;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
Redirects stderr to /dev/null
|
|
204
|
+
|
|
205
|
+
@return the receiver, for chaining.
|
|
206
|
+
*/
|
|
207
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, NSNull *> *)withStdErrToDevNull;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
Redirects stderr data to the consumer.
|
|
211
|
+
|
|
212
|
+
@param consumer the consumer to consume the data.
|
|
213
|
+
@return the receiver, for chaining.
|
|
214
|
+
*/
|
|
215
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, id<FBDataConsumer>> *)withStdErrConsumer:(nonnull id<FBDataConsumer>)consumer;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
Redirects stderr to the reader block, on a per line basis.
|
|
219
|
+
|
|
220
|
+
@param reader the block to use for reading lines
|
|
221
|
+
@return the receiver, for chaining.
|
|
222
|
+
*/
|
|
223
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, id<FBDataConsumer>> *)withStdErrLineReader:(nonnull void (^)(NSString * _Nonnull))reader;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
Redirects stderr to the provided logger, on a per line basis.
|
|
227
|
+
|
|
228
|
+
@param logger the logger to use for logging lines.
|
|
229
|
+
@return the reciver, for chaining.
|
|
230
|
+
*/
|
|
231
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, id<FBControlCoreLogger>> *)withStdErrToLogger:(nonnull id<FBControlCoreLogger>)logger;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
Redirects stderr to the provided logger and prints the output in any error message that occurs.
|
|
235
|
+
|
|
236
|
+
@param logger the logger to use for logging lines.
|
|
237
|
+
@return the reciver, for chaining.
|
|
238
|
+
*/
|
|
239
|
+
- (nonnull FBProcessBuilder<StdInType, StdOutType, id<FBAccumulatingBuffer>> *)withStdErrToLoggerAndErrorMessage:(nonnull id<FBControlCoreLogger>)logger;
|
|
240
|
+
|
|
241
|
+
#pragma mark Logging
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
Enables logging of the process lifecycle to the provided logger.
|
|
245
|
+
By default the task will be constructed without this logging.
|
|
246
|
+
To get detailed information, pass a logger to this method.
|
|
247
|
+
Logging can be disabled by passing nil.
|
|
248
|
+
|
|
249
|
+
@param logger the logger to log to. Nil may be passed to disable task lifecycle logging, which is the default.
|
|
250
|
+
@return the receiver for chaining.
|
|
251
|
+
*/
|
|
252
|
+
- (nonnull instancetype)withTaskLifecycleLoggingTo:(nullable id<FBControlCoreLogger>)logger;
|
|
253
|
+
|
|
254
|
+
#pragma mark Building
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
Builds and starts the process.
|
|
258
|
+
|
|
259
|
+
@return A future that resolves with the started process..
|
|
260
|
+
*/
|
|
261
|
+
- (nonnull FBFuture<FBSubprocess<StdInType, StdOutType, StdErrType> *> *)start;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
Builds and starts the process, then waits for it to complete with the provided exit codes.
|
|
265
|
+
The future will resolve when the process has finished executing.
|
|
266
|
+
Cancelling the process will cancel the task.
|
|
267
|
+
|
|
268
|
+
@return a Future, encapsulating the process on completion.
|
|
269
|
+
*/
|
|
270
|
+
- (nonnull FBFuture<FBSubprocess<StdInType, StdOutType, StdErrType> *> *)runUntilCompletionWithAcceptableExitCodes:(nullable NSSet<NSNumber *> *)exitCodes;
|
|
271
|
+
|
|
272
|
+
@end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <sys/sysctl.h>
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
@class FBProcessInfo;
|
|
13
|
+
|
|
14
|
+
@class FBFuture<T>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
Queries for Processes running on the Host.
|
|
18
|
+
Should not be called from multiple threads since buffers are re-used internally.
|
|
19
|
+
|
|
20
|
+
Sharing a Query object and guaranteeing serialization of method calls
|
|
21
|
+
can be an effective way to reduce the number of allocations that are required.
|
|
22
|
+
*/
|
|
23
|
+
@interface FBProcessFetcher : NSObject
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
A Query for obtaining all of the process information for a given processIdentifier.
|
|
27
|
+
|
|
28
|
+
@param processIdentifier the Process Identifier to obtain process info for.
|
|
29
|
+
@return an FBProcessInfo object if a process with the given identifier could be found, nil otherwise.
|
|
30
|
+
*/
|
|
31
|
+
- (nullable FBProcessInfo *)processInfoFor:(pid_t)processIdentifier;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Obtain process info for child processes.
|
|
35
|
+
|
|
36
|
+
@param parent the Process Identifier to obtain the subprocesses of
|
|
37
|
+
@return an NSArray<FBProcessInfo> of the parent's child processes.
|
|
38
|
+
*/
|
|
39
|
+
- (nonnull NSArray<FBProcessInfo *> *)subprocessesOf:(pid_t)parent;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
A Query for returning the processes with a given name.
|
|
43
|
+
|
|
44
|
+
@param processName the name of the processes to fetch.
|
|
45
|
+
@return an NSArray<FBProcessInfo> of the found processes.
|
|
46
|
+
*/
|
|
47
|
+
- (nonnull NSArray<FBProcessInfo *> *)processesWithProcessName:(nonnull NSString *)processName;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
A Query for returning the first named child process of the provided parent.
|
|
51
|
+
|
|
52
|
+
@param parent the Process Identifier of the parent process.
|
|
53
|
+
@param name the name of the child process.
|
|
54
|
+
@return a Process Identifier of the child process if one could be found, -1 otherwise.
|
|
55
|
+
*/
|
|
56
|
+
- (pid_t)subprocessOf:(pid_t)parent withName:(nonnull NSString *)name;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
A Query for returning the parent of the provided child process
|
|
60
|
+
|
|
61
|
+
@param child the Process Identifier of the child process.
|
|
62
|
+
@return a Process Identifier of the parent process if one could be found, -1 otherwise.
|
|
63
|
+
*/
|
|
64
|
+
- (pid_t)parentOf:(pid_t)child;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
A Query for returning the process identifier of the first found process with an open file of filename.
|
|
68
|
+
This is a operation is generally more expensive than the others.
|
|
69
|
+
|
|
70
|
+
@param filePath the path to the file.
|
|
71
|
+
@return a Process Identifier for the first process with an open file to the path, -1 otherwise.
|
|
72
|
+
*/
|
|
73
|
+
- (pid_t)processWithOpenFileTo:(nonnull const char *)filePath;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
Verify if process is running
|
|
77
|
+
|
|
78
|
+
@param processIdentifier process to check.
|
|
79
|
+
@param error an error out for any error that occurs.
|
|
80
|
+
@return YES if process is Runnig and error is NOT set. False if process isn't running or error is set.
|
|
81
|
+
*/
|
|
82
|
+
- (BOOL)isProcessRunning:(pid_t)processIdentifier error:(NSError * _Nullable * _Nullable)error;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
Verify if process is stopped
|
|
86
|
+
|
|
87
|
+
@param processIdentifier process to check.
|
|
88
|
+
@param error an error out for any error that occurs.
|
|
89
|
+
@return YES if process is Stopped and error is NOT set. False if process isn't stopped or error is set.
|
|
90
|
+
*/
|
|
91
|
+
- (BOOL)isProcessStopped:(pid_t)processIdentifier error:(NSError * _Nullable * _Nullable)error;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
Verify if process has a debugger attached to it.
|
|
95
|
+
|
|
96
|
+
@param processIdentifier process to check.
|
|
97
|
+
@param error an error out for any error that occurs.
|
|
98
|
+
@return YES if process is has a debugger attached and error is NOT set.. False if process doesn't have a debugger attached or error is set.
|
|
99
|
+
*/
|
|
100
|
+
- (BOOL)isDebuggerAttachedTo:(pid_t)processIdentifier error:(NSError * _Nullable * _Nullable)error;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
Wait for a debugger to attach to the process and the process to be up running again.
|
|
104
|
+
|
|
105
|
+
@param processIdentifier the Process Identifier of the process.
|
|
106
|
+
@return A future waitting for the debugger and process up running again.
|
|
107
|
+
*/
|
|
108
|
+
+ (nonnull FBFuture<NSNull *> *)waitForDebuggerToAttachAndContinueFor:(pid_t)processIdentifier;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
Wait for process to receive SIGSTOP.
|
|
112
|
+
|
|
113
|
+
@param processIdentifier the Process Identifier of the process.
|
|
114
|
+
@return A future waitting for the process to be in SSTOP state.
|
|
115
|
+
*/
|
|
116
|
+
+ (nonnull FBFuture<NSNull *> *)waitStopSignalForProcess:(pid_t)processIdentifier;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
Performs a stackshot on the provided process id.
|
|
120
|
+
Does not terminate the process after performing the stackshot.
|
|
121
|
+
Returns a future to a string containing the stackshot.
|
|
122
|
+
|
|
123
|
+
@param processIdentifier the process identifier of the process to stackshot.
|
|
124
|
+
@param queue the queue to use.
|
|
125
|
+
*/
|
|
126
|
+
+ (nonnull FBFuture<id> *)performSampleStackshotForProcessIdentifier:(pid_t)processIdentifier queue:(nonnull dispatch_queue_t)queue;
|
|
127
|
+
|
|
128
|
+
@end
|