Skip to content

Commit 3274f83

Browse files
committed
Prefer private simulator boot in CI paths
1 parent 9a6cc54 commit 3274f83

6 files changed

Lines changed: 40 additions & 28 deletions

File tree

.github/workflows/simdeck-provider.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,6 @@ jobs:
178178
raise SystemExit("No available iOS simulator")
179179
')"
180180
181-
xcrun simctl boot "$ios_udid" || true
182-
if ! run_with_timeout 180 xcrun simctl bootstatus "$ios_udid" -b; then
183-
echo "simctl bootstatus timed out"
184-
xcrun simctl list devices "$ios_udid" || true
185-
exit 1
186-
fi
187-
188181
dump_logs() {
189182
echo "--- simdeck.log ---"
190183
cat simdeck.log || true
@@ -233,6 +226,12 @@ jobs:
233226
: > simdeck.log
234227
simdeck_pid=""
235228
start_simdeck_server
229+
./build/simdeck --server-url http://127.0.0.1:4310 boot "$ios_udid"
230+
if ! run_with_timeout 180 xcrun simctl bootstatus "$ios_udid" -b; then
231+
echo "simctl bootstatus timed out"
232+
xcrun simctl list devices "$ios_udid" || true
233+
exit 1
234+
fi
236235
echo "Skipping private stream prewarm; the first browser WebRTC connection will attach the stream."
237236
238237
provider_base_url="$SIMDECK_CLOUD_URL/simulator/$PREVIEW_ID"

cli/XCWPrivateSimulatorBooter.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ + (BOOL)bootDeviceWithUDID:(NSString *)udid error:(NSError * _Nullable __autorel
219219
booted = ((BOOL(*)(id, SEL, id, NSError **))objc_msgSend)(
220220
targetDevice,
221221
bootWithOptionsSelector,
222-
@{ @"persist": @YES },
222+
// Keep the boot session owned by SimDeck's daemon instead of asking
223+
// CoreSimulator for a persistent GUI-visible session.
224+
@{ @"persist": @NO },
223225
&bootError
224226
);
225227
} else {

packages/simdeck-test/dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type SimDeckSession = {
3333
pid: number;
3434
projectRoot: string;
3535
list(): Promise<unknown>;
36+
boot(udid: string): Promise<void>;
3637
install(udid: string, appPath: string): Promise<void>;
3738
uninstall(udid: string, bundleId: string): Promise<void>;
3839
launch(udid: string, bundleId: string): Promise<void>;

packages/simdeck-test/dist/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export async function connect(options = {}) {
1818
pid: result.pid,
1919
projectRoot: result.projectRoot,
2020
list: () => requestJson(endpoint, "GET", "/api/simulators"),
21+
boot: (udid) =>
22+
requestOk(
23+
endpoint,
24+
`/api/simulators/${encodeURIComponent(udid)}/boot`,
25+
undefined,
26+
),
2127
install: (udid, appPath) =>
2228
requestOk(
2329
endpoint,

packages/simdeck-test/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export type SimDeckSession = {
4545
pid: number;
4646
projectRoot: string;
4747
list(): Promise<unknown>;
48+
boot(udid: string): Promise<void>;
4849
install(udid: string, appPath: string): Promise<void>;
4950
uninstall(udid: string, bundleId: string): Promise<void>;
5051
launch(udid: string, bundleId: string): Promise<void>;
@@ -114,6 +115,12 @@ export async function connect(
114115
pid: result.pid,
115116
projectRoot: result.projectRoot,
116117
list: () => requestJson(endpoint, "GET", "/api/simulators"),
118+
boot: (udid) =>
119+
requestOk(
120+
endpoint,
121+
`/api/simulators/${encodeURIComponent(udid)}/boot`,
122+
undefined,
123+
),
117124
install: (udid, appPath) =>
118125
requestOk(
119126
endpoint,

scripts/integration/js-api.mjs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,25 @@ async function main() {
9191
`created ${simulatorUDID} (${deviceType.name}, ${runtime.version}; iphonesimulator SDK ${sdkVersion})`,
9292
);
9393

94+
session = await measuredStep(
95+
"simdeck/test isolated connect",
96+
() =>
97+
connect({
98+
cliPath: simdeck,
99+
projectRoot: root,
100+
isolated: true,
101+
videoCodec: "software",
102+
}),
103+
{ phase: phaseSetup },
104+
);
105+
console.log(`daemon ${session.endpoint}`);
106+
94107
await measuredStep(
95-
"boot simulator",
108+
"JS boot simulator",
96109
() =>
97-
retrySync(
98-
() =>
99-
runText("xcrun", ["simctl", "boot", simulatorUDID], {
100-
timeoutMs: 180_000,
101-
}),
102-
"boot simulator",
110+
retryAsync(
111+
() => session.boot(simulatorUDID),
112+
"JS boot simulator",
103113
3,
104114
3_000,
105115
),
@@ -123,19 +133,6 @@ async function main() {
123133
{ phase: phaseSetup },
124134
);
125135

126-
session = await measuredStep(
127-
"simdeck/test isolated connect",
128-
() =>
129-
connect({
130-
cliPath: simdeck,
131-
projectRoot: root,
132-
isolated: true,
133-
videoCodec: "software",
134-
}),
135-
{ phase: phaseSetup },
136-
);
137-
console.log(`daemon ${session.endpoint}`);
138-
139136
await measuredStep(
140137
"JS install fixture",
141138
async () => {

0 commit comments

Comments
 (0)