Skip to content

Commit 3a84d86

Browse files
fix: add missing --device option (#2482)
1 parent a14ec56 commit 3a84d86

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

packages/cli-platform-apple/src/commands/buildCommand/buildOptions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export type BuildFlags = {
1616

1717
export const getBuildOptions = ({platformName}: BuilderCommand) => {
1818
const {readableName} = getPlatformInfo(platformName);
19+
const isMac = platformName === 'macos';
20+
1921
return [
2022
{
2123
name: '--mode <string>',
@@ -60,5 +62,11 @@ export const getBuildOptions = ({platformName}: BuilderCommand) => {
6062
name: '--force-pods',
6163
description: 'Force CocoaPods installation',
6264
},
65+
!isMac && {
66+
name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices
67+
description:
68+
'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' +
69+
'the app will run on the first available physical device.',
70+
},
6371
];
6472
};

packages/cli-platform-apple/src/commands/runCommand/runOptions.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ export const getRunOptions = ({platformName}: BuilderCommand) => {
4242
'between parentheses at the end to match an exact version: ' +
4343
'"iPhone 15 (17.0)"',
4444
},
45-
!isMac && {
46-
name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices
47-
description:
48-
'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' +
49-
'the app will run on the first available physical device.',
50-
},
5145
...getBuildOptions({platformName}),
5246
];
5347
};

packages/cli-platform-ios/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ Explicitly set Xcode scheme to use.
148148

149149
Explicitly set Xcode target to use.
150150

151+
#### `--device [string]`
152+
153+
Explicitly set device to use by name. The value is not required if you have a single device connected.
154+
151155
#### `--verbose`
152156

153157
Do not use `xcbeautify` or `xcpretty` even if installed.

0 commit comments

Comments
 (0)