-
Notifications
You must be signed in to change notification settings - Fork 440
/
Copy pathFBSimulatorBridge.h
89 lines (67 loc) · 2.92 KB
/
FBSimulatorBridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <FBControlCore/FBControlCore.h>
NS_ASSUME_NONNULL_BEGIN
@class FBApplicationLaunchConfiguration;
@class FBSimulator;
/**
An interface to the "SimulatorBridge" binary, a remote process that runs inside the iOS Simulator.
This is needed for the SimulatorApp to implement some of it's functionality.
"SimulatorBridge" will wrap functionality that is present in SimulatorApp, but not present in CoreSimulator itself.
"SimulatorBridge" is distinct from "CoreSimulatorBridge", which is an internal implementation detail of the SimDevice API.
*/
@interface FBSimulatorBridge : NSObject
#pragma mark Initializers
/**
Creates and Returns a SimulatorBridge for the attaching to the provided Simulator.
The future will fail if the connection could not established.
@param simulator the Simulator to attach to.
@return a FBSimulatorBridge wrapped in a Future.
*/
+ (FBFuture<FBSimulatorBridge *> *)bridgeForSimulator:(FBSimulator *)simulator;
/**
Should be called when the connection to the remote bridge should be disconnected.
*/
- (FBFuture<NSNull *> *)disconnect;
#pragma mark Interacting with the Simulator
/**
Sets latitude and longitude of the Simulator.
The behaviour of a directly-launched Simulator differs from Simulator.app slightly, in that the location isn't automatically set.
Simulator.app will typically set a location from NSUserDefaults, so Applications will have a default location.
@param latitude the latitude of the location.
@param longitude the longitude of the location.
@return a Future that resolves when the location has been sent.
*/
- (FBFuture<NSNull *> *)setLocationWithLatitude:(double)latitude longitude:(double)longitude;
/**
Enables Accessibility on the Simulator.
@return a future that resolves when accessibility has been enabled.
*/
- (FBFuture<NSNull *> *)enableAccessibility;
/**
The Acessibility Elements.
Obtain the acessibility elements for the main screen.
The returned value is fully JSON serializable.
@return the accessibility elements for the main screen, wrapped in a Future.
*/
- (FBFuture<NSArray<NSDictionary<NSString *, id> *> *> *)accessibilityElements;
/**
Obtain the acessibility element for the main screen at the given point.
The returned value is fully JSON serializable.
@param point the coordinate at which to obtain the accessibility element.
@return the accessibility element at the provided point, wrapped in a Future.
*/
- (FBFuture<NSDictionary<NSString *, id> *> *)accessibilityElementAtPoint:(CGPoint)point;
/**
Enables or disables the hardware keyboard.
@param enabled YES if enabled, NO if disabled.
@return a Future that resolves when successful.
*/
- (FBFuture<NSNull *> *)setHardwareKeyboardEnabled:(BOOL)enabled;
@end
NS_ASSUME_NONNULL_END