mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b836ef30c | ||
|
|
bcb5d96ea8 |
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'eas-cli': minor
|
||||
---
|
||||
|
||||
Add `--os-version` to `eas simulator` to select the iOS Simulator runtime version.
|
||||
Generated
+13
-1
@@ -46796,7 +46796,19 @@
|
||||
"inputFields": [
|
||||
{
|
||||
"name": "deviceIdentifier",
|
||||
"description": "Simulator device name or UDID to use for the session (e.g. \"iPhone 16 Pro\").",
|
||||
"description": "Simulator device name or UDID to use for the session (e.g. \"iPhone 17 Pro\"). If omitted,\nthe default device of the selected iOS version is used.",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "osVersion",
|
||||
"description": "iOS version of the Simulator runtime, as major.minor (e.g. \"18.6\") or as a major version\n(e.g. \"26\") for the newest available release of that major. Each version runs on the macOS\nworker image that has that runtime, so the session also uses that image's Xcode. Unavailable\nversions are rejected with the list of available ones. Not every account can select a version\nyet. If omitted, the default iOS version is used.",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
|
||||
@@ -1223,6 +1223,54 @@ describe(Simulator, () => {
|
||||
expect(mockCreateDeviceRunSessionAsync.mock.calls[0][1]).not.toHaveProperty('ios');
|
||||
});
|
||||
|
||||
it('forwards --os-version in the iOS create options', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'ios',
|
||||
'--non-interactive',
|
||||
'--os-version',
|
||||
' 18.5 ',
|
||||
]);
|
||||
await command.runAsync();
|
||||
|
||||
expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith(
|
||||
graphqlClient,
|
||||
expect.objectContaining({ ios: { osVersion: '18.5' } })
|
||||
);
|
||||
});
|
||||
|
||||
it('forwards --os-version together with --device', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'ios',
|
||||
'--non-interactive',
|
||||
'--device',
|
||||
'iPhone 16 Pro',
|
||||
'--os-version',
|
||||
'26',
|
||||
]);
|
||||
await command.runAsync();
|
||||
|
||||
expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith(
|
||||
graphqlClient,
|
||||
expect.objectContaining({ ios: { deviceIdentifier: 'iPhone 16 Pro', osVersion: '26' } })
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects --os-version for Android before creating a session', async () => {
|
||||
const { command } = createCommand([
|
||||
'--platform',
|
||||
'android',
|
||||
'--non-interactive',
|
||||
'--os-version',
|
||||
'18.5',
|
||||
]);
|
||||
await expect(command.runAsync()).rejects.toThrow(
|
||||
'--os-version is only supported with --platform ios.'
|
||||
);
|
||||
expect(mockCreateDeviceRunSessionAsync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('omits resourceClass when --resource-class is not set', async () => {
|
||||
const { command } = createCommand(['--platform', 'ios', '--non-interactive']);
|
||||
await command.runAsync();
|
||||
|
||||
@@ -108,6 +108,10 @@ export default class Simulator extends EasCommand {
|
||||
description:
|
||||
'Android SDK system image package to use for the emulator (e.g. "system-images;android-35-ext15;google_apis_playstore;x86_64"). Defaults to a system image chosen by the runner. Only supported with --platform android.',
|
||||
}),
|
||||
'os-version': Flags.string({
|
||||
description:
|
||||
'iOS version of the Simulator runtime, as major.minor (e.g. "18.6") or as a major version (e.g. "26") for the newest available release of that major. Unavailable versions are rejected with the list of available ones. Defaults to the server default. Only supported with --platform ios.',
|
||||
}),
|
||||
'build-id': Flags.string({
|
||||
description: 'EAS Build to install and launch before the simulator session is ready.',
|
||||
exclusive: ['build-fingerprint', 'application-archive-url', 'expo-go'],
|
||||
@@ -257,6 +261,7 @@ export default class Simulator extends EasCommand {
|
||||
const tags = flags.tag?.map(tag => tag.trim()).filter(tag => tag.length > 0);
|
||||
const deviceIdentifier = flags.device?.trim() || undefined;
|
||||
const systemImagePackage = flags['system-image']?.trim() || undefined;
|
||||
const osVersion = flags['os-version']?.trim() || undefined;
|
||||
const buildId = flags['build-id']?.trim() || undefined;
|
||||
const buildFingerprint = flags['build-fingerprint']?.trim() || undefined;
|
||||
const applicationArchiveUrlFromFlag = flags['application-archive-url']?.trim() || undefined;
|
||||
@@ -303,6 +308,9 @@ export default class Simulator extends EasCommand {
|
||||
if (systemImagePackage && platform !== AppPlatform.Android) {
|
||||
throw new EasCommandError('--system-image is only supported with --platform android.');
|
||||
}
|
||||
if (osVersion && platform !== AppPlatform.Ios) {
|
||||
throw new EasCommandError('--os-version is only supported with --platform ios.');
|
||||
}
|
||||
let egressAllow: string[] = [];
|
||||
try {
|
||||
egressAllow = parseEgressAllowList(flags['egress-allow'] ?? []);
|
||||
@@ -379,8 +387,13 @@ export default class Simulator extends EasCommand {
|
||||
networkCapture: flags['network-capture'],
|
||||
...(networkCaptureFields.length ? { networkCaptureFields } : {}),
|
||||
...(platform === AppPlatform.Ios
|
||||
? deviceIdentifier
|
||||
? { ios: { deviceIdentifier } }
|
||||
? deviceIdentifier || osVersion
|
||||
? {
|
||||
ios: {
|
||||
...(deviceIdentifier ? { deviceIdentifier } : {}),
|
||||
...(osVersion ? { osVersion } : {}),
|
||||
},
|
||||
}
|
||||
: {}
|
||||
: deviceIdentifier || systemImagePackage
|
||||
? {
|
||||
|
||||
+12
-1
@@ -6613,8 +6613,19 @@ export type CreateGitHubRepositorySettingsInput = {
|
||||
};
|
||||
|
||||
export type CreateIosDeviceRunSessionInput = {
|
||||
/** Simulator device name or UDID to use for the session (e.g. "iPhone 16 Pro"). */
|
||||
/**
|
||||
* Simulator device name or UDID to use for the session (e.g. "iPhone 17 Pro"). If omitted,
|
||||
* the default device of the selected iOS version is used.
|
||||
*/
|
||||
deviceIdentifier?: InputMaybe<Scalars['String']['input']>;
|
||||
/**
|
||||
* iOS version of the Simulator runtime, as major.minor (e.g. "18.6") or as a major version
|
||||
* (e.g. "26") for the newest available release of that major. Each version runs on the macOS
|
||||
* worker image that has that runtime, so the session also uses that image's Xcode. Unavailable
|
||||
* versions are rejected with the list of available ones. Not every account can select a version
|
||||
* yet. If omitted, the default iOS version is used.
|
||||
*/
|
||||
osVersion?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type CreateIosSubmissionInput = {
|
||||
|
||||
@@ -17,6 +17,7 @@ module Pod
|
||||
%r{https?://(api\.)?github\.com/},
|
||||
%r{https?://sourceforge\.net/},
|
||||
%r{https?://repo1\.maven\.org/},
|
||||
%r{https?://central\.sonatype\.com/},
|
||||
%r{https?://boostorg\.jfrog\.io/},
|
||||
%r{https?://www\.sqlite\.org/},
|
||||
%r{https?://download\.videolan\.org/},
|
||||
|
||||
@@ -142,6 +142,17 @@ RSpec.describe ExpoCocoaPodsProxy do
|
||||
downloader.download_file(path.to_s)
|
||||
end
|
||||
|
||||
it 'fetches Sonatype snapshot artifacts via proxy' do
|
||||
path = Pathname.new('some/fake/path')
|
||||
url = 'https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/react-native-artifacts/0.82.0-SNAPSHOT/maven-metadata.xml'
|
||||
opts = {}
|
||||
downloader = Pod::Downloader::Http.new(path, url, opts)
|
||||
|
||||
expect(downloader).to receive(:download_file_via_proxy).once {}
|
||||
|
||||
downloader.download_file(path.to_s)
|
||||
end
|
||||
|
||||
it 'does not proxy when url doesn\'t match an allowlist regex' do
|
||||
path = Pathname.new('some/fake/path')
|
||||
url = 'https://not-github.com/expo/test-repo/archive/main.tar.gz'
|
||||
|
||||
Reference in new issue
Block a user