stim 1.23.1 → 1.25.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 +3 -2
- package/dist/{acquire-artifact-BzYRDgaP.mjs → acquire-artifact-zA4S7RHE.mjs} +2 -2
- package/dist/{act-vxiMwdf5.mjs → act-BbHS3oV8.mjs} +41 -26
- package/dist/{activity-BpWUPgUm.mjs → activity-BpjwrQXU.mjs} +6 -6
- package/dist/{agent-device-usage-output-CUlLsbRt.mjs → agent-device-usage-output-Bnkerfod.mjs} +5 -5
- package/dist/{android-DtfRGLcc.mjs → android-BGwuK3Mc.mjs} +75 -50
- package/dist/{android-CLi6DSiS.mjs → android-CNZgRC-4.mjs} +5 -5
- package/dist/{android-C7sVmyI9.mjs → android-Cjcj8MCw.mjs} +140 -46
- package/dist/{android-cas-ngferVq2.mjs → android-cas-BVqh2Zep.mjs} +3 -3
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/{android-project-DVWyCbWU.d.mts → android-project-CTYaETc0.d.mts} +6 -2
- package/dist/{android-DR5lZ2Az.mjs → android-saBeB4lr.mjs} +13 -3
- package/dist/api.d.mts +22 -5
- package/dist/api.mjs +32 -31
- package/dist/{artifact-Xvgibgzq.mjs → artifact-Co8zixVx.mjs} +19 -17
- package/dist/{artifact-DBI3DALs.mjs → artifact-DN8JNwqS.mjs} +18 -17
- package/dist/{artifact-platform-CXcmX_j3.mjs → artifact-platform-CMRc0M_r.mjs} +3 -3
- package/dist/{browser-web-BJN9ZHxB.mjs → browser-web-CCgZsHmI.mjs} +16 -17
- package/dist/{budget-3ivAK99e.mjs → budget-HyShrIpL.mjs} +149 -47
- package/dist/{build-Dv9s8Fz-.mjs → build-CAiw8Ezm.mjs} +33 -29
- package/dist/{build-cache-Dv7RN200.mjs → build-cache-CKCzxzxA.mjs} +172 -21
- package/dist/{build-plan-BmbdHQbr.mjs → build-plan-zCuHGlA8.mjs} +8 -7
- package/dist/{cache-manifest-DSeQjt-Q.mjs → cache-manifest-BPXRONJz.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-CH2EWGPB.mjs → ccache-h1FKhZeg.mjs} +6 -6
- package/dist/{cdp-3fwICjzi.mjs → cdp-BG3FJCCx.mjs} +1 -1
- package/dist/{chrome-Bbw689-6.mjs → chrome-BvV8ssI3.mjs} +1 -1
- package/dist/{cli-BkK6Wr5i.mjs → cli-C4w607Pz.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-B4MMzfo_.mjs → client-BQsmyp_-.mjs} +274 -39
- package/dist/collector-run.mjs +6 -6
- package/dist/{command-output-YKGWivpG.mjs → command-output-BBvS1H6v.mjs} +3 -2
- package/dist/{config-DlrsduwG.mjs → config-BZhXY15H.mjs} +3 -3
- package/dist/{created-devices-x9rN6bhs.mjs → created-devices-D2Aca-xu.mjs} +6 -2
- package/dist/{dependency-state-1I9KZT1Y.mjs → dependency-state-BwNCYG5Q.mjs} +2 -2
- package/dist/{detached-entry-BwNEtIrP.mjs → detached-entry-KmieOKgN.mjs} +1 -1
- package/dist/{dev-client-BFxiDpkf.mjs → dev-client-CHoXXZeg.mjs} +3 -3
- package/dist/{device-CiNYxqp6.mjs → device-B9FqTBYW.mjs} +81 -54
- package/dist/{device-B7ljwccX.mjs → device-F5-4z9ef.mjs} +16 -16
- package/dist/{device-capacity-DH0QsZYZ.mjs → device-capacity-ZYaRALv5.mjs} +20 -16
- package/dist/device-host-worker.mjs +17 -17
- package/dist/{device-ios-CbVDtDIy.mjs → device-ios-DkHBrmvH.mjs} +32 -50
- package/dist/{device-lease-run-DXPSwdbb.mjs → device-lease-run-ogEeJ62K.mjs} +6 -6
- package/dist/{device-pool-B4iOXIrD.mjs → device-pool-BIg8MU8l.mjs} +3 -3
- package/dist/{doctor-DRu-8ld6.mjs → doctor-A_Nr_fDe.mjs} +1 -1
- package/dist/{doctor-HUC1igzw.mjs → doctor-Bm8TVpGn.mjs} +37 -31
- package/dist/{doctor-fingerprint-DZLoYFVb.mjs → doctor-fingerprint-zlujA1Gs.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-C6t4Maue.mjs → doctor-k3P3PizH.mjs} +14 -14
- package/dist/{doctor-watchman-iGBpC6KM.mjs → doctor-watchman-BovI1y3-.mjs} +5 -5
- package/dist/{eas-build-DMWSSvxq.mjs → eas-build-CyDKNTBP.mjs} +4 -4
- package/dist/{eas-fallback-vKlrqxgE.mjs → eas-fallback-gaZi-dJL.mjs} +16 -15
- package/dist/{eas-session-ledger-BQF9Yyy9.mjs → eas-session-ledger-BMCA1gdO.mjs} +12 -8
- package/dist/{error-diagnostics-DYsjJIHz.mjs → error-diagnostics-B1Mj_-7h.mjs} +17 -42
- package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
- package/dist/{exec-DEoAhcze.mjs → exec-VFRpu1iA.mjs} +116 -28
- package/dist/{gc-BW8E1uSC.mjs → gc-B9jcnmIk.mjs} +205 -28
- package/dist/{gc-dDE4QPVu.mjs → gc-eaz403W6.mjs} +2 -2
- package/dist/{guide-DYYEO3Wz.mjs → guide-DR0K0xW9.mjs} +328 -89
- package/dist/{hosted-android-xcfgCgSF.mjs → hosted-android-Bvb2-ZxD.mjs} +4 -4
- package/dist/{hosted-client-Bt-tndxV.mjs → hosted-client-rsRqysJc.mjs} +4 -4
- package/dist/{hosted-ios-y19jCYFF.mjs → hosted-ios-RtVcJH3u.mjs} +1 -1
- package/dist/{hosted-logs-DzJKzKlj.mjs → hosted-logs-CWKGYWNX.mjs} +11 -6
- package/dist/{hosted-macos-BJusKvqL.mjs → hosted-macos-d0pv9Tth.mjs} +7 -7
- package/dist/{hosted-native-BmQC6U_x.mjs → hosted-native-BxTizGU2.mjs} +58 -11
- package/dist/{idle-shutdown-CJmUOV5x.mjs → idle-shutdown-BIyfl0Zj.mjs} +10 -10
- package/dist/{ios-hcBpnEGk.mjs → ios-BQzvJlzw.mjs} +122 -17
- package/dist/{ios-CWjqfSm_.mjs → ios-BRVM8b0P.mjs} +81 -49
- package/dist/{ios-DTOYZGMJ.mjs → ios-Dvt97HgQ.mjs} +8 -8
- package/dist/{ios-xtlRHaeB.mjs → ios-ENC4sRPA.mjs} +1 -1
- package/dist/{ios-device-BXZ0c7Kb.mjs → ios-device-B6HK951C.mjs} +1 -1
- package/dist/{ios-device-DFGuwF4U.mjs → ios-device-CKSvk0bu.mjs} +3 -3
- package/dist/{ios-project-CSZYI1iu.mjs → ios-project-DCUDo06I.mjs} +5 -5
- package/dist/{ios-signing-BtAffm0A.mjs → ios-signing-4c_qXvQm.mjs} +2 -2
- package/dist/{ios-state-Dtw5K2aI.mjs → ios-state-CT9nV5SP.mjs} +15 -7
- package/dist/{js-swap-BSBHldmm.mjs → js-swap-Z9HbC4cj.mjs} +7 -6
- package/dist/{launch-D-zq8SHG.mjs → launch-D0lPvFFu.mjs} +49 -30
- package/dist/{launch-CP2wDCVd.mjs → launch-DscF1QfM.mjs} +52 -50
- package/dist/{logs-pNvA2hHK.mjs → logs-BsIRre8x.mjs} +16 -9
- package/dist/{logs-By5aw3g9.mjs → logs-Crs9y34Z.mjs} +8 -6
- package/dist/{macos-CPMahOC2.mjs → macos-CcUlJPMu.mjs} +1 -1
- package/dist/{macos-C67FZ2ft.mjs → macos-D477nfzH.mjs} +49 -42
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +7 -7
- package/dist/{metro-DiXtA3Ty.mjs → metro-1pJgCX4U.mjs} +4 -4
- package/dist/{metro-gateway-CKZqKqx7.mjs → metro-gateway-Bp9gJQAN.mjs} +3 -4
- package/dist/{named-ports-DkEzOfzO.mjs → named-ports-BVbn8SvC.mjs} +3 -3
- package/dist/{native-android-_MWSs3PP.mjs → native-android-BvMizJn1.mjs} +17 -17
- package/dist/{native-gradle-artifact-inputs-DHFnmrVf.mjs → native-gradle-artifact-inputs-BJscK4vN.mjs} +5 -5
- package/dist/{native-run-Dv88i0aU.mjs → native-run-D5OJsGwA.mjs} +6 -6
- package/dist/{native-runtime-DBRfY_PN.mjs → native-runtime-B9w_Qyz3.mjs} +10 -9
- package/dist/{native-source-Y0yLhFyQ.mjs → native-source-D-4Dh4JU.mjs} +7 -4
- package/dist/{native-xcode-inputs-CqViUh3r.mjs → native-xcode-inputs-Cv4l-obn.mjs} +2 -2
- package/dist/{native-xcode-ios-vFgqL_yS.mjs → native-xcode-ios-DGrg90hE.mjs} +21 -20
- package/dist/offload-worker.d.mts +12 -4
- package/dist/offload-worker.mjs +78 -43
- package/dist/{operation-exec-BW0em61G.mjs → operation-exec-CUZifp6Z.mjs} +2 -25
- package/dist/{ownership-C5fo5Edb.mjs → ownership-jxxz-19m.mjs} +3 -3
- package/dist/{page-DBL2PiUU.mjs → page-CzEA_-5_.mjs} +2 -3
- package/dist/phone-reverses-CYb7RRAx.mjs +57 -0
- package/dist/{placement-log-BnGgJRRZ.mjs → placement-log-DjOXJRIH.mjs} +1 -1
- package/dist/{plan-placement-cr0fEU7b.mjs → plan-placement-BqKgKHCi.mjs} +3 -3
- package/dist/{ports-DpXjKkSV.mjs → ports-DtS1Amb0.mjs} +3 -3
- package/dist/{prebuild-BligW0QS.mjs → prebuild-JUaqOLpc.mjs} +14 -9
- package/dist/{project-DhCtQWWU.mjs → project-BiC68mIp.mjs} +21 -17
- package/dist/{pull-request-W1IuLXDt.mjs → pull-request-CbNlkFok.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-ZlhQfhvq.mjs → react-native-android-DRYqoJc4.mjs} +76 -32
- package/dist/{react-native-build-CelbTO_y.mjs → react-native-build-CwZB-agu.mjs} +23 -20
- package/dist/{react-native-doctor-LTIaP7lv.mjs → react-native-doctor-BCrytK7h.mjs} +10 -9
- package/dist/{react-native-ios-C5W0SA6f.mjs → react-native-ios-Cr1buNFo.mjs} +41 -24
- package/dist/{recordings-CQmfzAh7.mjs → recordings-BaoQ0t-J.mjs} +1 -1
- package/dist/{registration-BcRgF6Ox.mjs → registration-CN6nlhcD.mjs} +1 -1
- package/dist/{reload-QcwnYLYV.mjs → reload-Beftw2X3.mjs} +1 -1
- package/dist/{reload-COJWTbae.mjs → reload-FbSgMF8x.mjs} +144 -42
- package/dist/{remote-DR8qUERM.mjs → remote-BuZj6AyU.mjs} +16 -7
- package/dist/{result-utnBea7x.mjs → result-CR2vk2cj.mjs} +41 -18
- package/dist/{run-DidHghD1.mjs → run-BtzE09Dl.mjs} +2 -2
- package/dist/{selection-DSMbWEX2.mjs → selection-D5cxEl3t.mjs} +13 -7
- package/dist/{server-bare-CafzuyFB.mjs → server-bare-CH9X0RLn.mjs} +56 -4
- package/dist/{server-command-B9o92sLM.mjs → server-command-CaBbDNU2.mjs} +5 -5
- package/dist/server-expo-C16Zf2k7.mjs +2 -0
- package/dist/{server-expo-BXrWxNYh.mjs → server-expo-Ck8EIidM.mjs} +14 -9
- package/dist/{settings-C7O8A6ZI.mjs → settings-B5tCoq9N.mjs} +132 -39
- package/dist/{settings-PfJx8uK1.mjs → settings-DzH9mGQZ.mjs} +1 -1
- package/dist/{settings-write-Chuy7Cte.mjs → settings-write-n0zwfohx.mjs} +7 -7
- package/dist/settings.schema.json +51 -0
- package/dist/{simslim-BNckWpXi.mjs → simslim-BjxszUAb.mjs} +22 -7
- package/dist/{slot-launch-B7AuoWJv.mjs → slot-launch-QeuJMlnJ.mjs} +6 -6
- package/dist/{stage-C4u17aES.mjs → stage-D8xlRU2D.mjs} +2 -3
- package/dist/{start-BL_BsiWt.mjs → start-C1JLjkNw.mjs} +1 -1
- package/dist/{start-CU8mCPC7.mjs → start-YMpNwLhh.mjs} +75 -35
- package/dist/{state--smjFSTL.mjs → state-DMRNP7-4.mjs} +4 -4
- package/dist/{state-08I3hw3_.mjs → state-DPaM3u5K.mjs} +2 -2
- package/dist/{stats-CO6sK0Nh.mjs → stats-CP7STzZw.mjs} +5 -5
- package/dist/{stats-report-BzaPrRm6.mjs → stats-report-n2U5plhk.mjs} +1 -1
- package/dist/{status-_WPHzVft.mjs → status-CRLiJ-O_.mjs} +24 -24
- package/dist/{status-BRROykC8.mjs → status-Fect2w9R.mjs} +1 -1
- package/dist/{status-CrJutl6-.mjs → status-cNw6i0_t.mjs} +1 -1
- package/dist/{status-watch-BHFasOZN.mjs → status-watch-Bc2J4TZn.mjs} +5 -5
- package/dist/status-worker.mjs +1 -1
- package/dist/stim-clonefile.c +18 -0
- package/dist/{stim-desktop-D5OGpYZM.mjs → stim-desktop-DS0mzR8U.mjs} +2 -2
- package/dist/{stop-iuFHjUST.mjs → stop-Br7LKxBE.mjs} +2 -2
- package/dist/{stop-CR5689oB.mjs → stop-COP6PQqw.mjs} +5 -5
- package/dist/{stop-BJ06ipTZ.mjs → stop-Db9Kh-UA.mjs} +109 -56
- package/dist/supervisor-run.mjs +17 -17
- package/dist/{support-CbXPbUMJ.mjs → support-Cxj9CmII.mjs} +6 -6
- package/dist/{support-TWuQlHQo.mjs → support-qKcbgmI5.mjs} +14 -11
- package/dist/{swiftpm-artifact-inputs-DFcGsXDP.mjs → swiftpm-artifact-inputs-iY9fsmOc.mjs} +4 -4
- package/dist/{swiftpm-macos-DbwGCpZg.mjs → swiftpm-macos-Bp_sn9P4.mjs} +15 -14
- package/dist/{toolchain-XkA2PfJZ.mjs → toolchain-DB1aeqxO.mjs} +1 -1
- package/dist/{toolchain-B9hCFCQw.mjs → toolchain-VzLJzZ7O.mjs} +69 -37
- package/dist/trigger-BLsHgAGR.mjs +2 -0
- package/dist/{trigger-Cbyc41d_.mjs → trigger-CBMe2YLH.mjs} +2 -2
- package/dist/{warm-progress-CA3TgT3-.mjs → warm-progress-BV3ZPmcY.mjs} +6 -6
- package/dist/{web-DRF_oFXk.mjs → web-B4Yjyt1G.mjs} +12 -10
- package/dist/web-DS4UDWvf.mjs +2 -0
- package/dist/web-run.mjs +8 -9
- package/dist/windows-report.mjs +12 -1
- package/dist/windows-report.ps1 +1 -1
- package/dist/{workspace-state-U08dEzhG.mjs → workspace-state-CPSp3mav.mjs} +11 -4
- package/dist/{workspaces-e41xsjKr.mjs → workspaces-C9w4aeXF.mjs} +36 -32
- package/dist/{worktree-B4Nj3EGS.mjs → worktree-CclFIe1Z.mjs} +324 -99
- package/dist/{worktree-BEwxVwKF.mjs → worktree-Ct9Gk3KL.mjs} +1 -1
- package/dist/{xcode-Rq744mBF.mjs → xcode-CiIIDnuD.mjs} +42 -28
- package/package.json +7 -7
- package/shim/bundle-response.cjs +53 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +23 -1
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +0 -211
- package/dist/server-expo-Ddr8cG_c.mjs +0 -2
- package/dist/trigger-yb_nFzPF.mjs +0 -2
- package/dist/web-kDE9Myoy.mjs +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as call, l as connectHost } from "./hosted-client-
|
|
3
|
-
import { i as requestHostedMetro } from "./metro-gateway-
|
|
4
|
-
import {
|
|
1
|
+
import { c as throwIfCancelled } from "./exec-VFRpu1iA.mjs";
|
|
2
|
+
import { c as call, l as connectHost } from "./hosted-client-rsRqysJc.mjs";
|
|
3
|
+
import { i as requestHostedMetro } from "./metro-gateway-Bp9gJQAN.mjs";
|
|
4
|
+
import { a as stopHostedNative, i as prepareHostedNative, r as placeHostedNative } from "./hosted-native-BxTizGU2.mjs";
|
|
5
5
|
//#region src/device-host/hosted-android.ts
|
|
6
6
|
async function prepareHostedAndroid(machine, selectors, recorded, mode) {
|
|
7
7
|
return await prepareHostedNative(machine, selectors, recorded, "android", false, mode);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as BuildConnection } from "./client-
|
|
4
|
-
import {
|
|
1
|
+
import { c as throwIfCancelled, o as cancellableSleep } from "./exec-VFRpu1iA.mjs";
|
|
2
|
+
import { rt as resolveEndpoint } from "./config-BZhXY15H.mjs";
|
|
3
|
+
import { t as BuildConnection } from "./client-BQsmyp_-.mjs";
|
|
4
|
+
import { d as configuredMachines } from "./selection-D5cxEl3t.mjs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { lstatSync, readFileSync, readdirSync, readlinkSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as stopHostedNative, i as prepareHostedNative, r as placeHostedNative } from "./hosted-native-BxTizGU2.mjs";
|
|
2
2
|
//#region src/device-host/hosted-ios.ts
|
|
3
3
|
async function prepareHostedIos(machine, selectors, recorded, mode) {
|
|
4
4
|
return await prepareHostedNative(machine, selectors, recorded, "ios", false, mode);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
1
|
+
import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
|
|
3
|
-
import { B as deviceSlotFileKey, et as parseMachine$1, q as validateDeviceSlot } from "./config-
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import { n as macosDir } from "./state-
|
|
3
|
+
import { B as deviceSlotFileKey, et as parseMachine$1, q as validateDeviceSlot } from "./config-BZhXY15H.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-BBvS1H6v.mjs";
|
|
5
|
+
import { n as macosDir } from "./state-DPaM3u5K.mjs";
|
|
6
|
+
import { n as androidLogGroups, r as isAndroidCrashText } from "./android-saBeB4lr.mjs";
|
|
6
7
|
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
7
|
-
import { c as call } from "./hosted-client-
|
|
8
|
+
import { c as call } from "./hosted-client-rsRqysJc.mjs";
|
|
8
9
|
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
9
10
|
import { dirname, join } from "node:path";
|
|
10
11
|
import { LOG_ROTATE_BYTES, ambientWrite, withDirLockAsync } from "@stim-cli/core";
|
|
@@ -150,6 +151,9 @@ function readCursor(root, session, target) {
|
|
|
150
151
|
} catch {}
|
|
151
152
|
}
|
|
152
153
|
const sameCursor = (a, b) => JSON.stringify(Object.entries(a ?? {}).toSorted()) === JSON.stringify(Object.entries(b ?? {}).toSorted());
|
|
154
|
+
function androidCrashRecords(records) {
|
|
155
|
+
return new Set(androidLogGroups(records).filter((group) => isAndroidCrashText(group.map((record) => record.msg ?? "").join("\n"))).flat());
|
|
156
|
+
}
|
|
153
157
|
async function commitPage(root, session, before, records, cursor, target) {
|
|
154
158
|
if (!records.length && sameCursor(before, cursor)) return;
|
|
155
159
|
const directory = logsStateDir(root, target);
|
|
@@ -158,12 +162,13 @@ async function commitPage(root, session, before, records, cursor, target) {
|
|
|
158
162
|
if (records.length) {
|
|
159
163
|
const writer = createNdjsonWriter(hostLogFile(root, target), { maxBytes: LOG_ROTATE_BYTES });
|
|
160
164
|
try {
|
|
165
|
+
const crashes = target.platform === "android" ? androidCrashRecords(records) : /* @__PURE__ */ new Set();
|
|
161
166
|
for (const record of records) writer.write(target.platform !== "macos" ? {
|
|
162
167
|
...record,
|
|
163
168
|
src: "device",
|
|
164
169
|
platform: target.platform,
|
|
165
170
|
slot: target.slot,
|
|
166
|
-
event: "hosted_native_log"
|
|
171
|
+
event: crashes.has(record) ? "native_crash" : "hosted_native_log"
|
|
167
172
|
} : record);
|
|
168
173
|
} finally {
|
|
169
174
|
writer.close();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-
|
|
1
|
+
import { o as cancellableSleep } from "./exec-VFRpu1iA.mjs";
|
|
2
|
+
import { a as removeAgentAccess, i as agentAccess, r as closeAgentConnection, t as pullHostedMacosLogs } from "./hosted-logs-CWKGYWNX.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-BBvS1H6v.mjs";
|
|
4
|
+
import { n as macosDir } from "./state-DPaM3u5K.mjs";
|
|
5
|
+
import { d as runCancellationSignal } from "./native-run-D5OJsGwA.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-rsRqysJc.mjs";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { ambientContext, ambientWrite } from "@stim-cli/core";
|
|
@@ -51,7 +51,7 @@ async function placeHostedMacos(host, { root, bundle, bundleId, handoff, argumen
|
|
|
51
51
|
setting: "hosting.agentDriver"
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
reserved(placement);
|
|
54
|
+
await reserved(placement);
|
|
55
55
|
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS, "macos", runCancellationSignal(ambientContext()));
|
|
56
56
|
if (session.state === "unknown") throw unknownSession(host, session);
|
|
57
57
|
if (session.state === "stopped") throw stoppedSession(host, session);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { o as cancellableSleep } from "./exec-VFRpu1iA.mjs";
|
|
1
2
|
import { d as workspaceDir } from "./paths-DQtTgsBf.mjs";
|
|
2
|
-
import { a as removeAgentAccess, i as agentAccess, n as pullHostedNativeLogs, r as closeAgentConnection } from "./hosted-logs-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { d as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { s as writeHostedNative } from "./ios-state-Dtw5K2aI.mjs";
|
|
3
|
+
import { a as removeAgentAccess, i as agentAccess, n as pullHostedNativeLogs, r as closeAgentConnection } from "./hosted-logs-CWKGYWNX.mjs";
|
|
4
|
+
import { l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-CPSp3mav.mjs";
|
|
5
|
+
import { d as runCancellationSignal } from "./native-run-D5OJsGwA.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, 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-rsRqysJc.mjs";
|
|
7
|
+
import { a as requireHostedMetro, i as requestHostedMetro, n as closeHostedMetro } from "./metro-gateway-Bp9gJQAN.mjs";
|
|
8
|
+
import { s as writeHostedNative } from "./ios-state-CT9nV5SP.mjs";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { readFileSync } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
@@ -81,6 +81,50 @@ async function reserveHostedNative(host, target, params, platform) {
|
|
|
81
81
|
throw Object.assign(/* @__PURE__ */ new Error(`${error instanceof Error ? error.message : String(error)} Retry stim ${platform} --remote auto; the build already targets ${host.machine}'s architecture.`), { remedy: `Retry stim ${platform} --remote auto.` });
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
const HOST_PORT_WINDOW = 64;
|
|
85
|
+
const devClientPortRemedy = (machine) => `Run stim stop, then stim ios --remote ${machine} without stim start, so Stim starts Metro on a port free on both Macs. If metro.port or STIM_METRO_PORT pins the port, pin one free on both Macs instead.`;
|
|
86
|
+
const devClientPortBusy = (machine, port) => ({
|
|
87
|
+
code: "STIM_HOSTING_REFUSED",
|
|
88
|
+
message: `${machine}: Port ${port} is in use on ${machine}, and an Expo dev client loads its bundle from this workspace's Metro port.`,
|
|
89
|
+
remedy: devClientPortRemedy(machine)
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* Answers whether a port is free for an Expo dev-client bridge on `machine`, asking the host for a window of ports at
|
|
93
|
+
* a time. A host without `hosted-metro-ports`, or one that cannot answer, counts every port as free; the bridge's own
|
|
94
|
+
* bind check still refuses an occupied one.
|
|
95
|
+
*/
|
|
96
|
+
function hostedMetroPortProbe(machine, note) {
|
|
97
|
+
let window = null;
|
|
98
|
+
let unknown = false;
|
|
99
|
+
return async (port) => {
|
|
100
|
+
if (unknown) return true;
|
|
101
|
+
if (!window || port < window.from || port >= window.from + HOST_PORT_WINDOW) {
|
|
102
|
+
const ports = Array.from({ length: Math.min(HOST_PORT_WINDOW, 65536 - port) }, (_, index) => port + index);
|
|
103
|
+
let host;
|
|
104
|
+
try {
|
|
105
|
+
host = await connectHost(machine, void 0, false, runCancellationSignal(ambientContext()));
|
|
106
|
+
if (!host.connection.supports("hosted-metro-ports")) {
|
|
107
|
+
unknown = true;
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const { busy } = await call(host, "device-host.metro.ports", { ports });
|
|
111
|
+
if (!Array.isArray(busy) || busy.some((each) => !Number.isInteger(each))) throw new Error(`${machine} answered device-host.metro.ports without its busy ports.`);
|
|
112
|
+
window = {
|
|
113
|
+
from: port,
|
|
114
|
+
busy: new Set(busy)
|
|
115
|
+
};
|
|
116
|
+
} catch (error) {
|
|
117
|
+
runCancellationSignal(ambientContext())?.throwIfAborted();
|
|
118
|
+
unknown = true;
|
|
119
|
+
note(`Could not check which Metro ports are free on ${machine} (${error instanceof Error ? error.message : String(error)}); choosing one free here`);
|
|
120
|
+
return true;
|
|
121
|
+
} finally {
|
|
122
|
+
host?.connection.close();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return !window.busy.has(port);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
84
128
|
async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId, selectors, release, mode = release ? "release" : "development", devClientScheme, reserved, note, enterPhase = () => {}, metro = requestHostedMetro, metroPort, platform = "ios" }) {
|
|
85
129
|
let host = target.host;
|
|
86
130
|
try {
|
|
@@ -112,7 +156,7 @@ async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId
|
|
|
112
156
|
setting: "hosting.agentDriver"
|
|
113
157
|
}
|
|
114
158
|
};
|
|
115
|
-
reserved(placement);
|
|
159
|
+
await reserved(placement);
|
|
116
160
|
session = await settle(host, session, ["preparing"], PREPARE_TIMEOUT_MS, platform, runCancellationSignal(ambientContext()));
|
|
117
161
|
if (session.state === "stopped") throw stoppedSession(host, session);
|
|
118
162
|
if (session.state !== "ready") throw unknownSession(host, session);
|
|
@@ -122,13 +166,16 @@ async function placeHostedNative(target, { root, slot, bundle, handoff, bundleId
|
|
|
122
166
|
...placement,
|
|
123
167
|
device
|
|
124
168
|
};
|
|
125
|
-
reserved(placement);
|
|
169
|
+
await reserved(placement);
|
|
126
170
|
if (mode === "development") {
|
|
127
171
|
const gateway = await metro(root, session.id, host.credential);
|
|
128
172
|
await call(host, "device-host.metro.open", {
|
|
129
173
|
session: session.id,
|
|
130
174
|
...gateway,
|
|
131
|
-
...platform === "android" ? { clientMetroPort: metroPort } : {}
|
|
175
|
+
...platform === "android" || devClientScheme ? { clientMetroPort: metroPort } : {}
|
|
176
|
+
}).catch((error) => {
|
|
177
|
+
if (platform === "ios" && devClientScheme && error.code === "device-busy") throw Object.assign(error, { remedy: devClientPortRemedy(host.machine) });
|
|
178
|
+
throw error;
|
|
132
179
|
});
|
|
133
180
|
} else {
|
|
134
181
|
await call(host, "device-host.metro.close", { session: session.id });
|
|
@@ -283,4 +330,4 @@ async function stopHostedNative(root, slot, signal, platform = "ios") {
|
|
|
283
330
|
if (failures.length) throw new Error(failures.join("\n"));
|
|
284
331
|
}
|
|
285
332
|
//#endregion
|
|
286
|
-
export { prepareHostedNative as n,
|
|
333
|
+
export { stopHostedNative as a, prepareHostedNative as i, hostedMetroPortProbe as n, placeHostedNative as r, devClientPortBusy as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { V as deviceSlotKey, _ as loadConfig$1 } from "./config-
|
|
2
|
-
import { o as formatLongDuration } from "./command-output-
|
|
3
|
-
import {
|
|
4
|
-
import { A as workspaceBuildInProgress, T as collectOwnedDeviceActivity } from "./budget-
|
|
1
|
+
import { V as deviceSlotKey, _ as loadConfig$1 } from "./config-BZhXY15H.mjs";
|
|
2
|
+
import { o as formatLongDuration } from "./command-output-BBvS1H6v.mjs";
|
|
3
|
+
import { r as readWorkspaceState$1, s as updateWorkspaceStateAsync } from "./workspace-state-CPSp3mav.mjs";
|
|
4
|
+
import { A as workspaceBuildInProgress, T as collectOwnedDeviceActivity } from "./budget-HyShrIpL.mjs";
|
|
5
5
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { _ as workspaceDeviceLastUseAt } from "./activity-
|
|
8
|
-
import { d as listAllIosSims } from "./ios-
|
|
6
|
+
import { A as teardownOwnedIosSim, O as teardownOwnedAvd } from "./workspaces-C9w4aeXF.mjs";
|
|
7
|
+
import { _ as workspaceDeviceLastUseAt } from "./activity-BpjwrQXU.mjs";
|
|
8
|
+
import { d as listAllIosSims } from "./ios-BQzvJlzw.mjs";
|
|
9
9
|
import { DEVICE_IDLE_SHUTDOWN_KEY, DEVICE_RECLAIM_REASON, readDeviceIdleShutdowns } from "@stim-cli/core/state";
|
|
10
10
|
//#region src/devices/idle-shutdown.ts
|
|
11
11
|
const SIM_LIST_TIMEOUT_MS = 1e4;
|
|
@@ -82,7 +82,7 @@ async function shutDownIdleDevices(root, idleMs, log, now = Date.now(), { only,
|
|
|
82
82
|
shutDown++;
|
|
83
83
|
const idleMinutes = Math.floor(idleForMs / MINUTE_MS);
|
|
84
84
|
try {
|
|
85
|
-
|
|
85
|
+
await updateWorkspaceStateAsync(root, (state) => ({
|
|
86
86
|
...state,
|
|
87
87
|
[DEVICE_IDLE_SHUTDOWN_KEY]: {
|
|
88
88
|
...readDeviceIdleShutdowns(state),
|
|
@@ -114,10 +114,10 @@ async function shutDownIdleDevices(root, idleMs, log, now = Date.now(), { only,
|
|
|
114
114
|
return shutDown;
|
|
115
115
|
}
|
|
116
116
|
/** Forgets the slot's idle shutdown once a run boots its device again. */
|
|
117
|
-
function clearDeviceIdleShutdown(root, platform, slot = "default") {
|
|
117
|
+
async function clearDeviceIdleShutdown(root, platform, slot = "default") {
|
|
118
118
|
const key = deviceSlotKey(platform, slot);
|
|
119
119
|
if (!(key in readDeviceIdleShutdowns(readWorkspaceState$1(root)))) return;
|
|
120
|
-
|
|
120
|
+
await updateWorkspaceStateAsync(root, (state) => {
|
|
121
121
|
const { [key]: _cleared, ...rest } = readDeviceIdleShutdowns(state);
|
|
122
122
|
const { [DEVICE_IDLE_SHUTDOWN_KEY]: _all, ...others } = state;
|
|
123
123
|
return Object.keys(rest).length ? {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as formatBytes, _ as loadConfig$1 } from "./config-
|
|
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-BZhXY15H.mjs";
|
|
3
3
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { n as runOperationFileQuiet, t as runOperationFile } from "./operation-exec-
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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-DS0mzR8U.mjs";
|
|
6
|
+
import { dt as isStimOwnedSim } from "./android-Cjcj8MCw.mjs";
|
|
7
|
+
import { a as recordCreatedDeviceAsync, n as forgetCreatedDeviceAsync } from "./created-devices-D2Aca-xu.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";
|
|
@@ -332,6 +332,25 @@ async function readHostMemoryPressureAsync(exec = getExecutor(), platform = proc
|
|
|
332
332
|
function memoryCulpritsUnder(pressure, exec = getExecutor()) {
|
|
333
333
|
return pressure === "warning" || pressure === "critical" ? readMemoryCulprits(exec) : null;
|
|
334
334
|
}
|
|
335
|
+
const CULPRIT_REUSE_MS = 3e4;
|
|
336
|
+
const recentCulprits = /* @__PURE__ */ new WeakMap();
|
|
337
|
+
function memoryCulpritsUnderAsync(pressure, exec = getExecutor()) {
|
|
338
|
+
if (pressure !== "warning" && pressure !== "critical") return Promise.resolve(null);
|
|
339
|
+
const recent = recentCulprits.get(exec);
|
|
340
|
+
if (recent && Date.now() - recent.at < CULPRIT_REUSE_MS) return recent.read;
|
|
341
|
+
const read = readMemoryCulpritsAsync(exec);
|
|
342
|
+
recentCulprits.set(exec, {
|
|
343
|
+
at: Date.now(),
|
|
344
|
+
read
|
|
345
|
+
});
|
|
346
|
+
return read;
|
|
347
|
+
}
|
|
348
|
+
function reportMemoryCulprits(pressure, emit, exec = getExecutor()) {
|
|
349
|
+
(async () => {
|
|
350
|
+
const named = memoryCulpritAdvice(await memoryCulpritsUnderAsync(pressure, exec));
|
|
351
|
+
if (named) emit(named);
|
|
352
|
+
})().catch(() => {});
|
|
353
|
+
}
|
|
335
354
|
function hostMemoryPressureAdvice(pressure, culprits = null) {
|
|
336
355
|
if (pressure === null || pressure === "normal") return null;
|
|
337
356
|
const named = memoryCulpritAdvice(culprits);
|
|
@@ -438,6 +457,11 @@ const SIMCTL_LIST_ARGS = [
|
|
|
438
457
|
"devices",
|
|
439
458
|
"--json"
|
|
440
459
|
];
|
|
460
|
+
const SIMCTL_LIST_ALL_ARGS = [
|
|
461
|
+
"simctl",
|
|
462
|
+
"list",
|
|
463
|
+
"--json"
|
|
464
|
+
];
|
|
441
465
|
function listAllIosSims({ timeoutMs = 3e4, includeUnavailable = false } = {}) {
|
|
442
466
|
return parseSimctlList(getExecutor().runFile("xcrun", SIMCTL_LIST_ARGS, {
|
|
443
467
|
timeoutMs,
|
|
@@ -446,21 +470,47 @@ function listAllIosSims({ timeoutMs = 3e4, includeUnavailable = false } = {}) {
|
|
|
446
470
|
}
|
|
447
471
|
function createIosSimSnapshot() {
|
|
448
472
|
let cached = null;
|
|
473
|
+
let listing = null;
|
|
474
|
+
const start = (options) => {
|
|
475
|
+
if (listing) return listing;
|
|
476
|
+
const entry = cached ??= {};
|
|
477
|
+
const run = listIosSimulatorAsync(options);
|
|
478
|
+
const pending = run.then((all) => entry.value ??= all.sims);
|
|
479
|
+
listing = run;
|
|
480
|
+
entry.pending = pending;
|
|
481
|
+
const forget = () => {
|
|
482
|
+
if (listing === run) listing = null;
|
|
483
|
+
if (entry.pending === pending) entry.pending = void 0;
|
|
484
|
+
};
|
|
485
|
+
run.catch(forget);
|
|
486
|
+
pending.catch(forget);
|
|
487
|
+
return run;
|
|
488
|
+
};
|
|
449
489
|
return {
|
|
450
490
|
read() {
|
|
451
491
|
const entry = cached ??= {};
|
|
452
492
|
entry.value ??= listAllIosSims({ includeUnavailable: true });
|
|
453
493
|
return entry.value;
|
|
454
494
|
},
|
|
455
|
-
async readAsync() {
|
|
495
|
+
async readAsync(options) {
|
|
456
496
|
const entry = cached ??= {};
|
|
457
497
|
if (entry.value) return entry.value;
|
|
458
|
-
entry.pending
|
|
498
|
+
if (!entry.pending && !listing) start(options);
|
|
499
|
+
entry.pending ??= listAllIosSimsAsync({
|
|
500
|
+
includeUnavailable: true,
|
|
501
|
+
...options
|
|
502
|
+
}).then((value) => entry.value = value).catch((error) => {
|
|
459
503
|
entry.pending = void 0;
|
|
460
504
|
throw error;
|
|
461
505
|
});
|
|
462
506
|
return entry.pending;
|
|
463
507
|
},
|
|
508
|
+
async runtimes(options) {
|
|
509
|
+
return (await start(options)).runtimes;
|
|
510
|
+
},
|
|
511
|
+
async deviceTypes(options) {
|
|
512
|
+
return (await start(options)).deviceTypes;
|
|
513
|
+
},
|
|
464
514
|
invalidate() {
|
|
465
515
|
cached = null;
|
|
466
516
|
}
|
|
@@ -474,6 +524,22 @@ async function listAllIosSimsAsync({ timeoutMs = 3e4, includeUnavailable = false
|
|
|
474
524
|
cwd: operation?.cwd
|
|
475
525
|
}), { includeUnavailable });
|
|
476
526
|
}
|
|
527
|
+
/** The simulators, runtimes and device types out of one unfiltered `simctl list --json`. */
|
|
528
|
+
function parseSimctlListing(jsonOutput) {
|
|
529
|
+
return {
|
|
530
|
+
sims: parseSimctlList(jsonOutput, { includeUnavailable: true }),
|
|
531
|
+
runtimes: parseIosRuntimes(jsonOutput),
|
|
532
|
+
deviceTypes: parseIosDeviceTypes(jsonOutput)
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
async function listIosSimulatorAsync({ signal, operation } = {}) {
|
|
536
|
+
return parseSimctlListing(await runOperationFile(operation, getExecutor(), "xcrun", SIMCTL_LIST_ALL_ARGS, {
|
|
537
|
+
timeoutMs: 3e4,
|
|
538
|
+
killSignal: "SIGKILL",
|
|
539
|
+
signal,
|
|
540
|
+
cwd: operation?.cwd
|
|
541
|
+
}));
|
|
542
|
+
}
|
|
477
543
|
function parseRuntimeVersion(runtimeId) {
|
|
478
544
|
const m = runtimeId.match(/iOS-(\d+)(?:-(\d+))?$/);
|
|
479
545
|
if (!m) return runtimeId;
|
|
@@ -486,9 +552,41 @@ const IOS_BOOT_TIMEOUT_MS = 6e5;
|
|
|
486
552
|
const BOOTSTATUS_ATTEMPT_MS = 24e4;
|
|
487
553
|
const BOOTSTATUS_ATTEMPT_FLOOR_MS = 1e3;
|
|
488
554
|
const BOOT_STATE_LIST_TIMEOUT_MS = 3e4;
|
|
489
|
-
|
|
555
|
+
const SPRINGBOARD_QUERY_TIMEOUT_MS = 1e4;
|
|
556
|
+
const SPRINGBOARD_POLL_MS = 250;
|
|
557
|
+
async function waitForSpringBoard(udid, deadline) {
|
|
558
|
+
for (;;) {
|
|
559
|
+
let output = null;
|
|
560
|
+
try {
|
|
561
|
+
output = await getExecutor().runFileAsync("xcrun", [
|
|
562
|
+
"simctl",
|
|
563
|
+
"spawn",
|
|
564
|
+
udid,
|
|
565
|
+
"notifyutil",
|
|
566
|
+
"-g",
|
|
567
|
+
"com.apple.springboard.finishedstartup"
|
|
568
|
+
], { timeoutMs: Math.max(BOOTSTATUS_ATTEMPT_FLOOR_MS, Math.min(SPRINGBOARD_QUERY_TIMEOUT_MS, deadline - Date.now())) });
|
|
569
|
+
} catch (error) {
|
|
570
|
+
if (!isTimeoutError(error)) return {
|
|
571
|
+
state: "unreadable",
|
|
572
|
+
reason: error?.message || String(error)
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
if (output !== null) {
|
|
576
|
+
const state = /^com\.apple\.springboard\.finishedstartup (\d+)$/m.exec(output);
|
|
577
|
+
if (!state) return {
|
|
578
|
+
state: "unreadable",
|
|
579
|
+
reason: `Could not read SpringBoard's startup state: ${output.trim() || "no output"}.`
|
|
580
|
+
};
|
|
581
|
+
if (Number(state[1]) > 0) return { state: "started" };
|
|
582
|
+
}
|
|
583
|
+
if (Date.now() >= deadline) return { state: "timed-out" };
|
|
584
|
+
await cancellableSleep(SPRINGBOARD_POLL_MS);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
async function iosSimulatorFailureAdvice(exec = getExecutor()) {
|
|
490
588
|
const pressure = readHostMemoryPressure(exec);
|
|
491
|
-
return hostMemoryPressureAdvice(pressure,
|
|
589
|
+
return hostMemoryPressureAdvice(pressure, await memoryCulpritsUnderAsync(pressure, exec)) ?? "The simulator may be unresponsive. Check Activity Monitor for memory pressure and free host memory before retrying.";
|
|
492
590
|
}
|
|
493
591
|
function bootstatusTimeout(command) {
|
|
494
592
|
const e = /* @__PURE__ */ new Error(`${command} timed out`);
|
|
@@ -614,8 +712,10 @@ async function bootIosSim(udid, { timeoutMs = IOS_BOOT_TIMEOUT_MS, attemptMs = B
|
|
|
614
712
|
if (state !== "Booting" && state !== "Booted" && state !== void 0) throw new Error(`Simulator ${udid} reports "${state ?? "missing"}" after ${waited}s of boot wait.`);
|
|
615
713
|
if (deadline - Date.now() <= 0) throw new Error(`Simulator ${udid} did not finish booting within ${Math.round(timeoutMs / 1e3)}s.`);
|
|
616
714
|
}
|
|
715
|
+
phase = "waiting for SpringBoard";
|
|
716
|
+
if ((await waitForSpringBoard(udid, deadline)).state === "timed-out") throw new Error(`Simulator ${udid} did not finish booting within ${Math.round(timeoutMs / 1e3)}s.`);
|
|
617
717
|
} catch (error) {
|
|
618
|
-
const named = memoryCulpritAdvice(
|
|
718
|
+
const named = memoryCulpritAdvice(await memoryCulpritsUnderAsync(sample(), exec));
|
|
619
719
|
throw new Error(`${error?.message || error} Last boot output: ${phase}. Highest observed memory pressure: ${worst ?? "unknown"}; unavailable samples: ${unknown}.${coverage()}${named ? ` ${named}` : ""} ${recovery} These observations do not establish an OOM crash.`, { cause: error });
|
|
620
720
|
} finally {
|
|
621
721
|
clearInterval(monitor);
|
|
@@ -655,7 +755,11 @@ const LIST_DEVICE_TYPES_OPTIONS = {
|
|
|
655
755
|
timeoutMs: 3e4,
|
|
656
756
|
killSignal: "SIGKILL"
|
|
657
757
|
};
|
|
658
|
-
async function listIosDeviceTypesAsync({ signal, operation } = {}) {
|
|
758
|
+
async function listIosDeviceTypesAsync({ signal, operation, snapshot } = {}) {
|
|
759
|
+
if (snapshot?.deviceTypes) return snapshot.deviceTypes({
|
|
760
|
+
signal,
|
|
761
|
+
operation
|
|
762
|
+
});
|
|
659
763
|
return parseIosDeviceTypes(await runOperationFile(operation, getExecutor(), "xcrun", LIST_DEVICE_TYPES_ARGS, {
|
|
660
764
|
...LIST_DEVICE_TYPES_OPTIONS,
|
|
661
765
|
signal,
|
|
@@ -772,7 +876,7 @@ async function createOwnedIosSim(label, { deviceType, runtime, suffix = "" } = {
|
|
|
772
876
|
timeoutMs: SIMCTL_CREATE_TIMEOUT_MS,
|
|
773
877
|
killSignal: "SIGKILL"
|
|
774
878
|
})).trim();
|
|
775
|
-
|
|
879
|
+
await recordCreatedDeviceAsync("ios", udid);
|
|
776
880
|
return {
|
|
777
881
|
udid,
|
|
778
882
|
name,
|
|
@@ -944,7 +1048,7 @@ async function deleteIosSim(udid, operation) {
|
|
|
944
1048
|
...SIMCTL_OPTIONS,
|
|
945
1049
|
cwd: operation?.cwd
|
|
946
1050
|
});
|
|
947
|
-
|
|
1051
|
+
await forgetCreatedDeviceAsync("ios", udid);
|
|
948
1052
|
}
|
|
949
1053
|
const PARKED_DELETE_TIMEOUT_MS = 3e4;
|
|
950
1054
|
async function deleteParkedIosSim(udid, operation) {
|
|
@@ -964,7 +1068,7 @@ async function deleteParkedIosSim(udid, operation) {
|
|
|
964
1068
|
timeoutMs: PARKED_DELETE_TIMEOUT_MS,
|
|
965
1069
|
cwd: operation?.cwd
|
|
966
1070
|
});
|
|
967
|
-
|
|
1071
|
+
await forgetCreatedDeviceAsync("ios", udid);
|
|
968
1072
|
}
|
|
969
1073
|
const LIST_RUNTIMES_ARGS = [
|
|
970
1074
|
"simctl",
|
|
@@ -979,7 +1083,8 @@ const LIST_RUNTIMES_OPTIONS = {
|
|
|
979
1083
|
function listIosRuntimes() {
|
|
980
1084
|
return parseIosRuntimes(getExecutor().runFile("xcrun", LIST_RUNTIMES_ARGS, LIST_RUNTIMES_OPTIONS));
|
|
981
1085
|
}
|
|
982
|
-
async function listIosRuntimesAsync({ signal } = {}) {
|
|
1086
|
+
async function listIosRuntimesAsync({ signal, snapshot } = {}) {
|
|
1087
|
+
if (snapshot?.runtimes) return snapshot.runtimes({ signal });
|
|
983
1088
|
return parseIosRuntimes(await getExecutor().runFileAsync("xcrun", LIST_RUNTIMES_ARGS, {
|
|
984
1089
|
...LIST_RUNTIMES_OPTIONS,
|
|
985
1090
|
signal
|
|
@@ -996,4 +1101,4 @@ function parseIosRuntimes(out) {
|
|
|
996
1101
|
}] : []);
|
|
997
1102
|
}
|
|
998
1103
|
//#endregion
|
|
999
|
-
export {
|
|
1104
|
+
export { waitForSpringBoard as A, memoryCulpritFindings as B, resetIosKeychain as C, sanitizeDeviceLabel as D, resolveOwnedIosSim as E, memoryCulpritsUnderAsync as F, deviceHoldsApk as H, readHostMemoryPressure as I, readHostMemoryPressureAsync as L, parseIosSimulatorApp as M, hostMemoryPressureAdvice as N, shutdownIosSim as O, memoryCulpritsUnder as P, reportMemoryCulprits as R, renameIosSim as S, resolveIosCreation as T, deviceHoldsBundle as U, readMemoryCulpritsAsync as V, 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, configuredIosSimulatorViewer as j, uninstallIosApp 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, resetIosPrivacy as w, pickDefaultIosCreation as x, parseRuntimeVersion as y, memoryCulpritAdvice as z };
|