-
Notifications
You must be signed in to change notification settings - Fork 891
/
runOptions.ts
53 lines (52 loc) · 1.73 KB
/
runOptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import {getDefaultUserTerminal} from '@react-native-community/cli-tools';
import {BuilderCommand} from '../../types';
import {getPlatformInfo} from './getPlatformInfo';
import {getBuildOptions} from '../buildCommand/buildOptions';
export const getRunOptions = ({platformName}: BuilderCommand) => {
const {readableName} = getPlatformInfo(platformName);
const isMac = platformName === 'macos';
return [
{
name: '--no-packager',
description: 'Do not launch packager while running the app',
},
{
name: '--port <number>',
default: process.env.RCT_METRO_PORT || 8081,
parse: Number,
},
{
name: '--terminal <string>',
description:
'Launches the Metro Bundler in a new window using the specified terminal path.',
default: getDefaultUserTerminal(),
},
{
name: '--binary-path <string>',
description:
'Path relative to project root where pre-built .app binary lives.',
},
{
name: '--list-devices',
description: `List all available ${readableName} devices and simulators and let you choose one to run the app. `,
},
{
name: '--udid <string>',
description: 'Explicitly set the device to use by UDID',
},
!isMac && {
name: '--simulator <string>',
description:
`Explicitly set the simulator to use. Optionally set the ${readableName} version ` +
'between parentheses at the end to match an exact version: ' +
'"iPhone 15 (17.0)"',
},
!isMac && {
name: '--device <string>',
description:
'Explicitly set the device to use by name. The value is not required ' +
'if you have a single device connected.',
},
...getBuildOptions({platformName}),
];
};