({
device,
appBundleId,
outPath,
pidPath,
}: AppLogStartRequest)
| 349 | } |
| 350 | |
| 351 | async function startLocalAppLog({ |
| 352 | device, |
| 353 | appBundleId, |
| 354 | outPath, |
| 355 | pidPath, |
| 356 | }: AppLogStartRequest): Promise<AppLogResult> { |
| 357 | ensureLogPath(outPath); |
| 358 | const stream = fs.createWriteStream(outPath, { flags: 'a' }); |
| 359 | const redactionPatterns = getAppLogRedactionPatterns(); |
| 360 | if (isIosFamily(device)) { |
| 361 | if (device.kind === 'device') { |
| 362 | return await startIosDeviceAppLog(device.id, appBundleId, stream, redactionPatterns, pidPath); |
| 363 | } |
| 364 | return await startIosSimulatorAppLog( |
| 365 | device.id, |
| 366 | appBundleId, |
| 367 | stream, |
| 368 | redactionPatterns, |
| 369 | device.simulatorSetPath, |
| 370 | pidPath, |
| 371 | ); |
| 372 | } |
| 373 | if (device.platform === 'android') { |
| 374 | assertAndroidPackageArgSafe(appBundleId); |
| 375 | return await startAndroidAppLog(device.id, appBundleId, stream, redactionPatterns, pidPath); |
| 376 | } |
| 377 | if (isMacOs(device)) { |
| 378 | return await startMacOsAppLog(appBundleId, stream, redactionPatterns, pidPath); |
| 379 | } |
| 380 | stream.end(); |
| 381 | throw new AppError('UNSUPPORTED_PLATFORM', `unsupported platform: ${device.platform}`); |
| 382 | } |
| 383 | |
| 384 | async function readRecentIosSimulatorNetworkCapture(params: { |
| 385 | deviceId: string; |
no test coverage detected