Socket
Socket
Sign inDemoInstall

@react-native-community/cli-platform-ios

Package Overview
Dependencies
76
Maintainers
30
Versions
197
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 12.0.0-alpha.13 to 12.0.0-alpha.14

build/commands/buildIOS/buildOptions.d.ts

13

build/commands/buildIOS/buildProject.d.ts
import { IOSProjectInfo } from '@react-native-community/cli-types';
export type BuildFlags = {
mode: string;
target: string;
verbose: boolean;
xcconfig?: string;
buildFolder?: string;
interactive?: boolean;
destination?: string;
extraParams?: string[];
};
export declare function buildProject(xcodeProject: IOSProjectInfo, udid: string | undefined, scheme: string, args: BuildFlags): Promise<string>;
import type { BuildFlags } from './buildOptions';
export declare function buildProject(xcodeProject: IOSProjectInfo, udid: string | undefined, mode: string, scheme: string, args: BuildFlags): Promise<string>;
//# sourceMappingURL=buildProject.d.ts.map

@@ -29,5 +29,5 @@ "use strict";

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function buildProject(xcodeProject, udid, scheme, args) {
function buildProject(xcodeProject, udid, mode, scheme, args) {
return new Promise((resolve, reject) => {
const xcodebuildArgs = [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, ...(args.xcconfig ? ['-xcconfig', args.xcconfig] : []), ...(args.buildFolder ? ['-derivedDataPath', args.buildFolder] : []), '-configuration', args.mode, '-scheme', scheme, '-destination', (udid ? `id=${udid}` : args.mode === 'Debug' ? 'generic/platform=iOS Simulator' : 'generic/platform=iOS') + (args.destination ? ',' + args.destination : '')];
const xcodebuildArgs = [xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, ...(args.xcconfig ? ['-xcconfig', args.xcconfig] : []), ...(args.buildFolder ? ['-derivedDataPath', args.buildFolder] : []), '-configuration', mode, '-scheme', scheme, '-destination', (udid ? `id=${udid}` : mode === 'Debug' ? 'generic/platform=iOS Simulator' : 'generic/platform=iOS') + (args.destination ? ',' + args.destination : '')];
if (args.extraParams) {

@@ -34,0 +34,0 @@ xcodebuildArgs.push(...args.extraParams);

@@ -9,19 +9,4 @@ /**

import { Config } from '@react-native-community/cli-types';
import { BuildFlags } from './buildProject';
export interface FlagsT extends BuildFlags {
simulator?: string;
device?: string | true;
udid?: string;
scheme?: string;
}
declare function buildIOS(_: Array<string>, ctx: Config, args: FlagsT): Promise<string | void>;
export declare const iosBuildOptions: ({
name: string;
description: string;
parse?: undefined;
} | {
name: string;
description: string;
parse: (val: string) => string[];
})[];
import { BuildFlags } from './buildOptions';
declare function buildIOS(_: Array<string>, ctx: Config, args: BuildFlags): Promise<string>;
declare const _default: {

@@ -28,0 +13,0 @@ name: string;

@@ -6,31 +6,8 @@ "use strict";

});
exports.iosBuildOptions = exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
exports.default = void 0;
var _buildProject = require("./buildProject");
var _getDestinationSimulator = require("../../tools/getDestinationSimulator");
var _selectFromInteractiveMode = require("../../tools/selectFromInteractiveMode");
var _getProjectInfo = require("../../tools/getProjectInfo");
var _checkIfConfigurationExists = require("../../tools/checkIfConfigurationExists");
var _getConfigurationScheme = require("../../tools/getConfigurationScheme");
var _listIOSDevices = _interopRequireDefault(require("../../tools/listIOSDevices"));
var _buildOptions = require("./buildOptions");
var _getConfiguration = require("./getConfiguration");
var _getXcodeProjectAndDir = require("./getXcodeProjectAndDir");
var _pods = _interopRequireDefault(require("../../tools/pods"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -46,155 +23,27 @@ /**

async function buildIOS(_, ctx, args) {
if (!ctx.project.ios) {
throw new (_cliTools().CLIError)('iOS project folder not found. Are you sure this is a React Native project?');
}
const {
xcodeProject,
sourceDir
} = ctx.project.ios;
if (!xcodeProject) {
throw new (_cliTools().CLIError)(`Could not find Xcode project files in "${sourceDir}" folder`);
}
} = (0, _getXcodeProjectAndDir.getXcodeProjectAndDir)(ctx.project.ios);
// check if pods need to be installed
await (0, _pods.default)(ctx.root, ctx.dependencies, {
forceInstall: args.forcePods
});
process.chdir(sourceDir);
const projectInfo = (0, _getProjectInfo.getProjectInfo)();
if (args.mode) {
(0, _checkIfConfigurationExists.checkIfConfigurationExists)(projectInfo, args.mode);
}
const inferredSchemeName = _path().default.basename(xcodeProject.name, _path().default.extname(xcodeProject.name));
let scheme = args.scheme || inferredSchemeName;
let mode = args.mode;
if (args.interactive) {
const selection = await (0, _selectFromInteractiveMode.selectFromInteractiveMode)({
scheme,
mode
});
if (selection.scheme) {
scheme = selection.scheme;
}
if (selection.mode) {
mode = selection.mode;
}
}
const modifiedArgs = {
...args,
const {
scheme,
mode
};
args.mode = (0, _getConfigurationScheme.getConfigurationScheme)({
scheme: args.scheme,
mode: args.mode
}, sourceDir);
_cliTools().logger.info(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} "${_chalk().default.bold(xcodeProject.name)}"`);
// // No need to load all available devices
if (!args.device && !args.udid) {
if (!args.simulator) {
return (0, _buildProject.buildProject)(xcodeProject, undefined, scheme, modifiedArgs);
}
/**
* If provided simulator does not exist, try simulators in following order
* - iPhone 14
* - iPhone 13
* - iPhone 12
* - iPhone 11
*/
const fallbackSimulators = ['iPhone 14', 'iPhone 13', 'iPhone 12', 'iPhone 11'];
const selectedSimulator = (0, _getDestinationSimulator.getDestinationSimulator)(args, fallbackSimulators);
return (0, _buildProject.buildProject)(xcodeProject, selectedSimulator.udid, scheme, modifiedArgs);
}
if (args.device && args.udid) {
return _cliTools().logger.error('The `device` and `udid` options are mutually exclusive.');
}
const devices = await (0, _listIOSDevices.default)();
if (args.udid) {
const device = devices.find(d => d.udid === args.udid);
if (!device) {
return _cliTools().logger.error(`Could not find a device with udid: "${_chalk().default.bold(args.udid)}". ${printFoundDevices(devices)}`);
}
return (0, _buildProject.buildProject)(xcodeProject, device.udid, scheme, modifiedArgs);
} else {
const physicalDevices = devices.filter(d => d.type !== 'simulator');
const device = matchingDevice(physicalDevices, args.device);
if (device) {
return (0, _buildProject.buildProject)(xcodeProject, device.udid, scheme, modifiedArgs);
}
}
} = await (0, _getConfiguration.getConfiguration)(xcodeProject, sourceDir, args);
return (0, _buildProject.buildProject)(xcodeProject, undefined, mode, scheme, args);
}
function matchingDevice(devices, deviceName) {
if (deviceName === true) {
const firstIOSDevice = devices.find(d => d.type === 'device');
if (firstIOSDevice) {
_cliTools().logger.info(`Using first available device named "${_chalk().default.bold(firstIOSDevice.name)}" due to lack of name supplied.`);
return firstIOSDevice;
} else {
_cliTools().logger.error('No iOS devices connected.');
return undefined;
}
}
const deviceByName = devices.find(device => device.name === deviceName || formattedDeviceName(device) === deviceName);
if (!deviceByName) {
_cliTools().logger.error(`Could not find a device named: "${_chalk().default.bold(String(deviceName))}". ${printFoundDevices(devices)}`);
}
return deviceByName;
}
function formattedDeviceName(simulator) {
return simulator.version ? `${simulator.name} (${simulator.version})` : simulator.name;
}
function printFoundDevices(devices) {
return ['Available devices:', ...devices.map(device => ` - ${device.name} (${device.udid})`)].join('\n');
}
const iosBuildOptions = [{
name: '--simulator <string>',
description: 'Explicitly set simulator to use. Optionally include iOS version between ' + 'parenthesis at the end to match an exact version: "iPhone 6 (10.0)"'
}, {
name: '--mode <string>',
description: 'Explicitly set the scheme configuration to use. This option is case sensitive.'
}, {
name: '--scheme <string>',
description: 'Explicitly set Xcode scheme to use'
}, {
name: '--device [string]',
description: 'Explicitly set device to use by name. The value is not required if you have a single device connected.'
}, {
name: '--destination <string>',
description: 'Explicitly extend destination e.g. "arch=x86_64"'
}, {
name: '--udid <string>',
description: 'Explicitly set device to use by udid'
}, {
name: '--verbose',
description: 'Do not use xcbeautify or xcpretty even if installed'
}, {
name: '--xcconfig [string]',
description: 'Explicitly set xcconfig to use'
}, {
name: '--buildFolder <string>',
description: 'Location for iOS build artifacts. Corresponds to Xcode\'s "-derivedDataPath".'
}, {
name: '--extra-params <string>',
description: 'Custom params that will be passed to xcodebuild command.',
parse: val => val.split(' ')
}, {
name: '--target <string>',
description: 'Explicitly set Xcode target to use.'
}];
exports.iosBuildOptions = iosBuildOptions;
var _default = {
name: 'build-ios',
description: 'builds your app on iOS simulator',
description: 'builds your app for iOS platform',
func: buildIOS,
examples: [{
desc: 'Build the app for the IOS simulator',
cmd: 'npx react-native build-ios'
}, {
desc: 'Build the app for all IOS devices',
desc: 'Build the app for all iOS devices in Release mode',
cmd: 'npx react-native build-ios --mode "Release"'
}, {
desc: 'Build the app for a specific IOS device',
cmd: 'npx react-native build-ios --simulator "IPhone 11"'
}],
options: [...iosBuildOptions, {
name: '--interactive',
description: 'Explicitly select which scheme and configuration to use before running a build'
}]
options: _buildOptions.buildOptions
};

@@ -201,0 +50,0 @@ exports.default = _default;

@@ -41,3 +41,3 @@ declare const _default: ({

description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("./buildIOS").FlagsT) => Promise<string | void>;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("./buildIOS/buildOptions").BuildFlags) => Promise<string>;
examples: {

@@ -44,0 +44,0 @@ desc: string;

@@ -9,7 +9,5 @@ /**

import { Config } from '@react-native-community/cli-types';
import { BuildFlags } from '../buildIOS/buildProject';
import { BuildFlags } from '../buildIOS/buildOptions';
export interface FlagsT extends BuildFlags {
simulator?: string;
scheme?: string;
projectPath: string;
device?: string | true;

@@ -16,0 +14,0 @@ udid?: string;

@@ -44,10 +44,9 @@ "use strict";

var _buildProject = require("../buildIOS/buildProject");
var _buildIOS = require("../buildIOS");
var _buildOptions = require("../buildIOS/buildOptions");
var _getConfiguration = require("../buildIOS/getConfiguration");
var _listIOSDevices = _interopRequireDefault(require("../../tools/listIOSDevices"));
var _checkIfConfigurationExists = require("../../tools/checkIfConfigurationExists");
var _getProjectInfo = require("../../tools/getProjectInfo");
var _getConfigurationScheme = require("../../tools/getConfigurationScheme");
var _selectFromInteractiveMode = require("../../tools/selectFromInteractiveMode");
var _prompts = require("../../tools/prompts");
var _getSimulators = _interopRequireDefault(require("../../tools/getSimulators"));
var _getXcodeProjectAndDir = require("../buildIOS/getXcodeProjectAndDir");
var _pods = _interopRequireDefault(require("../../tools/pods"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -68,2 +67,7 @@ /**

} = args;
// check if pods need to be installed
await (0, _pods.default)(ctx.root, ctx.dependencies, {
forceInstall: args.forcePods
});
const packagerStatus = await (0, _cliTools().isPackagerRunning)(port);

@@ -88,12 +92,6 @@ if (typeof packagerStatus === 'object' && packagerStatus.status === 'running') {

}
if (!ctx.project.ios) {
throw new (_cliTools().CLIError)('iOS project folder not found. Are you sure this is a React Native project?');
}
const {
xcodeProject,
sourceDir
} = ctx.project.ios;
if (!xcodeProject) {
throw new (_cliTools().CLIError)(`Could not find Xcode project files in "${sourceDir}" folder`);
}
} = (0, _getXcodeProjectAndDir.getXcodeProjectAndDir)(ctx.project.ios);
process.chdir(sourceDir);

@@ -106,35 +104,10 @@ if (args.binaryPath) {

}
const projectInfo = (0, _getProjectInfo.getProjectInfo)();
if (args.mode) {
(0, _checkIfConfigurationExists.checkIfConfigurationExists)(projectInfo, args.mode);
}
const inferredSchemeName = _path().default.basename(xcodeProject.name, _path().default.extname(xcodeProject.name));
let scheme = args.scheme || inferredSchemeName;
let mode = args.mode;
if (args.interactive) {
const selection = await (0, _selectFromInteractiveMode.selectFromInteractiveMode)({
scheme,
mode
});
if (selection.scheme) {
scheme = selection.scheme;
}
if (selection.mode) {
mode = selection.mode;
}
}
const modifiedArgs = {
...args,
scheme,
mode
};
modifiedArgs.mode = (0, _getConfigurationScheme.getConfigurationScheme)({
scheme: modifiedArgs.scheme,
mode: modifiedArgs.mode
}, sourceDir);
_cliTools().logger.info(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} "${_chalk().default.bold(xcodeProject.name)}"`);
const {
mode,
scheme
} = await (0, _getConfiguration.getConfiguration)(xcodeProject, sourceDir, args);
const availableDevices = await (0, _listIOSDevices.default)();
if (modifiedArgs.listDevices || modifiedArgs.interactive) {
if (modifiedArgs.device || modifiedArgs.udid) {
_cliTools().logger.warn(`Both ${modifiedArgs.device ? 'device' : 'udid'} and "list-devices" parameters were passed to "run" command. We will list available devices and let you choose from one.`);
if (args.listDevices || args.interactive) {
if (args.device || args.udid) {
_cliTools().logger.warn(`Both ${args.device ? 'device' : 'udid'} and "list-devices" parameters were passed to "run" command. We will list available devices and let you choose from one.`);
}

@@ -146,8 +119,8 @@ const selectedDevice = await (0, _prompts.promptForDeviceSelection)(availableDevices);

if (selectedDevice.type === 'simulator') {
return runOnSimulator(xcodeProject, scheme, modifiedArgs, selectedDevice);
return runOnSimulator(xcodeProject, mode, scheme, args, selectedDevice);
} else {
return runOnDevice(selectedDevice, scheme, xcodeProject, modifiedArgs);
return runOnDevice(selectedDevice, mode, scheme, xcodeProject, args);
}
}
if (!modifiedArgs.device && !modifiedArgs.udid && !modifiedArgs.simulator) {
if (!args.device && !args.udid && !args.simulator) {
const bootedDevices = availableDevices.filter(({

@@ -164,3 +137,3 @@ type,

_cliTools().logger.info('No booted devices or simulators found. Launching first available simulator...');
return runOnSimulator(xcodeProject, scheme, modifiedArgs);
return runOnSimulator(xcodeProject, mode, scheme, args);
}

@@ -170,38 +143,38 @@ _cliTools().logger.info(`Found booted ${booted.map(({

}) => name).join(', ')}`);
return runOnBootedDevicesSimulators(scheme, xcodeProject, modifiedArgs, bootedDevices, bootedSimulators);
return runOnBootedDevicesSimulators(mode, scheme, xcodeProject, args, bootedDevices, bootedSimulators);
}
if (modifiedArgs.device && modifiedArgs.udid) {
if (args.device && args.udid) {
return _cliTools().logger.error('The `device` and `udid` options are mutually exclusive.');
}
if (modifiedArgs.udid) {
const device = availableDevices.find(d => d.udid === modifiedArgs.udid);
if (args.udid) {
const device = availableDevices.find(d => d.udid === args.udid);
if (!device) {
return _cliTools().logger.error(`Could not find a device with udid: "${_chalk().default.bold(modifiedArgs.udid)}". ${printFoundDevices(availableDevices)}`);
return _cliTools().logger.error(`Could not find a device with udid: "${_chalk().default.bold(args.udid)}". ${printFoundDevices(availableDevices)}`);
}
if (device.type === 'simulator') {
return runOnSimulator(xcodeProject, scheme, modifiedArgs);
return runOnSimulator(xcodeProject, mode, scheme, args);
} else {
return runOnDevice(device, scheme, xcodeProject, modifiedArgs);
return runOnDevice(device, mode, scheme, xcodeProject, args);
}
} else if (modifiedArgs.device) {
} else if (args.device) {
const physicalDevices = availableDevices.filter(({
type
}) => type !== 'simulator');
const device = matchingDevice(physicalDevices, modifiedArgs.device);
const device = matchingDevice(physicalDevices, args.device);
if (device) {
return runOnDevice(device, scheme, xcodeProject, modifiedArgs);
return runOnDevice(device, mode, scheme, xcodeProject, args);
}
} else {
runOnSimulator(xcodeProject, scheme, modifiedArgs);
runOnSimulator(xcodeProject, mode, scheme, args);
}
}
async function runOnBootedDevicesSimulators(scheme, xcodeProject, args, devices, simulators) {
async function runOnBootedDevicesSimulators(mode, scheme, xcodeProject, args, devices, simulators) {
for (const device of devices) {
await runOnDevice(device, scheme, xcodeProject, args);
await runOnDevice(device, mode, scheme, xcodeProject, args);
}
for (const simulator of simulators) {
await runOnSimulator(xcodeProject, scheme, args, simulator);
await runOnSimulator(xcodeProject, mode, scheme, args, simulator);
}
}
async function runOnSimulator(xcodeProject, scheme, args, simulator) {
async function runOnSimulator(xcodeProject, mode, scheme, args, simulator) {
/**

@@ -246,4 +219,4 @@ * If provided simulator does not exist, try simulators in following order

if (!args.binaryPath) {
buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedSimulator.udid, scheme, args);
appPath = await getBuildPath(xcodeProject, args.mode, buildOutput, scheme, args.target);
buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedSimulator.udid, mode, scheme, args);
appPath = await getBuildPath(xcodeProject, mode, buildOutput, scheme, args.target);
} else {

@@ -267,3 +240,3 @@ appPath = args.binaryPath;

}
async function runOnDevice(selectedDevice, scheme, xcodeProject, args) {
async function runOnDevice(selectedDevice, mode, scheme, xcodeProject, args) {
if (args.binaryPath && selectedDevice.type === 'catalyst') {

@@ -279,4 +252,4 @@ throw new (_cliTools().CLIError)('binary-path was specified for catalyst device, which is not supported.');

if (selectedDevice.type === 'catalyst') {
const buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedDevice.udid, scheme, args);
const appPath = await getBuildPath(xcodeProject, args.mode, buildOutput, scheme, args.target, true);
const buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedDevice.udid, mode, scheme, args);
const appPath = await getBuildPath(xcodeProject, mode, buildOutput, scheme, args.target, true);
const appProcess = _child_process().default.spawn(`${appPath}/${scheme}`, [], {

@@ -290,4 +263,4 @@ detached: true,

if (!args.binaryPath) {
buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedDevice.udid, scheme, args);
appPath = await getBuildPath(xcodeProject, args.mode, buildOutput, scheme, args.target);
buildOutput = await (0, _buildProject.buildProject)(xcodeProject, selectedDevice.udid, mode, scheme, args);
appPath = await getBuildPath(xcodeProject, mode, buildOutput, scheme, args.target);
} else {

@@ -399,3 +372,3 @@ appPath = args.binaryPath;

}],
options: [..._buildIOS.iosBuildOptions, {
options: [..._buildOptions.buildOptions, {
name: '--no-packager',

@@ -417,5 +390,2 @@ description: 'Do not launch packager while running the app'

description: 'List all available iOS devices and simulators and let you choose one to run the app. '
}, {
name: '--interactive',
description: 'Explicitly select which scheme and configuration to use before running a build and select device to run the application.'
}]

@@ -422,0 +392,0 @@ };

@@ -9,2 +9,9 @@ "use strict";

exports.projectConfig = projectConfig;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _path() {

@@ -28,2 +35,9 @@ const data = _interopRequireDefault(require("path"));

var _findAllPodfilePaths = _interopRequireDefault(require("./findAllPodfilePaths"));
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -72,4 +86,14 @@ /**

}
let version = 'unresolved';
try {
const packageJson = require(_path().default.join(folder, 'package.json'));
if (packageJson.version) {
version = packageJson.version;
}
} catch {
throw new (_cliTools().CLIError)(`Failed to locate package.json file from ${_chalk().default.underline(folder)}. This is most likely issue with your node_modules folder being corrupted. Please force install dependencies and try again`);
}
return {
podspecPath,
version,
configurations: userConfig.configurations || [],

@@ -76,0 +100,0 @@ scriptPhases: userConfig.scriptPhases || []

@@ -6,2 +6,3 @@ /**

export { projectConfig, dependencyConfig, findPodfilePaths } from './config';
export { default as installPods } from './tools/installPods';
//# sourceMappingURL=index.d.ts.map

@@ -24,2 +24,8 @@ "use strict";

});
Object.defineProperty(exports, "installPods", {
enumerable: true,
get: function () {
return _installPods.default;
}
});
Object.defineProperty(exports, "projectConfig", {

@@ -33,4 +39,5 @@ enumerable: true,

var _config = require("./config");
var _installPods = _interopRequireDefault(require("./tools/installPods"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=index.ts.map

@@ -1,2 +0,3 @@

export declare function getBuildConfigurationFromXcScheme(scheme: string, configuration: string, sourceDir: string): any;
import { IosProjectInfo } from '../types';
export declare function getBuildConfigurationFromXcScheme(scheme: string, configuration: string, sourceDir: string, projectInfo: IosProjectInfo): string;
//# sourceMappingURL=getBuildConfigurationFromXcScheme.d.ts.map

@@ -14,2 +14,9 @@ "use strict";

}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _fastXmlParser() {

@@ -40,3 +47,3 @@ const data = require("fast-xml-parser");

});
function getBuildConfigurationFromXcScheme(scheme, configuration, sourceDir) {
function getBuildConfigurationFromXcScheme(scheme, configuration, sourceDir, projectInfo) {
try {

@@ -54,3 +61,3 @@ const xcProject = _fs().default.readdirSync(sourceDir).find(dir => dir.includes('.xcodeproj'));

} catch {
throw new (_cliTools().CLIError)(`Could not find scheme ${scheme}. Please make sure the schema you want to run exists.`);
throw new (_cliTools().CLIError)(`Could not find scheme ${scheme}. Please make sure the schema you want to run exists. Available schemas are: ${projectInfo.schemes.map(name => _chalk().default.bold(name)).join(', ')}'`);
}

@@ -57,0 +64,0 @@ return configuration;

@@ -0,7 +1,12 @@

import { IosProjectInfo } from '../types';
interface Args {
scheme: string;
mode: string;
scheme?: string;
mode?: string;
projectInfo: IosProjectInfo;
}
export declare function selectFromInteractiveMode({ scheme, mode, }: Args): Promise<Args>;
export declare function selectFromInteractiveMode({ scheme, mode, projectInfo, }: Args): Promise<{
scheme?: string;
mode?: string;
}>;
export {};
//# sourceMappingURL=selectFromInteractiveMode.d.ts.map

@@ -21,3 +21,2 @@ "use strict";

}
var _getProjectInfo = require("./getProjectInfo");
var _prompts = require("./prompts");

@@ -27,14 +26,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

scheme,
mode
mode,
projectInfo
}) {
let newScheme = scheme;
let newMode = mode;
const project = (0, _getProjectInfo.getProjectInfo)();
if (project.schemes.length > 1) {
newScheme = await (0, _prompts.promptForSchemeSelection)(project);
if (projectInfo.schemes.length > 1) {
newScheme = await (0, _prompts.promptForSchemeSelection)(projectInfo);
} else {
_cliTools().logger.info(`Automatically selected ${_chalk().default.bold(scheme)} scheme.`);
}
if (project.configurations.length > 1) {
newMode = await (0, _prompts.promptForConfigurationSelection)(project);
if (projectInfo.configurations.length > 1) {
newMode = await (0, _prompts.promptForConfigurationSelection)(projectInfo);
} else {

@@ -41,0 +40,0 @@ _cliTools().logger.info(`Automatically selected ${_chalk().default.bold(mode)} configuration.`);

{
"name": "@react-native-community/cli-platform-ios",
"version": "12.0.0-alpha.13",
"version": "12.0.0-alpha.14",
"license": "MIT",

@@ -10,3 +10,3 @@ "main": "build/index.js",

"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.13",
"@react-native-community/cli-tools": "12.0.0-alpha.14",
"chalk": "^4.1.2",

@@ -19,3 +19,3 @@ "execa": "^5.0.0",

"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.13",
"@react-native-community/cli-types": "12.0.0-alpha.14",
"@types/glob": "^7.1.1",

@@ -37,3 +37,3 @@ "@types/lodash": "^4.14.149",

},
"gitHead": "fc87a75adfa86296da54915525eb0c809f25453e"
"gitHead": "e327e5972979f80dff6c2a4719d41df277446056"
}

@@ -107,2 +107,15 @@ # @react-native-community/cli-platform-ios

#### `--binary-path <path>`
Installs passed binary instead of building a fresh one.
#### `--list-devices`
> default: false
List all available iOS devices and simulators and let you choose one to run the app.
#### `--force-pods`,
Force running `pod install` before running an app
### `build-ios`

@@ -116,27 +129,6 @@

Builds IOS app.
Builds iOS app.
#### Options
#### `--simulator <simulator_name>`
> default: iPhone 14
Explicitly set the simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version, e.g. `"iPhone 6 (10.0)"`.
Notes: If selected simulator does not exist, cli will try to run fallback simulators in following order:
- `iPhone 14`
- `iPhone 13`
- `iPhone 12`
- `iPhone 11`
Notes: `simulator_name` must be a valid iOS simulator name. If in doubt, open your AwesomeApp/ios/AwesomeApp.xcodeproj folder on XCode and unroll the dropdown menu containing the simulator list. The dropdown menu is situated on the right hand side of the play button (top left corner).
Example: this will launch your project directly onto the iPhone 14 simulator:
```sh
npx react-native build-ios --simulator "iPhone 14"
```
#### `--mode <string>`

@@ -160,14 +152,2 @@

#### `--device [string]`
Explicitly set device to use by name. The value is not required if you have a single device connected.
#### `--udid <string>`
Explicitly set device to use by udid.
#### `--no-packager`
Do not launch packager while building.
#### `--verbose`

@@ -177,8 +157,2 @@

#### `--port <number>`
Runs packager on specified port.
Default: `process.env.RCT_METRO_PORT || 8081`
#### `--xcconfig <string>`

@@ -192,12 +166,2 @@

#### `--binary-path <path>`
Installs passed binary instead of building a fresh one.
#### `--list-devices`
> default: false
List all available iOS devices and simulators and let you choose one to run the app.
#### `--extra-params <string>`

@@ -212,4 +176,5 @@

### log-ios
#### `--force-pods`,
Force running `pod install` before building an app
### `log-ios`

@@ -216,0 +181,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc