MCPcopy
hub / github.com/callstack/agent-device / startLocalAppLog

Function startLocalAppLog

src/daemon/app-log.ts:351–382  ·  view source on GitHub ↗
({
  device,
  appBundleId,
  outPath,
  pidPath,
}: AppLogStartRequest)

Source from the content-addressed store, hash-verified

349}
350
351async 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
384async function readRecentIosSimulatorNetworkCapture(params: {
385 deviceId: string;

Callers 1

app-log.tsFile · 0.85

Calls 9

isIosFamilyFunction · 0.90
startIosDeviceAppLogFunction · 0.90
startIosSimulatorAppLogFunction · 0.90
startAndroidAppLogFunction · 0.90
isMacOsFunction · 0.90
startMacOsAppLogFunction · 0.90
ensureLogPathFunction · 0.85

Tested by

no test coverage detected