diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index 9e51276644..33f42dd63c 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -36049,6 +36049,16 @@ ], "possibleTypes": null }, + { + "kind": "SCALAR", + "name": "ByteSize", + "description": "A non-negative integer number of bytes.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "UNION", "name": "ChannelBuildOrEmbeddedUpdate", @@ -37884,6 +37894,41 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "CreateAndroidDeviceRunSessionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "deviceIdentifier", + "description": "AVD hardware profile id to use for the emulator (e.g. \"pixel_9\").", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "systemImagePackage", + "description": "Android SDK system image package to use for the emulator (e.g.\n\"system-images;android-35-ext15;google_apis_playstore;x86_64\").", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "CreateAndroidSubmissionInput", @@ -38293,7 +38338,7 @@ "name": null, "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "ByteSize", "ofType": null } }, @@ -38366,6 +38411,18 @@ "description": null, "fields": null, "inputFields": [ + { + "name": "android", + "description": "Android emulator options. Only supported when platform is ANDROID.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CreateAndroidDeviceRunSessionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "appId", "description": null, @@ -38384,7 +38441,7 @@ }, { "name": "applicationArchiveUrl", - "description": "Application archive URL to download, install, and launch before the simulator session\nbecomes available. Mutually exclusive with buildId and expoGo.", + "description": "Application archive URL to download, install, and launch before the simulator session\nbecomes available. Mutually exclusive with buildId, buildFingerprint, and expoGo.", "type": { "kind": "SCALAR", "name": "String", @@ -38395,11 +38452,11 @@ "deprecationReason": null }, { - "name": "buildId", - "description": "EAS Build to install and launch before the simulator session becomes available.\nMutually exclusive with applicationArchiveUrl and expoGo.", + "name": "buildFingerprint", + "description": "Fingerprint hash of an EAS Build to install and launch before the simulator session becomes\navailable; the server resolves it to the most recent installable build with this fingerprint.\nMutually exclusive with buildId, applicationArchiveUrl, and expoGo.", "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null }, "defaultValue": null, @@ -38407,11 +38464,11 @@ "deprecationReason": null }, { - "name": "deviceIdentifier", - "description": "Identifier of the virtual device to start for the session. On iOS this is a\nSimulator device name or UDID (e.g. \"iPhone 16 Pro\"). On Android this is an\nAVD hardware profile id (e.g. \"pixel_7\"). If omitted, the runner picks a\ndefault device.", + "name": "buildId", + "description": "EAS Build to install and launch before the simulator session becomes available.\nMutually exclusive with buildFingerprint, applicationArchiveUrl, and expoGo.", "type": { "kind": "SCALAR", - "name": "String", + "name": "ID", "ofType": null }, "defaultValue": null, @@ -38420,7 +38477,7 @@ }, { "name": "expoGo", - "description": "Install and launch Expo Go before the simulator session becomes available. The server resolves\nthe platform-specific application archive. Mutually exclusive with buildId and\napplicationArchiveUrl.", + "description": "Install and launch Expo Go before the simulator session becomes available. The server resolves\nthe platform-specific application archive. Mutually exclusive with buildId, buildFingerprint,\nand applicationArchiveUrl.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -38430,6 +38487,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "ios", + "description": "iOS Simulator options. Only supported when platform is IOS.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CreateIosDeviceRunSessionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "launchArgs", "description": "Arguments passed to the installed application when it is launched. Requires buildId,\napplicationArchiveUrl, or expoGo.", @@ -40044,6 +40113,29 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "CreateIosDeviceRunSessionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "deviceIdentifier", + "description": "Simulator device name or UDID to use for the session (e.g. \"iPhone 16 Pro\").", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "CreateIosSubmissionInput", diff --git a/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts b/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts index a7e9c9be29..04c7b5c78b 100644 --- a/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts +++ b/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts @@ -509,7 +509,7 @@ describe(Simulator, () => { ); }); - it('forwards --device to the create mutation as deviceIdentifier', async () => { + it('forwards --device in the iOS create options', async () => { const { command } = createCommand([ '--platform', 'ios', @@ -521,7 +521,23 @@ describe(Simulator, () => { expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith( graphqlClient, - expect.objectContaining({ deviceIdentifier: 'iPhone 16 Pro' }) + expect.objectContaining({ ios: { deviceIdentifier: 'iPhone 16 Pro' } }) + ); + }); + + it('forwards --device in the Android create options', async () => { + const { command } = createCommand([ + '--platform', + 'android', + '--non-interactive', + '--device', + 'pixel_9', + ]); + await command.runAsync(); + + expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith( + graphqlClient, + expect.objectContaining({ android: { deviceIdentifier: 'pixel_9' } }) ); }); @@ -537,7 +553,7 @@ describe(Simulator, () => { expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith( graphqlClient, - expect.objectContaining({ deviceIdentifier: 'iPhone 16 Pro' }) + expect.objectContaining({ ios: { deviceIdentifier: 'iPhone 16 Pro' } }) ); }); @@ -545,10 +561,7 @@ describe(Simulator, () => { const { command } = createCommand(['--platform', 'ios', '--non-interactive', '--device', ' ']); await command.runAsync(); - expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith( - graphqlClient, - expect.objectContaining({ deviceIdentifier: undefined }) - ); + expect(mockCreateDeviceRunSessionAsync.mock.calls[0][1]).not.toHaveProperty('ios'); }); it('omits resourceClass when --resource-class is not set', async () => { diff --git a/packages/eas-cli/src/commands/simulator/index.ts b/packages/eas-cli/src/commands/simulator/index.ts index 94dc1eac5a..fdb7507893 100644 --- a/packages/eas-cli/src/commands/simulator/index.ts +++ b/packages/eas-cli/src/commands/simulator/index.ts @@ -249,7 +249,11 @@ export default class Simulator extends EasCommand { platform, type: DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE[flags.type], packageVersion: flags['package-version'], - deviceIdentifier, + ...(deviceIdentifier + ? platform === AppPlatform.Ios + ? { ios: { deviceIdentifier } } + : { android: { deviceIdentifier } } + : {}), ...(buildId ? { buildId } : {}), ...(applicationArchiveUrlFromFlag ? { applicationArchiveUrl: applicationArchiveUrlFromFlag } diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index 11911f0f0f..b25ac1e78e 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -19,6 +19,7 @@ export type Scalars = { Boolean: { input: boolean; output: boolean; } Int: { input: number; output: number; } Float: { input: number; output: number; } + ByteSize: { input: any; output: any; } DateTime: { input: any; output: any; } DevDomainName: { input: any; output: any; } EnvironmentVariableEnvironment: { input: any; output: any; } @@ -5341,6 +5342,16 @@ export type CreateAndConfigureRepositoryInput = { installationIdentifier: Scalars['Int']['input']; }; +export type CreateAndroidDeviceRunSessionInput = { + /** AVD hardware profile id to use for the emulator (e.g. "pixel_9"). */ + deviceIdentifier?: InputMaybe; + /** + * Android SDK system image package to use for the emulator (e.g. + * "system-images;android-35-ext15;google_apis_playstore;x86_64"). + */ + systemImagePackage?: InputMaybe; +}; + export type CreateAndroidSubmissionInput = { appId: Scalars['ID']['input']; archiveSource?: InputMaybe; @@ -5388,7 +5399,7 @@ export type CreateDeviceRunSessionArtifactUploadSessionInput = { kind?: InputMaybe; metadata?: InputMaybe; name: Scalars['String']['input']; - size: Scalars['Int']['input']; + size: Scalars['ByteSize']['input']; }; export type CreateDeviceRunSessionArtifactUploadSessionResult = { @@ -5402,30 +5413,33 @@ export type CreateDeviceRunSessionEventLogUploadSessionResult = { }; export type CreateDeviceRunSessionInput = { + /** Android emulator options. Only supported when platform is ANDROID. */ + android?: InputMaybe; appId: Scalars['ID']['input']; /** * Application archive URL to download, install, and launch before the simulator session - * becomes available. Mutually exclusive with buildId and expoGo. + * becomes available. Mutually exclusive with buildId, buildFingerprint, and expoGo. */ applicationArchiveUrl?: InputMaybe; /** - * EAS Build to install and launch before the simulator session becomes available. - * Mutually exclusive with applicationArchiveUrl and expoGo. + * Fingerprint hash of an EAS Build to install and launch before the simulator session becomes + * available; the server resolves it to the most recent installable build with this fingerprint. + * Mutually exclusive with buildId, applicationArchiveUrl, and expoGo. */ - buildId?: InputMaybe; + buildFingerprint?: InputMaybe; /** - * Identifier of the virtual device to start for the session. On iOS this is a - * Simulator device name or UDID (e.g. "iPhone 16 Pro"). On Android this is an - * AVD hardware profile id (e.g. "pixel_7"). If omitted, the runner picks a - * default device. + * EAS Build to install and launch before the simulator session becomes available. + * Mutually exclusive with buildFingerprint, applicationArchiveUrl, and expoGo. */ - deviceIdentifier?: InputMaybe; + buildId?: InputMaybe; /** * Install and launch Expo Go before the simulator session becomes available. The server resolves - * the platform-specific application archive. Mutually exclusive with buildId and - * applicationArchiveUrl. + * the platform-specific application archive. Mutually exclusive with buildId, buildFingerprint, + * and applicationArchiveUrl. */ expoGo?: InputMaybe; + /** iOS Simulator options. Only supported when platform is IOS. */ + ios?: InputMaybe; /** * Arguments passed to the installed application when it is launched. Requires buildId, * applicationArchiveUrl, or expoGo. @@ -5623,6 +5637,11 @@ export type CreateGitHubRepositorySettingsInput = { baseDirectory: Scalars['String']['input']; }; +export type CreateIosDeviceRunSessionInput = { + /** Simulator device name or UDID to use for the session (e.g. "iPhone 16 Pro"). */ + deviceIdentifier?: InputMaybe; +}; + export type CreateIosSubmissionInput = { appId: Scalars['ID']['input']; archiveSource?: InputMaybe;