-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
310 lines (294 loc) · 8.36 KB
/
types.ts
File metadata and controls
310 lines (294 loc) · 8.36 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
import {SubProcess, TeenProcessExecResult} from 'teen_process';
/**
* Information about a running process on the device
*/
export interface ProcessInfo {
/** The process identifier */
processIdentifier: number;
/** The executable path */
executable: string;
}
/**
* Information about an installed app on the device
*/
export interface AppInfo {
/** Whether this is an app clip */
appClip: boolean;
/** Whether this app was built by a developer */
builtByDeveloper: boolean;
/** The bundle identifier */
bundleIdentifier: string;
/** The bundle version */
bundleVersion: string;
/** Whether this is a default system app */
defaultApp: boolean;
/** Whether this app is hidden */
hidden: boolean;
/** Whether this is an internal system app */
internalApp: boolean;
/** The app name */
name: string;
/** Whether this app can be removed */
removable: boolean;
/** The app URL/path */
url: string;
/** The app version */
version: string;
}
/**
* Options for executing devicectl commands
*/
export interface ExecuteOptions {
/**
* Whether to drop the --device option from the actual devicectl command
* @default false
*/
noDevice?: boolean;
/**
* Whether to log stdout output
* @default false
*/
logStdout?: boolean;
/**
* Whether to return JSON output
* @default true
*/
asJson?: boolean;
/**
* Whether to run the command asynchronously
* @default false
*/
asynchronous?: boolean;
/** Additional subcommand options */
subcommandOptions?: string[] | string;
/** Timeout in milliseconds */
timeout?: number;
}
/**
* Options for asynchronous execution
*/
export interface AsyncExecuteOptions extends ExecuteOptions {
asynchronous: true;
}
/**
* Options for listing files on the device
*/
export interface ListFilesOptions {
/** The username of the user we should target. Only relevant for certain domains. */
username?: string;
/** A subdirectory within the domain. If not specified, defaults to the root. */
subdirectory?: string;
}
/**
* Options for pulling files from the device
*/
export interface PullFileOptions {
/** The username of the user we should target. Only relevant for certain domains. */
username?: string;
/** The file service domain. Valid values are: temporary, rootStaging, appDataContainer, appGroupDataContainer, systemCrashLogs */
domainType: string;
/** A unique string used to provide additional context to the domain */
domainIdentifier: string;
/** The timeout for pulling a file in milliseconds */
timeout?: number;
}
/**
* Options for launching an app
*/
export interface LaunchAppOptions {
/** Environment variables for the launching app process */
env?: Record<string, string | number>;
/** Whether to terminate the already running app */
terminateExisting?: boolean;
}
/**
* Result type for synchronous execution
*/
export type SyncExecuteResult = TeenProcessExecResult<string>;
/**
* Result type for asynchronous execution
*/
export type AsyncExecuteResult = SubProcess;
/**
* Union type for execute method return
*/
export type ExecuteResult<T extends ExecuteOptions> = T extends AsyncExecuteOptions
? AsyncExecuteResult
: SyncExecuteResult;
/**
* CPU type information
*/
export interface CPUType {
/** The CPU type name
* @example "arm64e" */
name: string;
/** The CPU subtype
* @example 2 */
subType: number;
/** The CPU type identifier
* @example 16777228 */
type: number;
}
/**
* Device capability information
*/
export interface Capability {
/** The feature identifier
* @example "com.apple.coredevice.feature.installapp" */
featureIdentifier: string;
/** The capability name
* @example "Install Application" */
name: string;
}
/**
* Connection properties for the device
*/
export interface ConnectionProperties {
/** The authentication type
* @example "manualPairing" */
authenticationType: string;
/** Whether this is a mobile device only
* @example false */
isMobileDeviceOnly: boolean;
/** The last connection date in ISO format
* @example "2025-01-01T12:00:00.000Z" */
lastConnectionDate?: string;
/** List of local hostnames
* @example ["MyDevice.coredevice.local", "ABCD1234-5678-90EF-GHIJ-KLMNOPQRSTUV.coredevice.local"] */
localHostnames?: string[];
/** The pairing state
* @example "paired" */
pairingState: string;
/** List of potential hostnames
* @example ["MyDevice.coredevice.local", "ABCD1234-5678-90EF-GHIJ-KLMNOPQRSTUV.coredevice.local"] */
potentialHostnames: string[];
/** The transport type
* @example "wired" */
transportType?: string;
/** The tunnel IP address
* @example "fdda:f9b3:f5d9::1" */
tunnelIPAddress?: string;
/** The tunnel state
* @example "connected" */
tunnelState: string;
/** The tunnel transport protocol
* @example "tcp" */
tunnelTransportProtocol?: string;
}
/**
* Device properties
*/
export interface DeviceProperties {
/** The boot state
* @example "booted" */
bootState?: string;
/** Whether booted from snapshot
* @example true */
bootedFromSnapshot?: boolean;
/** The booted snapshot name
* @example "com.apple.os.update-ABCDEF1234567890" */
bootedSnapshotName?: string;
/** Whether DDI services are available
* @example true */
ddiServicesAvailable?: boolean;
/** The developer mode status
* @example "enabled" */
developerModeStatus?: string;
/** Whether has internal OS build
* @example false */
hasInternalOSBuild?: boolean;
/** The device name
* @example "My iPhone" */
name: string;
/** The OS build update
* @example "22A100" */
osBuildUpdate: string;
/** The OS version number
* @example "18.0.0" */
osVersionNumber: string;
/** Whether root file system is writable
* @example false */
rootFileSystemIsWritable?: boolean;
/** The screen viewing URL
* @example "devices://device/open?id=ABCD1234-5678-90EF-GHIJ-KLMNOPQRSTUV" */
screenViewingURL?: string;
/** Whether supports checked allocations
* @example false */
supportsCheckedAllocations?: boolean;
}
/**
* Hardware properties for the device
*/
export interface HardwareProperties {
/** The CPU type
* @example { name: "arm64e", subType: 2, type: 16777228 } */
cpuType: CPUType;
/** The device type
* @example "iPhone" */
deviceType: string;
/** The ECID
* @example 1234567890123456 */
ecid: number;
/** The hardware model
* @example "D63AP" */
hardwareModel: string;
/** The internal storage capacity in bytes
* @example 128000000000 */
internalStorageCapacity?: number;
/** Whether is production fused
* @example true */
isProductionFused?: boolean;
/** The marketing name
* @example "iPhone 15" */
marketingName?: string;
/** The platform
* @example "iOS", "tvOS" */
platform: string;
/** The product type
* @example "iPhone16,1" */
productType: string;
/** The reality type (physical or simulator)
* @example "physical" */
reality?: string;
/** The serial number
* @example "ABC1234XYZ" */
serialNumber?: string;
/** List of supported CPU types
* @example [{ name: "arm64e", subType: 2, type: 16777228 }, { name: "arm64", subType: 0, type: 16777228 }] */
supportedCPUTypes?: CPUType[];
/** List of supported device families
* @example [1, 2], [3] */
supportedDeviceFamilies: number[];
/** The thinning product type
* @example "iPhone16,1" */
thinningProductType?: string;
/** The UDID
* @example "00000000-0000000000000000" */
udid: string;
}
/**
* Complete device information
*/
export interface DeviceInfo {
/** List of device capabilities
* @example [{ featureIdentifier: "com.apple.coredevice.feature.installapp", name: "Install Application" }] */
capabilities: Capability[];
/** Connection properties
* @example { authenticationType: "manualPairing", pairingState: "paired", transportType: "wired" } */
connectionProperties: ConnectionProperties;
/** Device properties
* @example { name: "My iPhone", bootState: "booted", osVersionNumber: "18.0.0" } */
deviceProperties: DeviceProperties;
/** Hardware properties
* @example { deviceType: "iPhone", platform: "iOS", udid: "00000000-0000000000000000" } */
hardwareProperties: HardwareProperties;
/** The device identifier
* @example "ABCD1234-5678-90EF-GHIJ-KLMNOPQRSTUV" */
identifier: string;
/** List of tags
* @example [] */
tags: string[];
/** The visibility class
* @example "default" */
visibilityClass: string;
}