stim 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{acquire-artifact-zA4S7RHE.mjs → acquire-artifact-DVsvSwf7.mjs} +1 -1
- package/dist/{act-BbHS3oV8.mjs → act-C-BqJEpu.mjs} +157 -35
- package/dist/{activity-BpjwrQXU.mjs → activity-Lnb_EoRY.mjs} +4 -5
- package/dist/{agent-device-usage-output-Bnkerfod.mjs → agent-device-usage-output-DbXy5tg8.mjs} +4 -4
- package/dist/{android-saBeB4lr.mjs → android-B5P81yI-.mjs} +1 -1
- package/dist/{android-CNZgRC-4.mjs → android-CSbLRD53.mjs} +5 -5
- package/dist/{android-BGwuK3Mc.mjs → android-CiNQw3kq.mjs} +73 -49
- package/dist/{android-Cjcj8MCw.mjs → android-DTAcRwBC.mjs} +81 -34
- package/dist/{android-cas-BVqh2Zep.mjs → android-cas-BTVhZ0Qs.mjs} +4 -4
- package/dist/{android-project-CTYaETc0.d.mts → android-project-DUGMbq28.d.mts} +55 -1
- package/dist/api.d.mts +8 -5
- package/dist/api.mjs +27 -27
- package/dist/apk-signed-tail-B46U9hXc.mjs +142 -0
- package/dist/{artifact-Co8zixVx.mjs → artifact-BxREhAaV.mjs} +23 -18
- package/dist/{artifact-DN8JNwqS.mjs → artifact-CsAP6AGK.mjs} +35 -20
- package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
- package/dist/{browser-web-CCgZsHmI.mjs → browser-web-rYPyqhTf.mjs} +11 -12
- package/dist/{budget-HyShrIpL.mjs → budget-k2mZGvvk.mjs} +196 -33
- package/dist/{build-CAiw8Ezm.mjs → build-DPhApsjV.mjs} +26 -23
- package/dist/{build-cache-CKCzxzxA.mjs → build-cache-DrXNCy3T.mjs} +103 -21
- package/dist/{build-plan-zCuHGlA8.mjs → build-plan-DrMMdayj.mjs} +5 -5
- package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-BEZ9Bpl1.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-h1FKhZeg.mjs → ccache-Bx5TbxwG.mjs} +6 -6
- package/dist/{cli-C4w607Pz.mjs → cli-BBKFGOFl.mjs} +19 -19
- package/dist/cli.mjs +1 -1
- package/dist/{client-BQsmyp_-.mjs → client-D9CaRks-.mjs} +36 -61
- package/dist/collector-run.mjs +4 -4
- package/dist/{command-output-BBvS1H6v.mjs → command-output-BF5AR2dL.mjs} +1 -1
- package/dist/{config-BZhXY15H.mjs → config-BktkY_zC.mjs} +321 -15
- package/dist/{launch-DscF1QfM.mjs → dependencies-Dw6wfQdv.mjs} +258 -255
- package/dist/{dependency-state-BwNCYG5Q.mjs → dependency-state-DFB41vfr.mjs} +1 -1
- package/dist/{dev-client-CHoXXZeg.mjs → dev-client-DXR_tPVY.mjs} +2 -2
- package/dist/{device-B9FqTBYW.mjs → device-BK-zwyd_.mjs} +13 -13
- package/dist/{device-F5-4z9ef.mjs → device-BcYeHSFu.mjs} +14 -14
- package/dist/{device-capacity-ZYaRALv5.mjs → device-capacity-DCSvUF0l.mjs} +10 -17
- package/dist/device-host-worker.mjs +11 -13
- package/dist/{device-ios-DkHBrmvH.mjs → device-ios-BLGfXQeK.mjs} +49 -17
- package/dist/{device-lease-run-ogEeJ62K.mjs → device-lease-run-BmvIl7bI.mjs} +4 -4
- package/dist/{device-pool-BIg8MU8l.mjs → device-pool-Dluix4H3.mjs} +3 -3
- package/dist/{doctor-k3P3PizH.mjs → doctor-Bhg1ii70.mjs} +14 -14
- package/dist/{doctor-A_Nr_fDe.mjs → doctor-Cp-BhzTS.mjs} +1 -1
- package/dist/{doctor-Bm8TVpGn.mjs → doctor-OnwP94ne.mjs} +72 -23
- package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-D3a04Mhu.mjs} +8 -2
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-BovI1y3-.mjs → doctor-watchman-BStK05nt.mjs} +4 -4
- package/dist/{eas-build-CyDKNTBP.mjs → eas-build-Dsj93iM9.mjs} +2 -2
- package/dist/{eas-fallback-gaZi-dJL.mjs → eas-fallback-FwkeqqGi.mjs} +10 -10
- package/dist/{eas-session-ledger-BMCA1gdO.mjs → eas-session-ledger-B5vygTiD.mjs} +5 -5
- package/dist/{error-diagnostics-B1Mj_-7h.mjs → error-diagnostics-BOOm9Db7.mjs} +8 -8
- package/dist/{gc-eaz403W6.mjs → gc-C_79zvz4.mjs} +2 -2
- package/dist/{gc-B9jcnmIk.mjs → gc-ldgr-hXU.mjs} +74 -43
- package/dist/{guide-DR0K0xW9.mjs → guide-D7K0X6KG.mjs} +272 -52
- package/dist/{hosted-android-Bvb2-ZxD.mjs → hosted-android-Bk54ej6n.mjs} +3 -3
- package/dist/{hosted-client-rsRqysJc.mjs → hosted-client-fHO8yqzc.mjs} +5 -5
- package/dist/{hosted-ios-RtVcJH3u.mjs → hosted-ios-D55QhYaD.mjs} +1 -1
- package/dist/{hosted-logs-CWKGYWNX.mjs → hosted-logs-BfbmDM4M.mjs} +17 -11
- package/dist/hosted-logs-sync-B0pvmOk-.mjs +195 -0
- package/dist/{hosted-macos-d0pv9Tth.mjs → hosted-macos-CPl0OZ9h.mjs} +5 -5
- package/dist/{hosted-native-BxTizGU2.mjs → hosted-native-CpDB3-PO.mjs} +6 -7
- package/dist/{idle-shutdown-BIyfl0Zj.mjs → idle-shutdown-FfxL1KdG.mjs} +22 -9
- package/dist/{ios-Dvt97HgQ.mjs → ios-B7-lToDu.mjs} +8 -8
- package/dist/{ios-BQzvJlzw.mjs → ios-WxpDJ5T1.mjs} +72 -5
- package/dist/{ios-device-CKSvk0bu.mjs → ios-device-CsyryvpT.mjs} +1 -1
- package/dist/{ios-BRVM8b0P.mjs → ios-ftxdQbJS.mjs} +74 -46
- package/dist/{ios-project-DCUDo06I.mjs → ios-project-Ty5pHl9O.mjs} +6 -6
- package/dist/{ios-state-CT9nV5SP.mjs → ios-state-Cw7-WQf2.mjs} +1 -1
- package/dist/{js-swap-Z9HbC4cj.mjs → js-swap-BMhXYVDS.mjs} +4 -4
- package/dist/{launch-D0lPvFFu.mjs → launch-DOp8RjDz.mjs} +31 -26
- package/dist/{logs-BsIRre8x.mjs → logs-dQDki6Tt.mjs} +9 -173
- package/dist/{logs-Crs9y34Z.mjs → logs-s1dRIG1E.mjs} +85 -36
- package/dist/{macos-CcUlJPMu.mjs → macos-B0VEV3Gf.mjs} +1 -1
- package/dist/{macos-D477nfzH.mjs → macos-DBBPNnIA.mjs} +18 -19
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +28 -11
- package/dist/{metro-1pJgCX4U.mjs → metro-CjC10t6E.mjs} +2 -2
- package/dist/{metro-gateway-Bp9gJQAN.mjs → metro-gateway-B6_PgD0L.mjs} +2 -3
- package/dist/{named-ports-BVbn8SvC.mjs → named-ports-BG0j1X4g.mjs} +2 -2
- package/dist/{native-android-BvMizJn1.mjs → native-android-CL2NGiik.mjs} +17 -17
- package/dist/{native-gradle-artifact-inputs-BJscK4vN.mjs → native-gradle-artifact-inputs-btSUulme.mjs} +3 -3
- package/dist/{native-run-D5OJsGwA.mjs → native-run-BfIDFKLH.mjs} +2 -3
- package/dist/{native-runtime-B9w_Qyz3.mjs → native-runtime-Dq3RBcON.mjs} +6 -7
- package/dist/{native-xcode-inputs-Cv4l-obn.mjs → native-xcode-inputs-BW7H8JGu.mjs} +2 -2
- package/dist/{native-xcode-ios-DGrg90hE.mjs → native-xcode-ios-CBXJAxfC.mjs} +15 -16
- package/dist/offload-worker.d.mts +3 -1
- package/dist/offload-worker.mjs +31 -21
- package/dist/{ownership-jxxz-19m.mjs → ownership-BjYvMNX_.mjs} +2 -2
- package/dist/{phone-reverses-CYb7RRAx.mjs → phone-reverses-lmj6kcPm.mjs} +3 -3
- package/dist/{placement-log-DjOXJRIH.mjs → placement-log-DIFPQAXp.mjs} +1 -1
- package/dist/{plan-placement-BqKgKHCi.mjs → plan-placement-IiiSQhtz.mjs} +3 -3
- package/dist/{ports-DtS1Amb0.mjs → ports-C2_w1Z0Z.mjs} +3 -3
- package/dist/prebuild-gmouvmJZ.mjs +1247 -0
- package/dist/{project-BiC68mIp.mjs → project-BUu6Is4k.mjs} +15 -16
- package/dist/{react-native-android-DRYqoJc4.mjs → react-native-android-Cgg99REN.mjs} +47 -33
- package/dist/{react-native-build-CwZB-agu.mjs → react-native-build-oNwqF5Wb.mjs} +7 -7
- package/dist/{react-native-doctor-BCrytK7h.mjs → react-native-doctor-BhA3KUte.mjs} +49 -8
- package/dist/{react-native-ios-Cr1buNFo.mjs → react-native-ios-B-nf4rjN.mjs} +37 -23
- package/dist/{recordings-BaoQ0t-J.mjs → recordings-BldzVKq0.mjs} +1 -1
- package/dist/{reload-Beftw2X3.mjs → reload-C9OduiNc.mjs} +1 -1
- package/dist/{reload-FbSgMF8x.mjs → reload-CCR7KC_l.mjs} +14 -14
- package/dist/{remote-BuZj6AyU.mjs → remote-C8S7FlPF.mjs} +7 -7
- package/dist/{result-CR2vk2cj.mjs → result-7F5hEwQJ.mjs} +16 -16
- package/dist/{run-BtzE09Dl.mjs → run-BqB0v3pt.mjs} +1 -1
- package/dist/{selection-D5cxEl3t.mjs → selection-BNPBZ6T5.mjs} +155 -42
- package/dist/{server-bare-CH9X0RLn.mjs → server-bare-A75rDIdD.mjs} +1 -1
- package/dist/{server-command-CaBbDNU2.mjs → server-command-CssKFOD7.mjs} +4 -4
- package/dist/{server-expo-Ck8EIidM.mjs → server-expo-eQfOdydb.mjs} +2 -2
- package/dist/server-expo-wvcj5tiZ.mjs +2 -0
- package/dist/{settings-B5tCoq9N.mjs → settings-CosW5X-S.mjs} +1 -1
- package/dist/{settings-DzH9mGQZ.mjs → settings-OaGQF-ri.mjs} +1 -1
- package/dist/{settings-write-n0zwfohx.mjs → settings-write-QjYfSrjF.mjs} +5 -5
- package/dist/settings.schema.json +33 -6
- package/dist/{simslim-BjxszUAb.mjs → simslim-Bax1qcxu.mjs} +3 -2
- package/dist/{slot-launch-QeuJMlnJ.mjs → slot-launch-CYCEhfBY.mjs} +6 -6
- package/dist/{stage-D8xlRU2D.mjs → stage-jKQ7CP_B.mjs} +1 -1
- package/dist/{start-C1JLjkNw.mjs → start-C_wefNKB.mjs} +1 -1
- package/dist/{start-YMpNwLhh.mjs → start-_BdJ32cZ.mjs} +9 -10
- package/dist/{state-DMRNP7-4.mjs → state-C1i2nMOP.mjs} +2 -3
- package/dist/{state-DPaM3u5K.mjs → state-C4OdpOTF.mjs} +1 -2
- package/dist/{stats-CP7STzZw.mjs → stats-tEpEEH-u.mjs} +4 -4
- package/dist/{status-cNw6i0_t.mjs → status-B9M7x4CZ.mjs} +1 -1
- package/dist/{status-Fect2w9R.mjs → status-CRXz-Gtj.mjs} +1 -1
- package/dist/{status-CRLiJ-O_.mjs → status-DQrqodLj.mjs} +22 -23
- package/dist/{status-watch-Bc2J4TZn.mjs → status-watch-B5wDIH_o.mjs} +4 -4
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-6Dqp-gjX.mjs} +1 -1
- package/dist/{stop-Br7LKxBE.mjs → stop-CmdNhGlC.mjs} +2 -2
- package/dist/{stop-Db9Kh-UA.mjs → stop-DRqQVqDJ.mjs} +21 -19
- package/dist/{stop-COP6PQqw.mjs → stop-ySNQHXMG.mjs} +4 -5
- package/dist/supervisor-run.d.mts +1 -0
- package/dist/supervisor-run.mjs +14 -15
- package/dist/{support-Cxj9CmII.mjs → support-BGSCBoib.mjs} +4 -4
- package/dist/{support-qKcbgmI5.mjs → support-CVOCp0Ft.mjs} +9 -9
- package/dist/{swiftpm-artifact-inputs-iY9fsmOc.mjs → swiftpm-artifact-inputs-CfUzt_0Z.mjs} +1 -1
- package/dist/{swiftpm-macos-Bp_sn9P4.mjs → swiftpm-macos-x6HPpl_2.mjs} +9 -9
- package/dist/toolchain-DoavrvIA.mjs +2 -0
- package/dist/toolchain-J4J8MrAr.mjs +2107 -0
- package/dist/trigger-DzJu208Q.mjs +2 -0
- package/dist/{trigger-CBMe2YLH.mjs → trigger-KVaWWNyn.mjs} +1 -1
- package/dist/{warm-progress-BV3ZPmcY.mjs → warm-progress-DvhTX_eu.mjs} +3 -4
- package/dist/web-BFLueSh-.mjs +2 -0
- package/dist/{web-B4Yjyt1G.mjs → web-Bihbf7-u.mjs} +8 -9
- package/dist/web-run.mjs +4 -4
- package/dist/{workspace-state-CPSp3mav.mjs → workspace-state-pUg3_RRA.mjs} +45 -7
- package/dist/{workspaces-C9w4aeXF.mjs → workspaces-g2lhdBXF.mjs} +17 -17
- package/dist/{worktree-CclFIe1Z.mjs → worktree-BKuklFh_.mjs} +34 -31
- package/dist/{worktree-Ct9Gk3KL.mjs → worktree-Bm4cb-nU.mjs} +1 -1
- package/package.json +8 -8
- package/dist/created-devices-D2Aca-xu.mjs +0 -52
- package/dist/paths-DQtTgsBf.mjs +0 -42
- package/dist/prebuild-JUaqOLpc.mjs +0 -501
- package/dist/server-expo-C16Zf2k7.mjs +0 -2
- package/dist/toolchain-DB1aeqxO.mjs +0 -2
- package/dist/toolchain-VzLJzZ7O.mjs +0 -908
- package/dist/trigger-BLsHgAGR.mjs +0 -2
- package/dist/web-DS4UDWvf.mjs +0 -2
- package/dist/xcode-CiIIDnuD.mjs +0 -910
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { B as deviceSlotFileKey,
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import { n as macosDir } from "./state-
|
|
6
|
-
import { n as androidLogGroups, r as isAndroidCrashText } from "./android-
|
|
7
|
-
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
8
|
-
import { c as call } from "./hosted-client-
|
|
2
|
+
import { E as workspaceDir, k as workspaceLogsDir$1 } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { B as deviceSlotFileKey, nt as parseMachine$1, q as validateDeviceSlot } from "./config-BktkY_zC.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
5
|
+
import { n as macosDir } from "./state-C4OdpOTF.mjs";
|
|
6
|
+
import { n as androidLogGroups, r as isAndroidCrashText } from "./android-B5P81yI-.mjs";
|
|
7
|
+
import { r as createNdjsonWriter, s as readNdjsonGenerations$1 } from "./ndjson-CgE_o3Dl.mjs";
|
|
8
|
+
import { c as call } from "./hosted-client-fHO8yqzc.mjs";
|
|
9
9
|
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
11
11
|
import { LOG_ROTATE_BYTES, ambientWrite, withDirLockAsync } from "@stim-cli/core";
|
|
@@ -205,10 +205,10 @@ async function pullHostedMacosLogs(root, placement, host, target = MACOS, maxPag
|
|
|
205
205
|
if (!isJsonObject(result) || !cursor || !Array.isArray(result.records) || !result.records.every(isJsonObject) || typeof result.more !== "boolean") throw new Error(`${host.machine} answered device-host.logs.query with an unexpected result.`);
|
|
206
206
|
signal?.throwIfAborted();
|
|
207
207
|
await commitPage(root, placement.session, before, result.records, cursor, target);
|
|
208
|
-
if (!result.more) return;
|
|
209
208
|
const nextCheckpoint = typeof result.checkpoint === "number" ? result.checkpoint : void 0;
|
|
209
|
+
if (!result.more) return nextCheckpoint;
|
|
210
210
|
if (sameCursor(cursor, before) && nextCheckpoint === checkpoint) {
|
|
211
|
-
if (target.platform === "macos" && !final) return;
|
|
211
|
+
if (target.platform === "macos" && !final) return void 0;
|
|
212
212
|
throw new Error("Hosted native logs made no progress; keeping the logs already copied here.");
|
|
213
213
|
}
|
|
214
214
|
checkpoint = nextCheckpoint;
|
|
@@ -217,10 +217,16 @@ async function pullHostedMacosLogs(root, placement, host, target = MACOS, maxPag
|
|
|
217
217
|
}
|
|
218
218
|
async function pullHostedNativeLogs(root, slot, placement, host, final = false, platform = "ios", signal) {
|
|
219
219
|
if (!host.connection.supports(platform === "ios" ? "hosted-ios-data" : "hosted-android-data")) throw new Error(`${host.machine} needs a newer stim-server to collect hosted ${platform === "ios" ? "iOS" : "Android"} native logs.`);
|
|
220
|
-
await pullHostedMacosLogs(root, placement, host, {
|
|
220
|
+
return await pullHostedMacosLogs(root, placement, host, {
|
|
221
221
|
platform,
|
|
222
222
|
slot
|
|
223
223
|
}, final ? 1024 : MAX_PAGES, final, signal);
|
|
224
224
|
}
|
|
225
|
+
function readHostedNativeLogs(root, platform, slot) {
|
|
226
|
+
return readNdjsonGenerations$1(hostLogFile(root, {
|
|
227
|
+
platform,
|
|
228
|
+
slot
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
225
231
|
//#endregion
|
|
226
|
-
export {
|
|
232
|
+
export { agentAccess as a, closeAgentConnection as i, pullHostedNativeLogs as n, removeAgentAccess as o, readHostedNativeLogs as r, pullHostedMacosLogs as t };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { n as pullHostedNativeLogs, r as readHostedNativeLogs, t as pullHostedMacosLogs } from "./hosted-logs-BfbmDM4M.mjs";
|
|
2
|
+
import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
3
|
+
import { l as connectHost } from "./hosted-client-fHO8yqzc.mjs";
|
|
4
|
+
import { n as readHostedIos, t as readHostedAndroid } from "./ios-state-Cw7-WQf2.mjs";
|
|
5
|
+
import "./hosted-macos-CPl0OZ9h.mjs";
|
|
6
|
+
import { watch } from "node:fs";
|
|
7
|
+
import { dirname, relative, resolve, sep } from "node:path";
|
|
8
|
+
import { ambientWrite, configDir } from "@stim-cli/core";
|
|
9
|
+
import { readMacosRecord, workspaceStateFile } from "@stim-cli/core/state";
|
|
10
|
+
//#region src/device-host/hosted-logs-sync.ts
|
|
11
|
+
const WATCH_RECHECK_MS = 100;
|
|
12
|
+
function warn(context, machine, error) {
|
|
13
|
+
const text = `${warning(machine, error)}\n`;
|
|
14
|
+
if (context) context.output("stderr", text);
|
|
15
|
+
else ambientWrite("stderr", text);
|
|
16
|
+
}
|
|
17
|
+
function warning(machine, error) {
|
|
18
|
+
const message = error.message.replace(/\.$/, "");
|
|
19
|
+
const hint = message.includes("refused device-host.logs.query") ? ` If ${machine} runs an older stim-server, update it.` : "";
|
|
20
|
+
return phaseLine("device", `Could not read the app's logs from ${machine}: ${message}. Showing the logs already copied here.${hint}`);
|
|
21
|
+
}
|
|
22
|
+
async function syncHostedMacosLogs(root, placement, slot, warnings, platform = "ios", context) {
|
|
23
|
+
let host;
|
|
24
|
+
const cancel = () => host?.connection.close();
|
|
25
|
+
context?.signal.addEventListener("abort", cancel, { once: true });
|
|
26
|
+
try {
|
|
27
|
+
host = await connectHost(placement.machine, void 0, false, context?.signal);
|
|
28
|
+
if (slot !== void 0) await pullHostedNativeLogs(root, slot, placement, host, false, platform, context?.signal);
|
|
29
|
+
else await pullHostedMacosLogs(root, placement, host, void 0, void 0, false, context?.signal);
|
|
30
|
+
return true;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
context?.signal.throwIfAborted();
|
|
33
|
+
if (!warnings?.has(placement.machine)) {
|
|
34
|
+
warn(context, placement.machine, error);
|
|
35
|
+
warnings?.add(placement.machine);
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
} finally {
|
|
39
|
+
context?.signal.removeEventListener("abort", cancel);
|
|
40
|
+
host?.connection.close();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function followHostedMacosLogs(root, { failing = false, intervalMs = 500, retryMs = 5e3, slot, platform = "ios", context, onPulled, onFailed } = {}) {
|
|
44
|
+
let host;
|
|
45
|
+
const controller = new AbortController();
|
|
46
|
+
const signal = context ? AbortSignal.any([context.signal, controller.signal]) : controller.signal;
|
|
47
|
+
const cancel = () => host?.connection.close();
|
|
48
|
+
signal.addEventListener("abort", cancel, { once: true });
|
|
49
|
+
let retryAt = 0;
|
|
50
|
+
let stopped = false;
|
|
51
|
+
let running = false;
|
|
52
|
+
const tick = async () => {
|
|
53
|
+
if (running || stopped || signal.aborted || Date.now() < retryAt) return;
|
|
54
|
+
running = true;
|
|
55
|
+
try {
|
|
56
|
+
const placement = slot !== void 0 ? (platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))[slot] : readMacosRecord(root)?.host;
|
|
57
|
+
if (!placement) {
|
|
58
|
+
host?.connection.close();
|
|
59
|
+
host = void 0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
host ??= await connectHost(placement.machine, void 0, false, signal);
|
|
63
|
+
const through = slot !== void 0 ? await pullHostedNativeLogs(root, slot, placement, host, false, platform, signal) : await pullHostedMacosLogs(root, placement, host, void 0, void 0, false, signal);
|
|
64
|
+
failing = false;
|
|
65
|
+
onPulled?.(through);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
host?.connection.close();
|
|
68
|
+
host = void 0;
|
|
69
|
+
if (signal.aborted) return;
|
|
70
|
+
onFailed?.();
|
|
71
|
+
if (!failing) warn(context, (slot !== void 0 ? (platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))[slot] : readMacosRecord(root)?.host)?.machine ?? "the host", error);
|
|
72
|
+
failing = true;
|
|
73
|
+
retryAt = Date.now() + retryMs;
|
|
74
|
+
} finally {
|
|
75
|
+
running = false;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const timer = setInterval(() => void tick(), intervalMs);
|
|
79
|
+
return () => {
|
|
80
|
+
stopped = true;
|
|
81
|
+
controller.abort();
|
|
82
|
+
signal.removeEventListener("abort", cancel);
|
|
83
|
+
clearInterval(timer);
|
|
84
|
+
host?.connection.close();
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Copies a hosted slot's native logs while its launch is verified; a failed copy stops holding the launch windows. */
|
|
88
|
+
function followHostedLaunchLogs(root, slot, platform, since, context) {
|
|
89
|
+
let through = null;
|
|
90
|
+
let failed = false;
|
|
91
|
+
const stop = followHostedMacosLogs(root, {
|
|
92
|
+
slot,
|
|
93
|
+
platform,
|
|
94
|
+
context,
|
|
95
|
+
onPulled: (covered) => {
|
|
96
|
+
failed = false;
|
|
97
|
+
if (covered !== void 0) through = Math.max(through ?? covered, covered);
|
|
98
|
+
},
|
|
99
|
+
onFailed: () => {
|
|
100
|
+
failed = true;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const records = () => readHostedNativeLogs(root, platform, slot);
|
|
104
|
+
return {
|
|
105
|
+
readDeviceRecords: records,
|
|
106
|
+
readNativeCrashes: () => records().filter((record) => record.event === "native_crash" && Number(record.ts) >= since),
|
|
107
|
+
deviceLogsThrough: () => failed ? Number.POSITIVE_INFINITY : through,
|
|
108
|
+
stop
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async function syncHostedLogs(root, context) {
|
|
112
|
+
const macos = readMacosRecord(root)?.host;
|
|
113
|
+
const warnings = /* @__PURE__ */ new Set();
|
|
114
|
+
return (await Promise.all([
|
|
115
|
+
...macos ? [syncHostedMacosLogs(root, macos, void 0, warnings, "ios", context)] : [],
|
|
116
|
+
...Object.entries(readHostedIos(root)).map(([slot, placement]) => syncHostedMacosLogs(root, placement, slot, warnings, "ios", context)),
|
|
117
|
+
...Object.entries(readHostedAndroid(root)).map(([slot, placement]) => syncHostedMacosLogs(root, placement, slot, warnings, "android", context))
|
|
118
|
+
])).every(Boolean);
|
|
119
|
+
}
|
|
120
|
+
function followHostedLogs(root, failing, context) {
|
|
121
|
+
const stops = /* @__PURE__ */ new Map();
|
|
122
|
+
let closed = false;
|
|
123
|
+
const refresh = () => {
|
|
124
|
+
if (closed) return;
|
|
125
|
+
const active = /* @__PURE__ */ new Set();
|
|
126
|
+
if (readMacosRecord(root)?.host) {
|
|
127
|
+
active.add("macos");
|
|
128
|
+
if (!stops.has("macos")) stops.set("macos", followHostedMacosLogs(root, {
|
|
129
|
+
failing,
|
|
130
|
+
context
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
for (const platform of ["ios", "android"]) for (const slot of Object.keys(platform === "ios" ? readHostedIos(root) : readHostedAndroid(root))) {
|
|
134
|
+
const key = `${platform}:${slot}`;
|
|
135
|
+
active.add(key);
|
|
136
|
+
if (!stops.has(key)) stops.set(key, followHostedMacosLogs(root, {
|
|
137
|
+
failing,
|
|
138
|
+
slot,
|
|
139
|
+
platform,
|
|
140
|
+
context
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
for (const [key, stop] of stops) {
|
|
144
|
+
if (active.has(key)) continue;
|
|
145
|
+
stop();
|
|
146
|
+
stops.delete(key);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const stateFile = workspaceStateFile(root);
|
|
150
|
+
const home = resolve(configDir());
|
|
151
|
+
let watcher = null;
|
|
152
|
+
let recheck;
|
|
153
|
+
const observe = () => {
|
|
154
|
+
if (closed) return;
|
|
155
|
+
watcher?.close();
|
|
156
|
+
watcher = null;
|
|
157
|
+
clearTimeout(recheck);
|
|
158
|
+
let directory = dirname(stateFile);
|
|
159
|
+
for (;;) try {
|
|
160
|
+
const entry = relative(directory, stateFile).split(sep)[0];
|
|
161
|
+
const next = watch(directory, (_event, name) => {
|
|
162
|
+
if (name !== null && name.toString() !== entry) return;
|
|
163
|
+
if (directory !== dirname(stateFile)) observe();
|
|
164
|
+
refresh();
|
|
165
|
+
});
|
|
166
|
+
next.on("error", () => {
|
|
167
|
+
next.close();
|
|
168
|
+
if (watcher === next) watcher = null;
|
|
169
|
+
});
|
|
170
|
+
next.unref();
|
|
171
|
+
watcher = next;
|
|
172
|
+
recheck = setTimeout(refresh, WATCH_RECHECK_MS);
|
|
173
|
+
recheck.unref();
|
|
174
|
+
return;
|
|
175
|
+
} catch (error) {
|
|
176
|
+
if (directory === home || !(error instanceof Error && "code" in error && error.code === "ENOENT")) return;
|
|
177
|
+
directory = dirname(directory);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
observe();
|
|
181
|
+
refresh();
|
|
182
|
+
const timer = setInterval(() => {
|
|
183
|
+
observe();
|
|
184
|
+
refresh();
|
|
185
|
+
}, 1e4);
|
|
186
|
+
return () => {
|
|
187
|
+
closed = true;
|
|
188
|
+
watcher?.close();
|
|
189
|
+
clearTimeout(recheck);
|
|
190
|
+
clearInterval(timer);
|
|
191
|
+
for (const stop of stops.values()) stop();
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
export { followHostedLogs as n, syncHostedLogs as r, followHostedLaunchLogs as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as cancellableSleep } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
import { l as phaseLine } from "./command-output-
|
|
4
|
-
import { n as macosDir } from "./state-
|
|
5
|
-
import { d as runCancellationSignal } from "./native-run-
|
|
6
|
-
import { _ as unknownSession, a as SESSION_TIMEOUT_MS, c as call, d as hostedSession, g as stoppedSession, h as sha256, i as RESERVE_TIMEOUT_MS, l as connectHost, m as settle, o as attach, r as PREPARE_TIMEOUT_MS, s as bundleManifest, t as INSTALL_TIMEOUT_MS, u as heldNoLonger, v as upload } from "./hosted-client-
|
|
2
|
+
import { a as agentAccess, i as closeAgentConnection, o as removeAgentAccess, t as pullHostedMacosLogs } from "./hosted-logs-BfbmDM4M.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
4
|
+
import { n as macosDir } from "./state-C4OdpOTF.mjs";
|
|
5
|
+
import { d as runCancellationSignal } from "./native-run-BfIDFKLH.mjs";
|
|
6
|
+
import { _ as unknownSession, a as SESSION_TIMEOUT_MS, c as call, d as hostedSession, g as stoppedSession, h as sha256, i as RESERVE_TIMEOUT_MS, l as connectHost, m as settle, o as attach, r as PREPARE_TIMEOUT_MS, s as bundleManifest, t as INSTALL_TIMEOUT_MS, u as heldNoLonger, v as upload } from "./hosted-client-fHO8yqzc.mjs";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { ambientContext, ambientWrite } from "@stim-cli/core";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { o as cancellableSleep } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { d as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { s as writeHostedNative } from "./ios-state-CT9nV5SP.mjs";
|
|
2
|
+
import { E as workspaceDir, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { a as agentAccess, i as closeAgentConnection, n as pullHostedNativeLogs, o as removeAgentAccess } from "./hosted-logs-BfbmDM4M.mjs";
|
|
4
|
+
import { d as runCancellationSignal } from "./native-run-BfIDFKLH.mjs";
|
|
5
|
+
import { _ as unknownSession, a as SESSION_TIMEOUT_MS, c as call, d as hostedSession, g as stoppedSession, h as sha256, i as RESERVE_TIMEOUT_MS, l as connectHost, m as settle, n as OFFER_TIMEOUT_MS, o as attach, p as requireHostedAppMode, r as PREPARE_TIMEOUT_MS, s as bundleManifest, t as INSTALL_TIMEOUT_MS, u as heldNoLonger, v as upload } from "./hosted-client-fHO8yqzc.mjs";
|
|
6
|
+
import { a as requireHostedMetro, i as requestHostedMetro, n as closeHostedMetro } from "./metro-gateway-B6_PgD0L.mjs";
|
|
7
|
+
import { s as writeHostedNative } from "./ios-state-Cw7-WQf2.mjs";
|
|
9
8
|
import { randomUUID } from "node:crypto";
|
|
10
9
|
import { readFileSync } from "node:fs";
|
|
11
10
|
import { join } from "node:path";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { k as workspaceLogsDir$1, r as readWorkspaceState$1, s as updateWorkspaceStateAsync } from "./workspace-state-pUg3_RRA.mjs";
|
|
2
|
+
import { V as deviceSlotKey, _ as loadConfig$1 } from "./config-BktkY_zC.mjs";
|
|
3
|
+
import { o as formatLongDuration } from "./command-output-BF5AR2dL.mjs";
|
|
4
|
+
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
5
|
+
import { P as workspaceBuildInProgress, k as collectOwnedDeviceActivity } from "./budget-k2mZGvvk.mjs";
|
|
5
6
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
6
|
-
import { A as teardownOwnedIosSim, O as teardownOwnedAvd } from "./workspaces-
|
|
7
|
-
import { _ as workspaceDeviceLastUseAt } from "./activity-
|
|
8
|
-
import { d as listAllIosSims } from "./ios-
|
|
7
|
+
import { A as teardownOwnedIosSim, O as teardownOwnedAvd } from "./workspaces-g2lhdBXF.mjs";
|
|
8
|
+
import { _ as workspaceDeviceLastUseAt } from "./activity-Lnb_EoRY.mjs";
|
|
9
|
+
import { d as listAllIosSims } from "./ios-WxpDJ5T1.mjs";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { LOG_ROTATE_BYTES } from "@stim-cli/core";
|
|
9
12
|
import { DEVICE_IDLE_SHUTDOWN_KEY, DEVICE_RECLAIM_REASON, readDeviceIdleShutdowns } from "@stim-cli/core/state";
|
|
10
13
|
//#region src/devices/idle-shutdown.ts
|
|
11
14
|
const SIM_LIST_TIMEOUT_MS = 1e4;
|
|
@@ -58,6 +61,15 @@ function dueIdleDevices(root, idleMs, now = Date.now()) {
|
|
|
58
61
|
}];
|
|
59
62
|
});
|
|
60
63
|
}
|
|
64
|
+
/** Appends an idle shutdown record to the workspace's metro.ndjson, where the supervisor writes its own. */
|
|
65
|
+
function writeIdleShutdownEvent(root, event) {
|
|
66
|
+
const writer = createNdjsonWriter(join(workspaceLogsDir$1(root), "metro.ndjson"), { maxBytes: LOG_ROTATE_BYTES });
|
|
67
|
+
writer.write({
|
|
68
|
+
src: "metro",
|
|
69
|
+
...event
|
|
70
|
+
});
|
|
71
|
+
writer.close();
|
|
72
|
+
}
|
|
61
73
|
/**
|
|
62
74
|
* Shuts down, through centralized teardown, each of the workspace's owned devices that is still idle for `idleMs`,
|
|
63
75
|
* and records why. The caller holds the workspace's native-run lock, so no `ios` or `android` run is booting or
|
|
@@ -108,7 +120,8 @@ async function shutDownIdleDevices(root, idleMs, log, now = Date.now(), { only,
|
|
|
108
120
|
} else if (outcome.status !== "missing") log({
|
|
109
121
|
level: "warn",
|
|
110
122
|
event: "device_idle_shutdown_failed",
|
|
111
|
-
msg: `could not shut down idle ${what}: ${outcome.reason}
|
|
123
|
+
msg: `could not shut down idle ${what}: ${outcome.reason}`,
|
|
124
|
+
...outcome.status === "skipped" ? { skipped: true } : {}
|
|
112
125
|
});
|
|
113
126
|
}
|
|
114
127
|
return shutDown;
|
|
@@ -127,4 +140,4 @@ async function clearDeviceIdleShutdown(root, platform, slot = "default") {
|
|
|
127
140
|
});
|
|
128
141
|
}
|
|
129
142
|
//#endregion
|
|
130
|
-
export { dueIdleDevices as n, shutDownIdleDevices as r, clearDeviceIdleShutdown as t };
|
|
143
|
+
export { writeIdleShutdownEvent as i, dueIdleDevices as n, shutDownIdleDevices as r, clearDeviceIdleShutdown as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
2
|
-
import {
|
|
3
|
-
import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-
|
|
4
|
-
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
5
|
-
import { t as devClientScheme } from "./dev-client-
|
|
6
|
-
import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BF5AR2dL.mjs";
|
|
2
|
+
import { In as pickDevClientScheme, Rn as schemesFromInfoPlist } from "./budget-k2mZGvvk.mjs";
|
|
3
|
+
import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-CVOCp0Ft.mjs";
|
|
4
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-Dq3RBcON.mjs";
|
|
5
|
+
import { t as devClientScheme } from "./dev-client-DXR_tPVY.mjs";
|
|
6
|
+
import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-Ty5pHl9O.mjs";
|
|
7
|
+
import { d as replaceCollector, u as collectorEntry } from "./dependencies-Dw6wfQdv.mjs";
|
|
8
|
+
import { n as registerIos, r as runIosOperation, t as iosCommand } from "./ios-ftxdQbJS.mjs";
|
|
9
9
|
export { appNameFromPath, buildLogFile, cacheDescription, collectorEntry, iosCommand as default, devClientScheme, deviceLabel, ensureWorkspaceStorageSafely, formatDuration, iosConfigurationSetting, iosFacts, isReleaseConfiguration, lastBuildRecord, phaseLine, pickDevClientScheme, podAction, registerIos, replaceCollector, resolveConfiguration, resolveDeviceType, resolveRuntime, runIosOperation, schemesFromInfoPlist, shortHash, shortUdid, writeLastBuild };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { l as WorkspaceProcessCleanupError, n as isTimeoutError, o as cancellableSleep, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import { P as formatBytes, _ as loadConfig$1 } from "./config-
|
|
2
|
+
import { P as formatBytes, _ as loadConfig$1 } from "./config-BktkY_zC.mjs";
|
|
3
3
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
4
|
import { n as runOperationFileQuiet, t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
|
|
5
|
-
import { i as stimDesktopInstalledAsync, n as settingDefault, t as STIM_DESKTOP_OPEN_OPTIONS } from "./stim-desktop-
|
|
6
|
-
import { dt as isStimOwnedSim } from "./android-
|
|
7
|
-
import {
|
|
5
|
+
import { i as stimDesktopInstalledAsync, n as settingDefault, t as STIM_DESKTOP_OPEN_OPTIONS } from "./stim-desktop-6Dqp-gjX.mjs";
|
|
6
|
+
import { Ct as forgetCreatedDeviceAsync, Et as recordCreatedDeviceAsync, dt as isStimOwnedSim } from "./android-DTAcRwBC.mjs";
|
|
7
|
+
import { n as signedTailFor } from "./apk-signed-tail-B46U9hXc.mjs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { closeSync, existsSync, lstatSync, mkdtempSync, openSync, readSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { tmpdir, totalmem } from "node:os";
|
|
@@ -14,6 +14,9 @@ import { IOS_SIMULATOR_APPS, isJsonObject, settingDefinition } from "@stim-cli/c
|
|
|
14
14
|
const READ_CHUNK_BYTES = 1048576;
|
|
15
15
|
const DEVICE_PATH_TIMEOUT_MS = 3e4;
|
|
16
16
|
const DEVICE_HASH_TIMEOUT_MS = 12e4;
|
|
17
|
+
const APKSIGNER_TIMEOUT_MS = 12e4;
|
|
18
|
+
const PACKAGE_NAME = /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)+$/;
|
|
19
|
+
const EMPTY_INPUT_SHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
|
17
20
|
const SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
18
21
|
function parseInstalledApkPath(text) {
|
|
19
22
|
if (typeof text !== "string") return null;
|
|
@@ -31,6 +34,30 @@ function parseDeviceSha256(text) {
|
|
|
31
34
|
const first = text.trim().split(/\s+/)[0] ?? "";
|
|
32
35
|
return SHA256_HEX.test(first) ? first : null;
|
|
33
36
|
}
|
|
37
|
+
function deviceTailProbeScript(packageName, tailBytes) {
|
|
38
|
+
return `for p in $(pm path ${packageName} | sed -n "s/^package://p"); do echo "path $p"; stat -c "size %s" "$p"; tail -c ${tailBytes} "$p" | sha256sum; done`;
|
|
39
|
+
}
|
|
40
|
+
const TAIL_PROBE = /^path \/.*\nsize (\d+)\n(\S+) {2}-$/gm;
|
|
41
|
+
function parseDeviceTailProbe(text) {
|
|
42
|
+
if (typeof text !== "string") return null;
|
|
43
|
+
const lines = text.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
44
|
+
if (lines.length === 0) return { installs: 0 };
|
|
45
|
+
const probes = [];
|
|
46
|
+
for (const [, size, digest] of lines.join("\n").matchAll(TAIL_PROBE)) {
|
|
47
|
+
const tailSha256 = parseDeviceSha256(digest);
|
|
48
|
+
if (!size || !tailSha256 || tailSha256 === EMPTY_INPUT_SHA256) return null;
|
|
49
|
+
probes.push({
|
|
50
|
+
size: Number(size),
|
|
51
|
+
tailSha256
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (probes.length * 3 !== lines.length) return null;
|
|
55
|
+
const [only, ...others] = probes;
|
|
56
|
+
return only && others.length === 0 ? {
|
|
57
|
+
installs: 1,
|
|
58
|
+
...only
|
|
59
|
+
} : { installs: "split" };
|
|
60
|
+
}
|
|
34
61
|
function parseAppContainerPath(text) {
|
|
35
62
|
if (typeof text !== "string") return null;
|
|
36
63
|
const lines = text.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
@@ -90,8 +117,32 @@ function hashBundle(dir) {
|
|
|
90
117
|
};
|
|
91
118
|
return walk(dir, "") ? digest.digest("hex") : null;
|
|
92
119
|
}
|
|
120
|
+
async function deviceHoldsSignedTail({ serial, packageName }, tail, e) {
|
|
121
|
+
let probe;
|
|
122
|
+
try {
|
|
123
|
+
probe = parseDeviceTailProbe(await e.runFileAsync("adb", [
|
|
124
|
+
"-s",
|
|
125
|
+
serial,
|
|
126
|
+
"shell",
|
|
127
|
+
deviceTailProbeScript(packageName, tail.size - tail.tailOffset)
|
|
128
|
+
], { timeoutMs: DEVICE_PATH_TIMEOUT_MS }));
|
|
129
|
+
} catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (!probe) return null;
|
|
133
|
+
if (probe.installs !== 1) return false;
|
|
134
|
+
return probe.size === tail.size && probe.tailSha256 === tail.tailSha256;
|
|
135
|
+
}
|
|
93
136
|
async function deviceHoldsApk({ serial, packageName, apkPath }, { exec = null } = {}) {
|
|
94
137
|
const e = exec || getExecutor();
|
|
138
|
+
const tail = PACKAGE_NAME.test(packageName) ? await signedTailFor(apkPath, (file, args) => e.runFileAsync(file, args, { timeoutMs: APKSIGNER_TIMEOUT_MS })) : null;
|
|
139
|
+
if (tail) {
|
|
140
|
+
const held = await deviceHoldsSignedTail({
|
|
141
|
+
serial,
|
|
142
|
+
packageName
|
|
143
|
+
}, tail, e);
|
|
144
|
+
if (held !== null) return held;
|
|
145
|
+
}
|
|
95
146
|
let path;
|
|
96
147
|
try {
|
|
97
148
|
path = parseInstalledApkPath(await e.runFileAsync("adb", [
|
|
@@ -554,6 +605,22 @@ const BOOTSTATUS_ATTEMPT_FLOOR_MS = 1e3;
|
|
|
554
605
|
const BOOT_STATE_LIST_TIMEOUT_MS = 3e4;
|
|
555
606
|
const SPRINGBOARD_QUERY_TIMEOUT_MS = 1e4;
|
|
556
607
|
const SPRINGBOARD_POLL_MS = 250;
|
|
608
|
+
async function readSpringBoardPid(udid) {
|
|
609
|
+
try {
|
|
610
|
+
const output = await getExecutor().runFileAsync("xcrun", [
|
|
611
|
+
"simctl",
|
|
612
|
+
"spawn",
|
|
613
|
+
udid,
|
|
614
|
+
"notifyutil",
|
|
615
|
+
"-g",
|
|
616
|
+
"com.apple.springboard.finishedstartup"
|
|
617
|
+
], { timeoutMs: SPRINGBOARD_QUERY_TIMEOUT_MS });
|
|
618
|
+
const pid = Number(/^com\.apple\.springboard\.finishedstartup (\d+)$/m.exec(output)?.[1] ?? 0);
|
|
619
|
+
return pid > 0 ? pid : null;
|
|
620
|
+
} catch {
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
557
624
|
async function waitForSpringBoard(udid, deadline) {
|
|
558
625
|
for (;;) {
|
|
559
626
|
let output = null;
|
|
@@ -1101,4 +1168,4 @@ function parseIosRuntimes(out) {
|
|
|
1101
1168
|
}] : []);
|
|
1102
1169
|
}
|
|
1103
1170
|
//#endregion
|
|
1104
|
-
export {
|
|
1171
|
+
export { uninstallIosApp as A, memoryCulpritAdvice as B, renameIosSim as C, resolveOwnedIosSim as D, resolveIosCreation as E, memoryCulpritsUnder as F, readMemoryCulpritsAsync as H, memoryCulpritsUnderAsync as I, readHostMemoryPressure as L, configuredIosSimulatorViewer as M, parseIosSimulatorApp as N, sanitizeDeviceLabel as O, hostMemoryPressureAdvice as P, readHostMemoryPressureAsync as R, readSpringBoardPid as S, resetIosPrivacy as T, deviceHoldsApk as U, memoryCulpritFindings as V, deviceHoldsBundle as W, ownedSimName as _, createOwnedIosSim as a, parseSimctlList as b, eraseIosSim as c, listAllIosSims as d, listAllIosSimsAsync as f, listUserApps as g, listIosRuntimesAsync as h, createIosSimSnapshot as i, waitForSpringBoard as j, shutdownIosSim as k, iosRuntimeMatches as l, listIosRuntimes as m, bootIosSim as n, deleteIosSim as o, listIosDeviceTypesAsync as p, clearIosAppData as r, deleteParkedIosSim as s, IOS_BOOT_TIMEOUT_MS as t, iosSimulatorFailureAdvice as u, parkedSimName as v, resetIosKeychain as w, pickDefaultIosCreation as x, parseRuntimeVersion as y, reportMemoryCulprits as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { bn as appProcessFromPid, gn as INSTALL_ERROR } from "./budget-k2mZGvvk.mjs";
|
|
3
3
|
import { n as TOOL_ERROR_PREFIX } from "./ios-device-B6HK951C.mjs";
|
|
4
4
|
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|