Skip to content

Commit bc202f1

Browse files
committed
fix: naming clash
1 parent 5226335 commit bc202f1

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

docs/resources/(resources)/ios-simulator.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource deletes the simulator from the system. Xcode Command Line Tools must be
1313

1414
## Parameters:
1515

16-
- **name** *(string, required)* — Human-readable name for the simulator instance (e.g. `"iPhone 15 Dev"`). Must be unique across your declared simulators.
16+
- **simulatorName** *(string, required)* — Human-readable name for the simulator instance (e.g. `"iPhone 15 Dev"`). Must be unique across your declared simulators.
1717

1818
- **deviceType** *(string, required)* — CoreSimulator device type identifier. Use the format `com.apple.CoreSimulator.SimDeviceType.<Device>`. Run `xcrun simctl list devicetypes` to see identifiers available on your machine.
1919

@@ -27,7 +27,7 @@ resource deletes the simulator from the system. Xcode Command Line Tools must be
2727
[
2828
{
2929
"type": "ios-simulator",
30-
"name": "iPhone 15 Dev",
30+
"simulatorName": "iPhone 15 Dev",
3131
"deviceType": "com.apple.CoreSimulator.SimDeviceType.iPhone-15",
3232
"runtime": "com.apple.CoreSimulator.SimRuntime.iOS-18-0",
3333
"state": "Shutdown",
@@ -44,15 +44,15 @@ resource deletes the simulator from the system. Xcode Command Line Tools must be
4444
},
4545
{
4646
"type": "ios-simulator",
47-
"name": "iPhone 15 Pro",
47+
"simulatorName": "iPhone 15 Pro",
4848
"deviceType": "com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro",
4949
"runtime": "com.apple.CoreSimulator.SimRuntime.iOS-18-0",
5050
"state": "Shutdown",
5151
"os": ["macOS"]
5252
},
5353
{
5454
"type": "ios-simulator",
55-
"name": "iPad Pro 11-inch",
55+
"simulatorName": "iPad Pro 11-inch",
5656
"deviceType": "com.apple.CoreSimulator.SimDeviceType.iPad-Pro-11-inch-M4",
5757
"runtime": "com.apple.CoreSimulator.SimRuntime.iOS-18-0",
5858
"state": "Shutdown",

src/resources/ios/ios-simulator/ios-simulator.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import { OS } from '@codifycli/schemas';
1414

1515
const schema = z.object({
16-
name: z
16+
simulatorName: z
1717
.string()
1818
.describe('Name for the iOS simulator instance (e.g. "iPhone 15 Dev")'),
1919
deviceType: z
@@ -42,7 +42,7 @@ interface SimctlDevicesOutput {
4242
}
4343

4444
const defaultConfig: Partial<IosSimulatorConfig> & { os: any } = {
45-
name: '<Replace me here!>',
45+
simulatorName: '<Replace me here!>',
4646
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15',
4747
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
4848
state: 'Shutdown',
@@ -54,7 +54,7 @@ const exampleBasic: ExampleConfig = {
5454
description: 'Create an iPhone 15 simulator running iOS 18 for use in development and UI testing.',
5555
configs: [{
5656
type: 'ios-simulator',
57-
name: 'iPhone 15 Dev',
57+
simulatorName: 'iPhone 15 Dev',
5858
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15',
5959
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
6060
state: 'Shutdown',
@@ -69,15 +69,15 @@ const exampleMultiDevice: ExampleConfig = {
6969
{ type: 'xcode-tools', os: ['macOS'] },
7070
{
7171
type: 'ios-simulator',
72-
name: 'iPhone 15 Pro',
72+
simulatorName: 'iPhone 15 Pro',
7373
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro',
7474
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
7575
state: 'Shutdown',
7676
os: ['macOS'],
7777
},
7878
{
7979
type: 'ios-simulator',
80-
name: 'iPad Pro 11-inch',
80+
simulatorName: 'iPad Pro 11-inch',
8181
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPad-Pro-11-inch-M4',
8282
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
8383
state: 'Shutdown',
@@ -102,7 +102,7 @@ export class IosSimulatorResource extends Resource<IosSimulatorConfig> {
102102
state: { type: 'string', canModify: true },
103103
},
104104
allowMultiple: {
105-
identifyingParameters: ['name'],
105+
identifyingParameters: ['simulatorName'],
106106
},
107107
};
108108
}
@@ -123,10 +123,10 @@ export class IosSimulatorResource extends Resource<IosSimulatorConfig> {
123123
}
124124

125125
for (const [runtimeId, devices] of Object.entries(parsed.devices)) {
126-
const match = devices.find((d) => d.name === parameters.name);
126+
const match = devices.find((d) => d.name === parameters.simulatorName);
127127
if (match) {
128128
return {
129-
name: match.name,
129+
simulatorName: match.name,
130130
deviceType: match.deviceTypeIdentifier,
131131
runtime: runtimeId,
132132
state: match.state === 'Booted' ? 'Booted' : 'Shutdown',
@@ -139,11 +139,11 @@ export class IosSimulatorResource extends Resource<IosSimulatorConfig> {
139139

140140
async create(plan: CreatePlan<IosSimulatorConfig>): Promise<void> {
141141
const $ = getPty();
142-
const { name, deviceType, runtime, state } = plan.desiredConfig;
142+
const { simulatorName, deviceType, runtime, state } = plan.desiredConfig;
143143

144144
// xcrun simctl create prints the new simulator's UDID to stdout
145145
const { data: udid } = await $.spawn(
146-
`xcrun simctl create "${name}" "${deviceType}" "${runtime}"`,
146+
`xcrun simctl create "${simulatorName}" "${deviceType}" "${runtime}"`,
147147
{ interactive: true }
148148
);
149149

@@ -156,7 +156,7 @@ export class IosSimulatorResource extends Resource<IosSimulatorConfig> {
156156
if (pc.name !== 'state') return;
157157

158158
const $ = getPty();
159-
const udid = await this.getUdidByName(plan.desiredConfig.name);
159+
const udid = await this.getUdidByName(plan.desiredConfig.simulatorName);
160160
if (!udid) return;
161161

162162
if (plan.desiredConfig.state === 'Booted') {
@@ -168,7 +168,7 @@ export class IosSimulatorResource extends Resource<IosSimulatorConfig> {
168168

169169
async destroy(plan: DestroyPlan<IosSimulatorConfig>): Promise<void> {
170170
const $ = getPty();
171-
const udid = await this.getUdidByName(plan.currentConfig.name);
171+
const udid = await this.getUdidByName(plan.currentConfig.simulatorName);
172172
if (!udid) return;
173173

174174
await $.spawn(`xcrun simctl delete "${udid}"`, { interactive: true });

test/ios/ios-simulator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('iOS Simulator tests', { skip: !Utils.isMacOS() }, async () => {
1010
await PluginTester.fullTest(pluginPath, [
1111
{
1212
type: 'ios-simulator',
13-
name: 'codify-test-iphone',
13+
simulatorName: 'codify-test-iphone',
1414
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15',
1515
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
1616
state: 'Shutdown',
@@ -28,7 +28,7 @@ describe('iOS Simulator tests', { skip: !Utils.isMacOS() }, async () => {
2828
testModify: {
2929
modifiedConfigs: [{
3030
type: 'ios-simulator',
31-
name: 'codify-test-iphone',
31+
simulatorName: 'codify-test-iphone',
3232
deviceType: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15',
3333
runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-18-0',
3434
state: 'Booted',

0 commit comments

Comments
 (0)