Skip to content

Commit 068d4c5

Browse files
authored
chore: remove ensure-simulator lifecycle command (#552)
1 parent 60f36ef commit 068d4c5

24 files changed

Lines changed: 13 additions & 493 deletions

fallow-baselines/health.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,6 @@
687687
"count": 1
688688
}
689689
},
690-
"src/platforms/ios/ensure-simulator.ts": {
691-
"complexity_moderate": {
692-
"count": 1
693-
},
694-
"crap_moderate": {
695-
"count": 1
696-
}
697-
},
698690
"src/platforms/ios/interactions.ts": {
699691
"complexity_critical": {
700692
"count": 1
@@ -999,4 +991,4 @@
999991
"src/daemon/screenshot-overlay.ts:untested risk",
1000992
"src/utils/screenshot-diff-non-text.ts:complexity"
1001993
]
1002-
}
994+
}

src/__tests__/cli-client-commands.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -961,20 +961,6 @@ function createStubClient(params: {
961961
list: async () => [],
962962
close: async () => ({ session: 'default', identifiers: { session: 'default' } }),
963963
},
964-
simulators: {
965-
ensure: async () => ({
966-
udid: 'sim-1',
967-
device: 'iPhone 16',
968-
runtime: 'iOS-18-0',
969-
created: false,
970-
booted: true,
971-
identifiers: {
972-
deviceId: 'sim-1',
973-
deviceName: 'iPhone 16',
974-
udid: 'sim-1',
975-
},
976-
}),
977-
},
978964
apps: {
979965
install: async () => ({
980966
app: 'Demo',

src/__tests__/remote-connection.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ function createTestClient(
6363
identifiers: { session: 'adc-android' },
6464
})),
6565
}),
66-
simulators: createThrowingMethodGroup<AgentDeviceClient['simulators']>(),
6766
apps: createThrowingMethodGroup<AgentDeviceClient['apps']>(),
6867
materializations: createThrowingMethodGroup<AgentDeviceClient['materializations']>(),
6968
leases: createThrowingMethodGroup<AgentDeviceClient['leases']>({

src/__tests__/runtime-admin-router.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ test('admin runtime commands call typed backend primitives', async () => {
3939
const boot = await device.admin.boot({ target: { id: 'SIM-1' } });
4040
assert.equal(boot.kind, 'deviceBooted');
4141

42-
const simulator = await device.admin.ensureSimulator({
43-
device: 'iPhone 16',
44-
runtime: 'iOS 18',
45-
boot: true,
46-
});
47-
assert.equal(simulator.udid, 'SIM-1');
48-
4942
const installed = await device.admin.install({
5043
app: 'com.example.app',
5144
source: { kind: 'path', path: '/tmp/Example.app' },
@@ -67,7 +60,6 @@ test('admin runtime commands call typed backend primitives', async () => {
6760
assert.deepEqual(calls, [
6861
'listDevices',
6962
'bootDevice',
70-
'ensureSimulator',
7163
'installApp',
7264
'reinstallApp',
7365
'installApp',
@@ -252,16 +244,6 @@ function createAdminBackend(
252244
bootDevice: async () => {
253245
calls.push('bootDevice');
254246
},
255-
ensureSimulator: async (_context, options) => {
256-
calls.push('ensureSimulator');
257-
return {
258-
udid: 'SIM-1',
259-
device: options.device,
260-
runtime: options.runtime ?? 'iOS 18',
261-
created: false,
262-
booted: true,
263-
};
264-
},
265247
installApp: async (_context, target) => {
266248
calls.push('installApp');
267249
onInstallSource?.(target.source);

src/backend.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,6 @@ export type BackendDeviceTarget = {
258258
headless?: boolean;
259259
};
260260

261-
export type BackendEnsureSimulatorOptions = {
262-
device: string;
263-
runtime?: string;
264-
boot?: boolean;
265-
reuseExisting?: boolean;
266-
};
267-
268-
export type BackendEnsureSimulatorResult = {
269-
udid: string;
270-
device: string;
271-
runtime: string;
272-
created: boolean;
273-
booted: boolean;
274-
simulatorSetPath?: string | null;
275-
};
276-
277261
export type BackendInstallSource =
278262
| {
279263
kind: 'path';
@@ -549,10 +533,6 @@ export type AgentDeviceBackend = {
549533
context: BackendCommandContext,
550534
target?: BackendDeviceTarget,
551535
): Promise<BackendActionResult>;
552-
ensureSimulator?(
553-
context: BackendCommandContext,
554-
options: BackendEnsureSimulatorOptions,
555-
): Promise<BackendEnsureSimulatorResult>;
556536
resolveInstallSource?(
557537
context: BackendCommandContext,
558538
source: BackendInstallSource,

src/cli.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const REMOTE_MATERIALIZATION_DEFERRED_COMMANDS = new Set([
6060
'connection',
6161
'close',
6262
'disconnect',
63-
'ensure-simulator',
6463
'metro',
6564
'session',
6665
]);

src/cli/commands/connection-runtime.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const leaseDeferredCommands = new Set([
2222
'connection',
2323
'close',
2424
'disconnect',
25-
'ensure-simulator',
2625
'metro',
2726
'session',
2827
]);

src/cli/commands/ensure-simulator.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/cli/commands/router.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { CliFlags } from '../../utils/command-schema.ts';
22
import type { AgentDeviceClient } from '../../client.ts';
33
import { sessionCommand } from './session.ts';
44
import { devicesCommand } from './devices.ts';
5-
import { ensureSimulatorCommand } from './ensure-simulator.ts';
65
import { metroCommand } from './metro.ts';
76
import { appsCommand } from './apps.ts';
87
import { installCommand, reinstallCommand, installFromSourceCommand } from './install.ts';
@@ -25,7 +24,6 @@ const dedicatedCliCommandHandlers = {
2524
session: sessionCommand,
2625
devices: devicesCommand,
2726
apps: appsCommand,
28-
'ensure-simulator': ensureSimulatorCommand,
2927
metro: metroCommand,
3028
install: installCommand,
3129
reinstall: reinstallCommand,

src/client-normalizers.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
stripUndefined,
2929
} from './utils/parsing.ts';
3030

31-
export { readNullableString, readOptionalString, readRequiredString } from './utils/parsing.ts';
31+
export { readOptionalString, readRequiredString } from './utils/parsing.ts';
3232

3333
const DEFAULT_SESSION_NAME = 'default';
3434

@@ -249,9 +249,6 @@ export function buildFlags(options: InternalRequestOptions): CommandFlags {
249249
serial: options.serial,
250250
iosSimulatorDeviceSet: options.iosSimulatorDeviceSet,
251251
androidDeviceAllowlist: options.androidDeviceAllowlist,
252-
runtime: options.simulatorRuntimeId,
253-
boot: options.boot,
254-
reuseExisting: options.reuseExisting,
255252
surface: options.surface,
256253
activity: options.activity,
257254
relaunch: options.relaunch,

0 commit comments

Comments
 (0)