MCPcopy Index your code
hub / github.com/callstack/agent-device / installAndroidSnapshotHelper

Function installAndroidSnapshotHelper

src/platforms/android/snapshot.ts:267–302  ·  view source on GitHub ↗
(
  options: AndroidSnapshotOptions,
  adb: AndroidAdbExecutor,
  adbProvider: AndroidAdbProvider,
  artifact: AndroidSnapshotHelperArtifact,
  deviceKey: string,
)

Source from the content-addressed store, hash-verified

265}
266
267async function installAndroidSnapshotHelper(
268 options: AndroidSnapshotOptions,
269 adb: AndroidAdbExecutor,
270 adbProvider: AndroidAdbProvider,
271 artifact: AndroidSnapshotHelperArtifact,
272 deviceKey: string,
273): Promise<AndroidSnapshotHelperInstallResult> {
274 const install = await withDiagnosticTimer(
275 'android_snapshot_helper_install',
276 async () =>
277 await ensureAndroidSnapshotHelper({
278 adb,
279 adbProvider,
280 artifact,
281 deviceKey,
282 installPolicy: options.helperInstallPolicy,
283 timeoutMs: HELPER_INSTALL_TIMEOUT_MS,
284 }),
285 {
286 packageName: artifact.manifest.packageName,
287 versionCode: artifact.manifest.versionCode,
288 installPolicy: options.helperInstallPolicy ?? 'missing-or-outdated',
289 },
290 );
291 emitDiagnostic({
292 phase: 'android_snapshot_helper_install_decision',
293 data: {
294 packageName: install.packageName,
295 versionCode: install.versionCode,
296 installedVersionCode: install.installedVersionCode,
297 installed: install.installed,
298 reason: install.reason,
299 },
300 });
301 return install;
302}
303
304async function captureAndroidUiHierarchyFromHelper(params: {
305 options: AndroidSnapshotOptions;

Callers 1

Calls 3

withDiagnosticTimerFunction · 0.90
emitDiagnosticFunction · 0.90

Tested by

no test coverage detected