(
device: DeviceInfo,
executable: { executableName: string; executablePath?: string },
)
| 1039 | } |
| 1040 | |
| 1041 | export async function readAppleProcessSamples( |
| 1042 | device: DeviceInfo, |
| 1043 | executable: { executableName: string; executablePath?: string }, |
| 1044 | ): Promise<AppleProcessSample[]> { |
| 1045 | const args = isMacOs(device) |
| 1046 | ? ['-axo', 'pid=,%cpu=,rss=,command='] |
| 1047 | : buildSimctlArgsForDevice(device, [ |
| 1048 | 'spawn', |
| 1049 | device.id, |
| 1050 | 'ps', |
| 1051 | '-axo', |
| 1052 | 'pid=,%cpu=,rss=,command=', |
| 1053 | ]); |
| 1054 | const result = isMacOs(device) |
| 1055 | ? await runAppleToolCommand('ps', args, { timeoutMs: APPLE_PERF_TIMEOUT_MS }) |
| 1056 | : await runAppleSimulatorProcessCommand(args); |
| 1057 | return parseApplePsOutput(result.stdout).filter((process) => |
| 1058 | matchesAppleExecutableProcess(process.command, executable), |
| 1059 | ); |
| 1060 | } |
| 1061 | |
| 1062 | async function resolveAppleMemorySnapshotProcess( |
| 1063 | device: DeviceInfo, |
no test coverage detected