🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

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

Package Overview
Dependencies
Maintainers
35
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/cli-platform-apple - npm Package Compare versions

Comparing version
20.0.2
to
20.1.0
+1
-0
build/commands/buildCommand/buildOptions.d.ts

@@ -14,2 +14,3 @@ import { BuilderCommand } from '../../types';

onlyPods?: boolean;
device?: string | true;
};

@@ -16,0 +17,0 @@ export declare const getBuildOptions: ({ platformName }: BuilderCommand) => (false | {

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"buildOptions.d.ts","sourceRoot":"","sources":["../../../src/commands/buildCommand/buildOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAoB,cAAc;;;;;;;iBAiC3C,MAAM;IA0BxB,CAAC"}
{"version":3,"file":"buildOptions.d.ts","sourceRoot":"","sources":["../../../src/commands/buildCommand/buildOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAoB,cAAc;;;;;;;iBAiC3C,MAAM;IA0BxB,CAAC"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/buildOptions.js.map
//# sourceMappingURL=buildOptions.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getBuildOptions","platformName","readableName","getPlatformInfo","isMac","name","description","parse","val","split"],"sources":["../../../src/commands/buildCommand/buildOptions.ts"],"sourcesContent":["import {BuilderCommand} from '../../types';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\n\nexport type BuildFlags = {\n mode?: string;\n target?: string;\n verbose?: boolean;\n scheme?: string;\n xcconfig?: string;\n buildFolder?: string;\n interactive?: boolean;\n destination?: string;\n extraParams?: string[];\n forcePods?: boolean;\n onlyPods?: boolean;\n};\n\nexport const getBuildOptions = ({platformName}: BuilderCommand) => {\n const {readableName} = getPlatformInfo(platformName);\n const isMac = platformName === 'macos';\n\n return [\n {\n name: '--mode <string>',\n description:\n 'Explicitly set the scheme configuration to use. This option is case sensitive.',\n },\n {\n name: '--scheme <string>',\n description: 'Explicitly set Xcode scheme to use',\n },\n {\n name: '--destination <string>',\n description: 'Explicitly extend destination e.g. \"arch=x86_64\"',\n },\n {\n name: '--verbose',\n description: 'Do not use xcbeautify or xcpretty even if installed',\n },\n {\n name: '--xcconfig [string]',\n description: 'Explicitly set xcconfig to use',\n },\n {\n name: '--buildFolder <string>',\n description: `Location for ${readableName} build artifacts. Corresponds to Xcode's \"-derivedDataPath\".`,\n },\n {\n name: '--extra-params <string>',\n description: 'Custom params that will be passed to xcodebuild command.',\n parse: (val: string) => val.split(' '),\n },\n {\n name: '--target <string>',\n description: 'Explicitly set Xcode target to use.',\n },\n {\n name: '-i --interactive',\n description:\n 'Explicitly select which scheme and configuration to use before running a build',\n },\n {\n name: '--force-pods',\n description: 'Force CocoaPods installation',\n },\n {\n name: '--only-pods',\n description: 'Only install Cocoapods, do not build the app',\n },\n !isMac && {\n name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices\n description:\n 'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' +\n 'the app will run on the first available physical device.',\n },\n ];\n};\n"],"mappings":";;;;;;AACA;AAgBO,MAAMA,eAAe,GAAG,CAAC;EAACC;AAA4B,CAAC,KAAK;EACjE,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,gCAAe,EAACF,YAAY,CAAC;EACpD,MAAMG,KAAK,GAAGH,YAAY,KAAK,OAAO;EAEtC,OAAO,CACL;IACEI,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,mBAAmB;IACzBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,qBAAqB;IAC3BC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAG,gBAAeJ,YAAa;EAC5C,CAAC,EACD;IACEG,IAAI,EAAE,yBAAyB;IAC/BC,WAAW,EAAE,0DAA0D;IACvEC,KAAK,EAAGC,GAAW,IAAKA,GAAG,CAACC,KAAK,CAAC,GAAG;EACvC,CAAC,EACD;IACEJ,IAAI,EAAE,mBAAmB;IACzBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,kBAAkB;IACxBC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,cAAc;IACpBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,aAAa;IACnBC,WAAW,EAAE;EACf,CAAC,EACD,CAACF,KAAK,IAAI;IACRC,IAAI,EAAE,mBAAmB;IAAE;IAC3BC,WAAW,EACT,yGAAyG,GACzG;EACJ,CAAC,CACF;AACH,CAAC;AAAC"}
{"version":3,"file":"buildOptions.js","names":["getBuildOptions","platformName","readableName","getPlatformInfo","isMac","name","description","parse","val","split"],"sources":["../../../src/commands/buildCommand/buildOptions.ts"],"sourcesContent":["import {BuilderCommand} from '../../types';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\n\nexport type BuildFlags = {\n mode?: string;\n target?: string;\n verbose?: boolean;\n scheme?: string;\n xcconfig?: string;\n buildFolder?: string;\n interactive?: boolean;\n destination?: string;\n extraParams?: string[];\n forcePods?: boolean;\n onlyPods?: boolean;\n device?: string | true;\n};\n\nexport const getBuildOptions = ({platformName}: BuilderCommand) => {\n const {readableName} = getPlatformInfo(platformName);\n const isMac = platformName === 'macos';\n\n return [\n {\n name: '--mode <string>',\n description:\n 'Explicitly set the scheme configuration to use. This option is case sensitive.',\n },\n {\n name: '--scheme <string>',\n description: 'Explicitly set Xcode scheme to use',\n },\n {\n name: '--destination <string>',\n description: 'Explicitly extend destination e.g. \"arch=x86_64\"',\n },\n {\n name: '--verbose',\n description: 'Do not use xcbeautify or xcpretty even if installed',\n },\n {\n name: '--xcconfig [string]',\n description: 'Explicitly set xcconfig to use',\n },\n {\n name: '--buildFolder <string>',\n description: `Location for ${readableName} build artifacts. Corresponds to Xcode's \"-derivedDataPath\".`,\n },\n {\n name: '--extra-params <string>',\n description: 'Custom params that will be passed to xcodebuild command.',\n parse: (val: string) => val.split(' '),\n },\n {\n name: '--target <string>',\n description: 'Explicitly set Xcode target to use.',\n },\n {\n name: '-i --interactive',\n description:\n 'Explicitly select which scheme and configuration to use before running a build',\n },\n {\n name: '--force-pods',\n description: 'Force CocoaPods installation',\n },\n {\n name: '--only-pods',\n description: 'Only install Cocoapods, do not build the app',\n },\n !isMac && {\n name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices\n description:\n 'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' +\n 'the app will run on the first available physical device.',\n },\n ];\n};\n"],"mappings":";;;;;;AACA;AAiBO,MAAMA,eAAe,GAAG,CAAC;EAACC;AAA4B,CAAC,KAAK;EACjE,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,gCAAe,EAACF,YAAY,CAAC;EACpD,MAAMG,KAAK,GAAGH,YAAY,KAAK,OAAO;EAEtC,OAAO,CACL;IACEI,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,mBAAmB;IACzBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,qBAAqB;IAC3BC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAG,gBAAeJ,YAAa;EAC5C,CAAC,EACD;IACEG,IAAI,EAAE,yBAAyB;IAC/BC,WAAW,EAAE,0DAA0D;IACvEC,KAAK,EAAGC,GAAW,IAAKA,GAAG,CAACC,KAAK,CAAC,GAAG;EACvC,CAAC,EACD;IACEJ,IAAI,EAAE,mBAAmB;IACzBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,kBAAkB;IACxBC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,cAAc;IACpBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,aAAa;IACnBC,WAAW,EAAE;EACf,CAAC,EACD,CAACF,KAAK,IAAI;IACRC,IAAI,EAAE,mBAAmB;IAAE;IAC3BC,WAAW,EACT,yGAAyG,GACzG;EACJ,CAAC,CACF;AACH,CAAC;AAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"buildProject.d.ts","sourceRoot":"","sources":["../../../src/commands/buildCommand/buildProject.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAOjE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAiB1C,wBAAgB,YAAY,CAC1B,YAAY,EAAE,cAAc,EAC5B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,MAAM,CAAC,CA0GjB"}
{"version":3,"file":"buildProject.d.ts","sourceRoot":"","sources":["../../../src/commands/buildCommand/buildProject.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAOjE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAiB1C,wBAAgB,YAAY,CAC1B,YAAY,EAAE,cAAc,EAC5B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,MAAM,CAAC,CAqHjB"}

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

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

@@ -57,3 +57,17 @@ };

}
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=${simulatorDest}` : `generic/platform=${platform}`) + (args.destination ? ',' + args.destination : '')];
const isDevice = args.device;
let destination = '';
if (udid) {
destination = `id=${udid}`;
} else if (isDevice) {
destination = 'generic/platform=iOS';
} else if (mode === 'Debug') {
destination = `generic/platform=${simulatorDest}`;
} else {
destination = `generic/platform=${platform}`;
}
if (args.destination) {
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', destination];
if (args.extraParams) {

@@ -63,3 +77,3 @@ xcodebuildArgs.push(...args.extraParams);

const loader = (0, _cliTools().getLoader)();
_cliTools().logger.info(`Building ${_chalk().default.dim(`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`)}`);
_cliTools().logger.info(`Building ${_picocolors().default.dim(`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`)}`);
let xcodebuildOutputFormatter;

@@ -153,2 +167,2 @@ if (!args.verbose) {

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/buildProject.js.map
//# sourceMappingURL=buildProject.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["prettifyXcodebuildMessages","output","errorRegex","errors","Set","match","exec","add","trim","buildProject","xcodeProject","platform","udid","mode","scheme","args","Promise","resolve","reject","simulatorDest","simulatorDestinationMap","CLIError","Object","values","supportedPlatforms","join","xcodebuildArgs","isWorkspace","name","xcconfig","buildFolder","destination","extraParams","push","loader","getLoader","logger","info","chalk","dim","xcodebuildOutputFormatter","verbose","xcbeautifyAvailable","child_process","spawn","stdio","process","stdout","stderr","xcprettyAvailable","buildProcess","getProcessOptions","buildOutput","on","data","stringData","toString","stdin","write","isVerbose","debug","start","repeat","length","code","end","stop","printRunDoctorTip","Array","from","forEach","error","success","execSync","packager","terminal","port","String","env","RCT_TERMINAL","RCT_METRO_PORT"],"sources":["../../../src/commands/buildCommand/buildProject.ts"],"sourcesContent":["import child_process, {\n ChildProcess,\n SpawnOptionsWithoutStdio,\n} from 'child_process';\nimport chalk from 'chalk';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {\n logger,\n CLIError,\n printRunDoctorTip,\n getLoader,\n} from '@react-native-community/cli-tools';\nimport type {BuildFlags} from './buildOptions';\nimport {simulatorDestinationMap} from './simulatorDestinationMap';\nimport {supportedPlatforms} from '@react-native-community/cli-config-apple';\nimport {ApplePlatform} from '../../types';\n\nfunction prettifyXcodebuildMessages(output: string): Set<string> {\n const errorRegex = /error\\b[^\\S\\r\\n]*[:\\-\\s]*([^\\r\\n]*)/gim;\n const errors = new Set<string>();\n\n let match;\n while ((match = errorRegex.exec(output)) !== null) {\n if (match[1]) {\n // match[1] contains the captured group that excludes any leading colons or spaces\n errors.add(match[1].trim());\n }\n }\n\n return errors;\n}\n\nexport function buildProject(\n xcodeProject: IOSProjectInfo,\n platform: ApplePlatform,\n udid: string | undefined,\n mode: string,\n scheme: string,\n args: BuildFlags,\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const simulatorDest = simulatorDestinationMap?.[platform];\n\n if (!simulatorDest) {\n reject(\n new CLIError(\n `Unknown platform: ${platform}. Please, use one of: ${Object.values(\n supportedPlatforms,\n ).join(', ')}.`,\n ),\n );\n return;\n }\n\n const xcodebuildArgs = [\n xcodeProject.isWorkspace ? '-workspace' : '-project',\n xcodeProject.name,\n ...(args.xcconfig ? ['-xcconfig', args.xcconfig] : []),\n ...(args.buildFolder ? ['-derivedDataPath', args.buildFolder] : []),\n '-configuration',\n mode,\n '-scheme',\n scheme,\n '-destination',\n (udid\n ? `id=${udid}`\n : mode === 'Debug'\n ? `generic/platform=${simulatorDest}`\n : `generic/platform=${platform}`) +\n (args.destination ? ',' + args.destination : ''),\n ];\n\n if (args.extraParams) {\n xcodebuildArgs.push(...args.extraParams);\n }\n\n const loader = getLoader();\n logger.info(\n `Building ${chalk.dim(\n `(using \"xcodebuild ${xcodebuildArgs.join(' ')}\")`,\n )}`,\n );\n let xcodebuildOutputFormatter: ChildProcess | any;\n if (!args.verbose) {\n if (xcbeautifyAvailable()) {\n xcodebuildOutputFormatter = child_process.spawn('xcbeautify', [], {\n stdio: ['pipe', process.stdout, process.stderr],\n });\n } else if (xcprettyAvailable()) {\n xcodebuildOutputFormatter = child_process.spawn('xcpretty', [], {\n stdio: ['pipe', process.stdout, process.stderr],\n });\n }\n }\n\n const buildProcess = child_process.spawn(\n 'xcodebuild',\n xcodebuildArgs,\n getProcessOptions(args),\n );\n let buildOutput = '';\n buildProcess.stdout.on('data', (data: Buffer) => {\n const stringData = data.toString();\n buildOutput += stringData;\n if (xcodebuildOutputFormatter) {\n xcodebuildOutputFormatter.stdin.write(data);\n } else {\n if (logger.isVerbose()) {\n logger.debug(stringData);\n } else {\n loader.start(\n `Building the app${'.'.repeat(buildOutput.length % 10)}`,\n );\n }\n }\n });\n buildProcess.on('close', (code: number) => {\n if (xcodebuildOutputFormatter) {\n xcodebuildOutputFormatter.stdin.end();\n } else {\n loader.stop();\n }\n if (code !== 0) {\n printRunDoctorTip();\n if (!xcodebuildOutputFormatter) {\n Array.from(prettifyXcodebuildMessages(buildOutput)).forEach((error) =>\n logger.error(error),\n );\n }\n\n reject(\n new CLIError(`\n Failed to build ${platform} project.\n\n \"xcodebuild\" exited with error code '${code}'. To debug build\n logs further, consider building your app with Xcode.app, by opening\n '${xcodeProject.name}'.`),\n );\n return;\n }\n\n logger.success('Successfully built the app');\n resolve(buildOutput);\n });\n });\n}\n\nfunction xcbeautifyAvailable() {\n try {\n child_process.execSync('xcbeautify --version', {\n stdio: [0, 'pipe', 'ignore'],\n });\n } catch (error) {\n return false;\n }\n return true;\n}\n\nfunction xcprettyAvailable() {\n try {\n child_process.execSync('xcpretty --version', {\n stdio: [0, 'pipe', 'ignore'],\n });\n } catch (error) {\n return false;\n }\n return true;\n}\n\nfunction getProcessOptions<T extends BuildFlags>(\n args: T,\n): SpawnOptionsWithoutStdio {\n if (\n 'packager' in args &&\n typeof args.packager === 'boolean' &&\n args.packager\n ) {\n const terminal =\n 'terminal' in args && typeof args.terminal === 'string'\n ? args.terminal\n : '';\n\n const port =\n 'port' in args && typeof args.port === 'number' ? String(args.port) : '';\n\n return {\n env: {\n ...process.env,\n RCT_TERMINAL: terminal,\n RCT_METRO_PORT: port,\n },\n };\n }\n\n return {\n env: process.env,\n };\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4E;AAG5E,SAASA,0BAA0B,CAACC,MAAc,EAAe;EAC/D,MAAMC,UAAU,GAAG,wCAAwC;EAC3D,MAAMC,MAAM,GAAG,IAAIC,GAAG,EAAU;EAEhC,IAAIC,KAAK;EACT,OAAO,CAACA,KAAK,GAAGH,UAAU,CAACI,IAAI,CAACL,MAAM,CAAC,MAAM,IAAI,EAAE;IACjD,IAAII,KAAK,CAAC,CAAC,CAAC,EAAE;MACZ;MACAF,MAAM,CAACI,GAAG,CAACF,KAAK,CAAC,CAAC,CAAC,CAACG,IAAI,EAAE,CA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,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb;AAEA,SAASpB,iBAAiB,CACxBpC,IAAO,EACmB;EAC1B,IACE,UAAU,IAAIA,IAAI,IAClB,OAAOA,IAAI,CAAC2D,QAAQ,KAAK,SAAS,IAClC3D,IAAI,CAAC2D,QAAQ,EACb;IACA,MAAMC,QAAQ,GACZ,UAAU,IAAI5D,IAAI,IAAI,OAAOA,IAAI,CAAC4D,QAAQ,KAAK,QAAQ,GACnD5D,IAAI,CAAC4D,QAAQ,GACb,EAAE;IAER,MAAMC,IAAI,GACR,MAAM,IAAI7D,IAAI,IAAI,OAAOA,IAAI,CAAC6D,IAAI,KAAK,QAAQ,GAAGC,MAAM,CAAC9D,IAAI,CAAC6D,IAAI,CAAC,GAAG,EAAE;IAE1E,OAAO;MACLE,GAAG,EAAE;QACH,GAAGhC,OAAO,CAACgC,GAAG;QACdC,YAAY,EAAEJ,QAAQ;QACtBK,cAAc,EAAEJ;MAClB;IACF,CAAC;EACH;EAEA,OAAO;IACLE,GAAG,EAAEhC,OAAO,CAACgC;EACf,CAAC;AACH"}
{"version":3,"file":"buildProject.js","names":["prettifyXcodebuildMessages","output","errorRegex","errors","Set","match","exec","add","trim","buildProject","xcodeProject","platform","udid","mode","scheme","args","Promise","resolve","reject","simulatorDest","simulatorDestinationMap","CLIError","Object","values","supportedPlatforms","join","isDevice","device","destination","xcodebuildArgs","isWorkspace","name","xcconfig","buildFolder","extraParams","push","loader","getLoader","logger","info","pico","dim","xcodebuildOutputFormatter","verbose","xcbeautifyAvailable","child_process","spawn","stdio","process","stdout","stderr","xcprettyAvailable","buildProcess","getProcessOptions","buildOutput","on","data","stringData","toString","stdin","write","isVerbose","debug","start","repeat","length","code","end","stop","printRunDoctorTip","Array","from","forEach","error","success","execSync","packager","terminal","port","String","env","RCT_TERMINAL","RCT_METRO_PORT"],"sources":["../../../src/commands/buildCommand/buildProject.ts"],"sourcesContent":["import child_process, {\n ChildProcess,\n SpawnOptionsWithoutStdio,\n} from 'child_process';\nimport pico from 'picocolors';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {\n logger,\n CLIError,\n printRunDoctorTip,\n getLoader,\n} from '@react-native-community/cli-tools';\nimport type {BuildFlags} from './buildOptions';\nimport {simulatorDestinationMap} from './simulatorDestinationMap';\nimport {supportedPlatforms} from '@react-native-community/cli-config-apple';\nimport {ApplePlatform} from '../../types';\n\nfunction prettifyXcodebuildMessages(output: string): Set<string> {\n const errorRegex = /error\\b[^\\S\\r\\n]*[:\\-\\s]*([^\\r\\n]*)/gim;\n const errors = new Set<string>();\n\n let match;\n while ((match = errorRegex.exec(output)) !== null) {\n if (match[1]) {\n // match[1] contains the captured group that excludes any leading colons or spaces\n errors.add(match[1].trim());\n }\n }\n\n return errors;\n}\n\nexport function buildProject(\n xcodeProject: IOSProjectInfo,\n platform: ApplePlatform,\n udid: string | undefined,\n mode: string,\n scheme: string,\n args: BuildFlags,\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const simulatorDest = simulatorDestinationMap?.[platform];\n\n if (!simulatorDest) {\n reject(\n new CLIError(\n `Unknown platform: ${platform}. Please, use one of: ${Object.values(\n supportedPlatforms,\n ).join(', ')}.`,\n ),\n );\n return;\n }\n\n const isDevice = args.device;\n let destination = '';\n if (udid) {\n destination = `id=${udid}`;\n } else if (isDevice) {\n destination = 'generic/platform=iOS';\n } else if (mode === 'Debug') {\n destination = `generic/platform=${simulatorDest}`;\n } else {\n destination = `generic/platform=${platform}`;\n }\n\n if (args.destination) {\n destination += `,${args.destination}`;\n }\n\n const xcodebuildArgs = [\n xcodeProject.isWorkspace ? '-workspace' : '-project',\n xcodeProject.name,\n ...(args.xcconfig ? ['-xcconfig', args.xcconfig] : []),\n ...(args.buildFolder ? ['-derivedDataPath', args.buildFolder] : []),\n '-configuration',\n mode,\n '-scheme',\n scheme,\n '-destination',\n destination,\n ];\n\n if (args.extraParams) {\n xcodebuildArgs.push(...args.extraParams);\n }\n\n const loader = getLoader();\n logger.info(\n `Building ${pico.dim(\n `(using \"xcodebuild ${xcodebuildArgs.join(' ')}\")`,\n )}`,\n );\n let xcodebuildOutputFormatter: ChildProcess | any;\n if (!args.verbose) {\n if (xcbeautifyAvailable()) {\n xcodebuildOutputFormatter = child_process.spawn('xcbeautify', [], {\n stdio: ['pipe', process.stdout, process.stderr],\n });\n } else if (xcprettyAvailable()) {\n xcodebuildOutputFormatter = child_process.spawn('xcpretty', [], {\n stdio: ['pipe', process.stdout, process.stderr],\n });\n }\n }\n\n const buildProcess = child_process.spawn(\n 'xcodebuild',\n xcodebuildArgs,\n getProcessOptions(args),\n );\n let buildOutput = '';\n buildProcess.stdout.on('data', (data: Buffer) => {\n const stringData = data.toString();\n buildOutput += stringData;\n if (xcodebuildOutputFormatter) {\n xcodebuildOutputFormatter.stdin.write(data);\n } else {\n if (logger.isVerbose()) {\n logger.debug(stringData);\n } else {\n loader.start(\n `Building the app${'.'.repeat(buildOutput.length % 10)}`,\n );\n }\n }\n });\n buildProcess.on('close', (code: number) => {\n if (xcodebuildOutputFormatter) {\n xcodebuildOutputFormatter.stdin.end();\n } else {\n loader.stop();\n }\n if (code !== 0) {\n printRunDoctorTip();\n if (!xcodebuildOutputFormatter) {\n Array.from(prettifyXcodebuildMessages(buildOutput)).forEach((error) =>\n logger.error(error),\n );\n }\n\n reject(\n new CLIError(`\n Failed to build ${platform} project.\n\n \"xcodebuild\" exited with error code '${code}'. To debug build\n logs further, consider building your app with Xcode.app, by opening\n '${xcodeProject.name}'.`),\n );\n return;\n }\n\n logger.success('Successfully built the app');\n resolve(buildOutput);\n });\n });\n}\n\nfunction xcbeautifyAvailable() {\n try {\n child_process.execSync('xcbeautify --version', {\n stdio: [0, 'pipe', 'ignore'],\n });\n } catch (error) {\n return false;\n }\n return true;\n}\n\nfunction xcprettyAvailable() {\n try {\n child_process.execSync('xcpretty --version', {\n stdio: [0, 'pipe', 'ignore'],\n });\n } catch (error) {\n return false;\n }\n return true;\n}\n\nfunction getProcessOptions<T extends BuildFlags>(\n args: T,\n): SpawnOptionsWithoutStdio {\n if (\n 'packager' in args &&\n typeof args.packager === 'boolean' &&\n args.packager\n ) {\n const terminal =\n 'terminal' in args && typeof args.terminal === 'string'\n ? args.terminal\n : '';\n\n const port =\n 'port' in args && typeof args.port === 'number' ? String(args.port) : '';\n\n return {\n env: {\n ...process.env,\n RCT_TERMINAL: terminal,\n RCT_METRO_PORT: port,\n },\n };\n }\n\n return {\n env: process.env,\n };\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4E;AAG5E,SAASA,0BAA0B,CAACC,MAAc,EAAe;EAC/D,MAAMC,UAAU,GAAG,wCAAwC;EAC3D,MAAMC,MAAM,GAAG,IAAIC,GAAG,EAAU;EAEhC,IAAIC,KAAK;EACT,OAAO,CAACA,KAAK,GAAGH,UAAU,CAACI,IAAI,CAACL,MAAM,CAAC,MAAM,IAAI,EAAE;IACjD,IAAII,KAAK,CAAC,CAAC,CAAC,EAAE;MACZ;MACAF,MAAM,CAACI,GAAG,CAACF,KAAK,CAAC,CAAC,CAAC,CAACG,IAAI,EAAE,CAAC;IAC7B;EACF;EAEA,OAAOL,MAAM;AACf;AAEO,SAASM,YAAY,CAC1BC,YAA4B,EAC5BC,QAAuB,EACvBC,IAAwB,EACxBC,IAAY,EACZC,MAAc,EACdC,IAAgB,EACC;EACjB,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,MAAMC,aAAa,GAAGC,gDAAuB,aAAvBA,gDAAuB,uBAAvBA,gDAAuB,CAAGT,QAAQ,CAAC;IAEzD,IAAI,CAACQ,aAAa,EAAE;MAClBD,MAAM,CACJ,KAAIG,oBAAQ,EACT,qBAAoBV,QAAS,yBAAwBW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IAClB,OAAOA,IAAI,CAAC6D,QAAQ,KAAK,SAAS,IAClC7D,IAAI,CAAC6D,QAAQ,EACb;IACA,MAAMC,QAAQ,GACZ,UAAU,IAAI9D,IAAI,IAAI,OAAOA,IAAI,CAAC8D,QAAQ,KAAK,QAAQ,GACnD9D,IAAI,CAAC8D,QAAQ,GACb,EAAE;IAER,MAAMC,IAAI,GACR,MAAM,IAAI/D,IAAI,IAAI,OAAOA,IAAI,CAAC+D,IAAI,KAAK,QAAQ,GAAGC,MAAM,CAAChE,IAAI,CAAC+D,IAAI,CAAC,GAAG,EAAE;IAE1E,OAAO;MACLE,GAAG,EAAE;QACH,GAAGhC,OAAO,CAACgC,GAAG;QACdC,YAAY,EAAEJ,QAAQ;QACtBK,cAAc,EAAEJ;MAClB;IACF,CAAC;EACH;EAEA,OAAO;IACLE,GAAG,EAAEhC,OAAO,CAACgC;EACf,CAAC;AACH"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/createBuild.js.map
//# sourceMappingURL=createBuild.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["createBuild","platformName","_","ctx","args","platformConfig","project","undefined","supportedPlatforms","CLIError","installedPods","automaticPodsInstallation","forcePods","onlyPods","isAppRunningNewArchitecture","sourceDir","getArchitecture","resolvePods","root","dependencies","reactNativePath","forceInstall","newArchEnabled","xcodeProject","getXcodeProjectAndDir","process","chdir","scheme","mode","getConfiguration","buildProject"],"sources":["../../../src/commands/buildCommand/createBuild.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport getArchitecture from '../../tools/getArchitecture';\nimport {BuildFlags} from './buildOptions';\nimport {buildProject} from './buildProject';\nimport {getConfiguration} from './getConfiguration';\nimport {getXcodeProjectAndDir} from './getXcodeProjectAndDir';\nimport {BuilderCommand} from '../../types';\nimport {\n supportedPlatforms,\n resolvePods,\n} from '@react-native-community/cli-config-apple';\n\nconst createBuild =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: BuildFlags) => {\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(`Unable to find ${platformName} platform config`);\n }\n\n let installedPods = false;\n if (\n platformConfig.automaticPodsInstallation ||\n args.forcePods ||\n args.onlyPods\n ) {\n const isAppRunningNewArchitecture = platformConfig.sourceDir\n ? await getArchitecture(platformConfig.sourceDir)\n : undefined;\n\n await resolvePods(\n ctx.root,\n platformConfig.sourceDir,\n ctx.dependencies,\n platformName,\n ctx.reactNativePath,\n {\n forceInstall: args.forcePods || args.onlyPods,\n newArchEnabled: isAppRunningNewArchitecture,\n },\n );\n\n installedPods = true;\n }\n\n if (args.onlyPods) {\n return;\n }\n\n let {xcodeProject, sourceDir} = getXcodeProjectAndDir(\n platformConfig,\n platformName,\n installedPods,\n );\n\n process.chdir(sourceDir);\n\n const {scheme, mode} = await getConfiguration(\n xcodeProject,\n sourceDir,\n args,\n platformName,\n );\n\n return buildProject(\n xcodeProject,\n platformName,\n undefined,\n mode,\n scheme,\n args,\n );\n };\n\nexport default createBuild;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAEA;AACA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGkD;AAElD,MAAMA,WAAW,GACf,CAAC;EAACC;AAA4B,CAAC,KAC/B,OAAOC,CAAgB,EAAEC,GAAW,EAAEC,IAAgB,KAAK;EACzD,MAAMC,cAAc,GAAGF,GAAG,CAACG,OAAO,CAACL,YAAY,CAAqB;EAEpE,IACEI,cAAc,KAAKE,SAAS,IAC5BC,oCAAkB,CAACP,YAAY,CAAC,KAAKM,SAAS,EAC9C;IACA,MAAM,KAAIE,oBAAQ,EAAE,kBAAiBR,YAAa,kBAAiB,CAAC;EACtE;EAEA,IAAIS,aAAa,GAAG,KAAK;EACzB,IACEL,cAAc,CAACM,yBAAyB,IACxCP,IAAI,CAACQ,SAAS,IACdR,IAAI,CAACS,QAAQ,EACb;IACA,MAAMC,2BAA2B,GAAGT,cAAc,CAACU,SAAS,GACxD,MAAM,IAAAC,wBAAe,EAACX,cAAc,CAACU,SAAS,CAAC,GAC/CR,SAAS;IAEb,MAAM,IAAAU,6BAAW,EACfd,GAAG,CAACe,IAAI,EACRb,cAAc,CAACU,SAAS,EACxBZ,GAAG,CAACgB,YAAY,EAChBlB,YAAY,EACZE,GAAG,CAACiB,eAAe,EACnB;MACEC,YAAY,EAAEjB,IAAI,CAACQ,SAAS,IAAIR,IAAI,CAACS,QAAQ;MAC7CS,cAAc,EAAER;IAClB,CAAC,CACF;IAEDJ,aAAa,GAAG,IAAI;EACtB;EAEA,IAAIN,IAAI,CAACS,QAAQ,EAAE;IACjB;EACF;EAEA,IAAI;IAACU,YAAY;IAAER;EAAS,CAAC,GAAG,IAAAS,4CAAqB,EACnDnB,cAAc,EACdJ,YAAY,EACZS,aAAa,CACd;EAEDe,OAAO,CAACC,KAAK,CAACX,SAAS,CAAC;EAExB,MAAM;IAACY,MAAM;IAAEC;EAAI,CAAC,GAAG,MAAM,IAAAC,kCAAgB,EAC3CN,YAAY,EACZR,SAAS,EACTX,IAAI,EACJH,YAAY,CACb;EAED,OAAO,IAAA6B,0BAAY,EACjBP,YAAY,EACZtB,YAAY,EACZM,SAAS,EACTqB,IAAI,EACJD,MAAM,EACNvB,IAAI,CACL;AACH,CAAC;AAAC,eAEWJ,WAAW;AAAA"}
{"version":3,"file":"createBuild.js","names":["createBuild","platformName","_","ctx","args","platformConfig","project","undefined","supportedPlatforms","CLIError","installedPods","automaticPodsInstallation","forcePods","onlyPods","isAppRunningNewArchitecture","sourceDir","getArchitecture","resolvePods","root","dependencies","reactNativePath","forceInstall","newArchEnabled","xcodeProject","getXcodeProjectAndDir","process","chdir","scheme","mode","getConfiguration","buildProject"],"sources":["../../../src/commands/buildCommand/createBuild.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport getArchitecture from '../../tools/getArchitecture';\nimport {BuildFlags} from './buildOptions';\nimport {buildProject} from './buildProject';\nimport {getConfiguration} from './getConfiguration';\nimport {getXcodeProjectAndDir} from './getXcodeProjectAndDir';\nimport {BuilderCommand} from '../../types';\nimport {\n supportedPlatforms,\n resolvePods,\n} from '@react-native-community/cli-config-apple';\n\nconst createBuild =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: BuildFlags) => {\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(`Unable to find ${platformName} platform config`);\n }\n\n let installedPods = false;\n if (\n platformConfig.automaticPodsInstallation ||\n args.forcePods ||\n args.onlyPods\n ) {\n const isAppRunningNewArchitecture = platformConfig.sourceDir\n ? await getArchitecture(platformConfig.sourceDir)\n : undefined;\n\n await resolvePods(\n ctx.root,\n platformConfig.sourceDir,\n ctx.dependencies,\n platformName,\n ctx.reactNativePath,\n {\n forceInstall: args.forcePods || args.onlyPods,\n newArchEnabled: isAppRunningNewArchitecture,\n },\n );\n\n installedPods = true;\n }\n\n if (args.onlyPods) {\n return;\n }\n\n let {xcodeProject, sourceDir} = getXcodeProjectAndDir(\n platformConfig,\n platformName,\n installedPods,\n );\n\n process.chdir(sourceDir);\n\n const {scheme, mode} = await getConfiguration(\n xcodeProject,\n sourceDir,\n args,\n platformName,\n );\n\n return buildProject(\n xcodeProject,\n platformName,\n undefined,\n mode,\n scheme,\n args,\n );\n };\n\nexport default createBuild;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAEA;AACA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGkD;AAElD,MAAMA,WAAW,GAC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JD,MAAM,EACNvB,IAAI,CACL;AACH,CAAC;AAAC,eAEWJ,WAAW;AAAA"}

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

exports.getConfiguration = getConfiguration;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
function _picocolors() {
const data = _interopRequireDefault(require("picocolors"));
_picocolors = function () {
return data;

@@ -49,3 +49,3 @@ };

if (info === null || info === void 0 ? void 0 : (_info$schemes2 = info.schemes) === null || _info$schemes2 === void 0 ? void 0 : _info$schemes2.includes(fallbackScheme)) {
_cliTools().logger.warn(`Scheme "${_chalk().default.bold(scheme)}" doesn't exist. Using fallback scheme "${_chalk().default.bold(fallbackScheme)}"`);
_cliTools().logger.warn(`Scheme "${_picocolors().default.bold(scheme)}" doesn't exist. Using fallback scheme "${_picocolors().default.bold(fallbackScheme)}"`);
scheme = fallbackScheme;

@@ -68,3 +68,3 @@ }

}
_cliTools().logger.info(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} "${_chalk().default.bold(xcodeProject.name)}"`);
_cliTools().logger.info(`Found Xcode ${xcodeProject.isWorkspace ? 'workspace' : 'project'} "${_picocolors().default.bold(xcodeProject.name)}"`);
return {

@@ -76,2 +76,2 @@ scheme,

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/getConfiguration.js.map
//# sourceMappingURL=getConfiguration.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getConfiguration","xcodeProject","sourceDir","args","platformName","info","getInfo","mode","checkIfConfigurationExists","configurations","scheme","path","basename","name","extname","schemes","includes","readableName","getPlatformInfo","fallbackScheme","logger","warn","chalk","bold","getBuildConfigurationFromXcScheme","interactive","selection","selectFromInteractiveMode","isWorkspace"],"sources":["../../../src/commands/buildCommand/getConfiguration.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {logger} from '@react-native-community/cli-tools';\nimport {selectFromInteractiveMode} from '../../tools/selectFromInteractiveMode';\nimport {getInfo} from '../../tools/getInfo';\nimport {checkIfConfigurationExists} from '../../tools/checkIfConfigurationExists';\nimport type {BuildFlags} from './buildOptions';\nimport {getBuildConfigurationFromXcScheme} from '../../tools/getBuildConfigurationFromXcScheme';\nimport path from 'path';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {ApplePlatform} from '../../types';\n\nexport async function getConfiguration(\n xcodeProject: IOSProjectInfo,\n sourceDir: string,\n args: BuildFlags,\n platformName: ApplePlatform,\n) {\n const info = getInfo(xcodeProject, sourceDir);\n\n if (args.mode) {\n checkIfConfigurationExists(info?.configurations ?? [], args.mode);\n }\n\n let scheme =\n args.scheme ||\n path.basename(xcodeProject.name, path.extname(xcodeProject.name));\n\n if (!info?.schemes?.includes(scheme)) {\n const {readableName} = getPlatformInfo(platformName);\n const fallbackScheme = `${scheme}-${readableName}`;\n\n if (info?.schemes?.includes(fallbackScheme)) {\n logger.warn(\n `Scheme \"${chalk.bold(\n scheme,\n )}\" doesn't exist. Using fallback scheme \"${chalk.bold(\n fallbackScheme,\n )}\"`,\n );\n\n scheme = fallbackScheme;\n }\n }\n\n let mode =\n args.mode ||\n getBuildConfigurationFromXcScheme(scheme, 'Debug', sourceDir, info);\n\n if (args.interactive) {\n const selection = await selectFromInteractiveMode({\n scheme,\n mode,\n info,\n });\n\n if (selection.scheme) {\n scheme = selection.scheme;\n }\n\n if (selection.mode) {\n mode = selection.mode;\n }\n }\n\n logger.info(\n `Found Xcode ${\n xcodeProject.isWorkspace ? 'workspace' : 'project'\n } \"${chalk.bold(xcodeProject.name)}\"`,\n );\n\n return {scheme, mode};\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAGvD,eAAeA,gBAAgB,CACpCC,YAA4B,EAC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;IAEF,IAAIqB,SAAS,CAAChB,MAAM,EAAE;MACpBA,MAAM,GAAGgB,SAAS,CAAChB,MAAM;IAC3B;IAEA,IAAIgB,SAAS,CAACnB,IAAI,EAAE;MAClBA,IAAI,GAAGmB,SAAS,CAACnB,IAAI;IACvB;EACF;EAEAa,kBAAM,CAACf,IAAI,CACR,eACCJ,YAAY,CAAC2B,WAAW,GAAG,WAAW,GAAG,SAC1C,KAAIN,gBAAK,CAACC,IAAI,CAACtB,YAAY,CAACY,IAAI,CAAE,GAAE,CACtC;EAED,OAAO;IAACH,MAAM;IAAEH;EAAI,CAAC;AACvB"}
{"version":3,"file":"getConfiguration.js","names":["getConfiguration","xcodeProject","sourceDir","args","platformName","info","getInfo","mode","checkIfConfigurationExists","configurations","scheme","path","basename","name","extname","schemes","includes","readableName","getPlatformInfo","fallbackScheme","logger","warn","pico","bold","getBuildConfigurationFromXcScheme","interactive","selection","selectFromInteractiveMode","isWorkspace"],"sources":["../../../src/commands/buildCommand/getConfiguration.ts"],"sourcesContent":["import pico from 'picocolors';\nimport type {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {logger} from '@react-native-community/cli-tools';\nimport {selectFromInteractiveMode} from '../../tools/selectFromInteractiveMode';\nimport {getInfo} from '../../tools/getInfo';\nimport {checkIfConfigurationExists} from '../../tools/checkIfConfigurationExists';\nimport type {BuildFlags} from './buildOptions';\nimport {getBuildConfigurationFromXcScheme} from '../../tools/getBuildConfigurationFromXcScheme';\nimport path from 'path';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {ApplePlatform} from '../../types';\n\nexport async function getConfiguration(\n xcodeProject: IOSProjectInfo,\n sourceDir: string,\n args: BuildFlags,\n platformName: ApplePlatform,\n) {\n const info = getInfo(xcodeProject, sourceDir);\n\n if (args.mode) {\n checkIfConfigurationExists(info?.configurations ?? [], args.mode);\n }\n\n let scheme =\n args.scheme ||\n path.basename(xcodeProject.name, path.extname(xcodeProject.name));\n\n if (!info?.schemes?.includes(scheme)) {\n const {readableName} = getPlatformInfo(platformName);\n const fallbackScheme = `${scheme}-${readableName}`;\n\n if (info?.schemes?.includes(fallbackScheme)) {\n logger.warn(\n `Scheme \"${pico.bold(\n scheme,\n )}\" doesn't exist. Using fallback scheme \"${pico.bold(\n fallbackScheme,\n )}\"`,\n );\n\n scheme = fallbackScheme;\n }\n }\n\n let mode =\n args.mode ||\n getBuildConfigurationFromXcScheme(scheme, 'Debug', sourceDir, info);\n\n if (args.interactive) {\n const selection = await selectFromInteractiveMode({\n scheme,\n mode,\n info,\n });\n\n if (selection.scheme) {\n scheme = selection.scheme;\n }\n\n if (selection.mode) {\n mode = selection.mode;\n }\n }\n\n logger.info(\n `Found Xcode ${\n xcodeProject.isWorkspace ? 'workspace' : 'project'\n } \"${pico.bold(xcodeProject.name)}\"`,\n );\n\n return {scheme, mode};\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAGvD,eAAeA,gBAAgB,CACpCC,YAA4B,EAC5BC,SAAiB,EACjBC,IAAgB,EAChBC,YAA2B,EAC3B;EAAA;EACA,MAAMC,IAAI,GAAG,IAAAC,gBAAO,EAACL,YAAY,EAAEC,SAAS,CAAC;EAE7C,IAAIC,IAAI,CAACI,IAAI,EAAE;IACb,IAAAC,sDAA0B,EAAC,CAAAH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,cAAc,KAAI,EAAE,EAAEN,IAAI,CAACI,IAAI,CAAC;EACnE;EAEA,IAAIG,MAAM,GACRP,IAAI,CAACO,MAAM,IACXC,eAAI,CAACC,QAAQ,CAACX,YAAY,CAACY,IAAI,EAAEF,eAAI,CAACG,OAAO,CAACb,YAAY,CAACY,IAAI,CAAC,CAAC;EAEnE,IAAI,EAACR,IAAI,aAAJA,IAAI,wCAAJA,IAAI,CAAEU,OAAO,kDAAb,cAAeC,QAAQ,CAACN,MAAM,CAAC,GAAE;IAAA;IACpC,MAAM;MAACO;IAAY,CAAC,GAAG,IAAAC,gCAAe,EAACd,YAAY,CAAC;IACpD,MAAMe,cAAc,GAAI,GAAET,MAAO,IAAGO,YAAa,EAAC;IAElD,IAAIZ,IAAI,aAAJA,IAAI,yCAAJA,IAAI,CAAEU,OAAO,mDAAb,eAAeC,QAAQ,CAACG,cAAc,CAAC,EAAE;MAC3CC,kBAAM,CAACC,IAAI,CACR,WAAUC,qBAAI,CAACC,IAAI,CAClBb,MAAM,CACN,2CAA0CY,qBAAI,CAACC,IAAI,CACnDJ,cAAc,CACd,GAAE,CACL;MAEDT,MAAM,GAAGS,cAAc;IACzB;EACF;EAEA,IAAIZ,IAAI,GACNJ,IAAI,CAACI,IAAI,IACT,IAAAiB,oEAAiC,EAACd,MAAM,EAAE,OAAO,EAAER,SAAS,EAAEG,IAAI,CAAC;EAErE,IAAIF,IAAI,CAACsB,WAAW,EAAE;IACpB,MAAMC,SAAS,GAAG,MAAM,IAAAC,oDAAyB,EAAC;MAChDjB,MAAM;MACNH,IAAI;MACJF;IACF,CAAC,CAAC;IAEF,IAAIqB,SAAS,CAAChB,MAAM,EAAE;MACpBA,MAAM,GAAGgB,SAAS,CAAChB,MAAM;IAC3B;IAEA,IAAIgB,SAAS,CAACnB,IAAI,EAAE;MAClBA,IAAI,GAAGmB,SAAS,CAACnB,IAAI;IACvB;EACF;EAEAa,kBAAM,CAACf,IAAI,CACR,eACCJ,YAAY,CAAC2B,WAAW,GAAG,WAAW,GAAG,SAC1C,KAAIN,qBAAI,CAACC,IAAI,CAACtB,YAAY,CAACY,IAAI,CAAE,GAAE,CACrC;EAED,OAAO;IAACH,MAAM;IAAEH;EAAI,CAAC;AACvB"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/getXcodeProjectAndDir.js.map
//# sourceMappingURL=getXcodeProjectAndDir.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getXcodeProjectAndDir","iosProjectConfig","platformName","installedPods","readableName","platformReadableName","getPlatformInfo","CLIError","xcodeProject","sourceDir","recheckXcodeProject","findXcodeProject","fs","readdirSync"],"sources":["../../../src/commands/buildCommand/getXcodeProjectAndDir.ts"],"sourcesContent":["import fs from 'fs';\nimport {IOSProjectConfig} from '@react-native-community/cli-types';\nimport {CLIError} from '@react-native-community/cli-tools';\nimport {findXcodeProject} from '@react-native-community/cli-config-apple';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {ApplePlatform} from '../../types';\n\nexport function getXcodeProjectAndDir(\n iosProjectConfig: IOSProjectConfig | undefined,\n platformName: ApplePlatform,\n installedPods?: boolean,\n) {\n const {readableName: platformReadableName} = getPlatformInfo(platformName);\n\n if (!iosProjectConfig) {\n throw new CLIError(\n `${platformReadableName} project folder not found. Make sure that project.${platformName}.sourceDir points to a directory with your Xcode project and that you are running this command inside of React Native project.`,\n );\n }\n\n let {xcodeProject, sourceDir} = iosProjectConfig;\n\n if (!xcodeProject) {\n throw new CLIError(\n `Could not find Xcode project files in \"${sourceDir}\" folder. Please make sure that you have installed Cocoapods and \"${sourceDir}\" is a valid path`,\n );\n }\n\n // if project is freshly created, revisit Xcode project to verify Pods are installed correctly.\n // This is needed because ctx project is created before Pods are installed, so it might have outdated information.\n if (installedPods) {\n const recheckXcodeProject = findXcodeProject(fs.readdirSync(sourceDir));\n if (recheckXcodeProject) {\n xcodeProject = recheckXcodeProject;\n }\n }\n\n return {xcodeProject, sourceDir};\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAGvD,SAASA,qBAAqB,CACnCC,gBAA8C,EAC9CC,YAA2B,EAC3BC,aAAuB,EACvB;EACA,MAAM;IAACC,YAAY,EAAEC;EAAoB,CAAC,GAAG,IAAAC,gCAAe,EAACJ,YAAY,CAAC;EAE1E,IAAI,CAACD,gBAAgB,EAAE;IACrB,MAAM,KAAIM,oBAAQ,EACf,GAAEF,oBAAqB,qDAAoDH,YAAa,gIAA+H,CACzN;EACH;EAEA,IAAI;IAACM,YAAY;IAAEC;EAAS,CAAC,GAAGR,gBAAgB;EAEhD,IAAI,CAACO,YAAY,EAAE;IACjB,MAAM,KAAID,oBAAQ,EACf,0CAAyCE,SAAU,qEAAoEA,SAAU,mBAAkB,CACrJ;EACH;;EAEA;EACA;EACA,IAAIN,aAAa,EAAE;IACjB,MAAMO,mBAAmB,GAAG,IAAAC,kCAAgB,EAACC,aAAE,CAACC,WAAW,CAACJ,SAAS,CAAC,CAAC;IACvE,IAAIC,mBAAmB,EAAE;MACvBF,YAAY,GAAGE,mBAAmB;IACpC;EACF;EAEA,OAAO;IAACF,YAAY;IAAEC;EAAS,CAAC;AAClC"}
{"version":3,"file":"getXcodeProjectAndDir.js","names":["getXcodeProjectAndDir","iosProjectConfig","platformName","installedPods","readableName","platformReadableName","getPlatformInfo","CLIError","xcodeProject","sourceDir","recheckXcodeProject","findXcodeProject","fs","readdirSync"],"sources":["../../../src/commands/buildCommand/getXcodeProjectAndDir.ts"],"sourcesContent":["import fs from 'fs';\nimport {IOSProjectConfig} from '@react-native-community/cli-types';\nimport {CLIError} from '@react-native-community/cli-tools';\nimport {findXcodeProject} from '@react-native-community/cli-config-apple';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {ApplePlatform} from '../../types';\n\nexport function getXcodeProjectAndDir(\n iosProjectConfig: IOSProjectConfig | undefined,\n platformName: ApplePlatform,\n installedPods?: boolean,\n) {\n const {readableName: platformReadableName} = getPlatformInfo(platformName);\n\n if (!iosProjectConfig) {\n throw new CLIError(\n `${platformReadableName} project folder not found. Make sure that project.${platformName}.sourceDir points to a directory with your Xcode project and that you are running this command inside of React Native project.`,\n );\n }\n\n let {xcodeProject, sourceDir} = iosProjectConfig;\n\n if (!xcodeProject) {\n throw new CLIError(\n `Could not find Xcode project files in \"${sourceDir}\" folder. Please make sure that you have installed Cocoapods and \"${sourceDir}\" is a valid path`,\n );\n }\n\n // if project is freshly created, revisit Xcode project to verify Pods are installed correctly.\n // This is needed because ctx project is created before Pods are installed, so it might have outdated information.\n if (installedPods) {\n const recheckXcodeProject = findXcodeProject(fs.readdirSync(sourceDir));\n if (recheckXcodeProject) {\n xcodeProject = recheckXcodeProject;\n }\n }\n\n return {xcodeProject, sourceDir};\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAGvD,SAASA,qBAAqB,CACnCC,gBAA8C,EAC9CC,YAA2B,EAC3BC,aAAuB,EACvB;EACA,MAAM;IAACC,YAAY,EAAEC;EAAoB,CAAC,GAAG,IAAAC,gCAAe,EAACJ,YAAY,CAAC;EAE1E,IAAI,CAACD,gBAAgB,EAAE;IACrB,MAAM,KAAIM,oBAAQ,EACf,GAAEF,oBAAqB,qDAAoDH,YAAa,gIAA+H,CACzN;EACH;EAEA,IAAI;IAACM,YAAY;IAAEC;EAAS,CAAC,GAAGR,gBAAgB;EAEhD,IAAI,CAACO,YAAY,EAAE;IACjB,MAAM,KAAID,oBAAQ,EACf,0CAAyCE,SAAU,qEAAoEA,SAAU,mBAAkB,CACrJ;EACH;;EAEA;EACA;EACA,IAAIN,aAAa,EAAE;IACjB,MAAMO,mBAAmB,GAAG,IAAAC,kCAAgB,EAACC,aAAE,CAACC,WAAW,CAACJ,SAAS,CAAC,CAAC;IACvE,IAAIC,mBAAmB,EAAE;MACvBF,YAAY,GAAGE,mBAAmB;IACpC;EACF;EAEA,OAAO;IAACF,YAAY;IAAEC;EAAS,CAAC;AAClC"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/buildCommand/simulatorDestinationMap.js.map
//# sourceMappingURL=simulatorDestinationMap.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["simulatorDestinationMap","ios","macos","visionos","tvos"],"sources":["../../../src/commands/buildCommand/simulatorDestinationMap.ts"],"sourcesContent":["import {ApplePlatform} from '../../types';\n\nexport const simulatorDestinationMap: Record<ApplePlatform, string> = {\n ios: 'iOS Simulator',\n macos: 'macOS',\n visionos: 'visionOS Simulator',\n tvos: 'tvOS Simulator',\n};\n"],"mappings":";;;;;;AAEO,MAAMA,uBAAsD,GAAG;EACpEC,GAAG,EAAE,eAAe;EACpBC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE,oBAAoB;EAC9BC,IAAI,EAAE;AACR,CAAC;AAAC"}
{"version":3,"file":"simulatorDestinationMap.js","names":["simulatorDestinationMap","ios","macos","visionos","tvos"],"sources":["../../../src/commands/buildCommand/simulatorDestinationMap.ts"],"sourcesContent":["import {ApplePlatform} from '../../types';\n\nexport const simulatorDestinationMap: Record<ApplePlatform, string> = {\n ios: 'iOS Simulator',\n macos: 'macOS',\n visionos: 'visionOS Simulator',\n tvos: 'tvOS Simulator',\n};\n"],"mappings":";;;;;;AAEO,MAAMA,uBAAsD,GAAG;EACpEC,GAAG,EAAE,eAAe;EACpBC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE,oBAAoB;EAC9BC,IAAI,EAAE;AACR,CAAC;AAAC"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/logCommand/createLog.js.map
//# sourceMappingURL=createLog.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["createLog","platformName","_","ctx","args","platformConfig","project","readableName","platformReadableName","getPlatformInfo","undefined","supportedPlatforms","CLIError","sdkNames","allDevices","listDevices","simulators","filter","type","length","logger","error","booted","state","interactive","udid","promptForDeviceToTailLogs","simulator","find","deviceUDID","tailDeviceLogs","device","logDir","path","join","os","homedir","info","name","log","spawnSync","stdio"],"sources":["../../../src/commands/logCommand/createLog.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport {spawnSync} from 'child_process';\nimport os from 'os';\nimport path from 'path';\nimport listDevices from '../../tools/listDevices';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {BuilderCommand, Device} from '../../types';\nimport {supportedPlatforms} from '@react-native-community/cli-config-apple';\nimport {promptForDeviceToTailLogs} from '../../tools/prompts';\n\n/**\n * Starts Apple device syslog tail\n */\n\ntype Args = {\n interactive: boolean;\n};\n\nconst createLog =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: Args) => {\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n const {readableName: platformReadableName} = getPlatformInfo(platformName);\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(`Unable to find ${platformName} platform config`);\n }\n\n const {sdkNames} = getPlatformInfo(platformName);\n const allDevices = await listDevices(sdkNames);\n const simulators = allDevices.filter(({type}) => type === 'simulator');\n\n if (simulators.length === 0) {\n logger.error('No simulators detected. Install simulators via Xcode.');\n return;\n }\n\n const booted = simulators.filter(({state}) => state === 'Booted');\n\n if (booted.length === 0) {\n logger.error(\n `No booted and available ${platformReadableName} simulators found.`,\n );\n return;\n }\n\n if (args.interactive && booted.length > 1) {\n const udid = await promptForDeviceToTailLogs(\n platformReadableName,\n booted,\n );\n\n const simulator = booted.find(\n ({udid: deviceUDID}) => deviceUDID === udid,\n );\n\n if (!simulator) {\n throw new CLIError(\n `Unable to find simulator with udid: ${udid} in booted simulators`,\n );\n }\n\n tailDeviceLogs(simulator);\n } else {\n tailDeviceLogs(booted[0]);\n }\n };\n\nfunction tailDeviceLogs(device: Device) {\n const logDir = path.join(\n os.homedir(),\n 'Library',\n 'Logs',\n 'CoreSimulator',\n device.udid,\n 'asl',\n );\n\n logger.info(`Tailing logs for device ${device.name} (${device.udid})`);\n\n const log = spawnSync('syslog', ['-w', '-F', 'std', '-d', logDir], {\n stdio: 'inherit',\n });\n\n if (log.error !== null) {\n throw log.error;\n }\n}\n\nexport default createLog;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAE9D;AACA;AACA;;AAMA,MAAMA,SAAS,GACb,CAAC;EAACC;AAA4B,CAAC,KAC/B,OAAOC,CAAgB,EAAEC,GAAW,EAAEC,IAAU,KAAK;EACnD,MAAMC,cAAc,GAAGF,GAAG,CAACG,OAAO,CAACL,YAAY,CAAqB;EACpE,MAAM;IAACM,YAAY,EAAEC;EAAoB,CAAC,GAAG,IAAAC,gCAAe,EAACR,YAAY,CAAC;EAE1E,IACEI,cAAc,KAAKK,SAAS,IAC5BC,oCAAkB,CAACV,YAAY,CAAC,KAAKS,SAAS,EAC9C;IACA,MAAM,KAAIE,oBAAQ,EAAE,kBAAiBX,YAAa,kBAAiB,CAAC;EACtE;EAEA,MAAM;IAACY;EAAQ,CAAC,GAAG,IAAAJ,gCAAe,EAACR,YAAY,CAAC;EAChD,MAAMa,UAAU,GAAG,MAAM,IAAAC,oBAAW,EAACF,QAAQ,CAAC;EAC9C,MAAMG,UAAU,GAAGF,UAAU,CAACG,MAAM,CAAC,CAAC;IAACC;EAAI,CAAC,KAAKA,IAAI,KAAK,WAAW,CAAC;EAEtE,IAAIF,UAAU,CAACG,MAAM,KAAK,CAAC,EAAE;IAC3BC,kBAAM,CAACC,KAAK,CAAC,uDAAuD,CAAC;IACrE;EACF;E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,MAAMkB,GAAG,CAAClB,KAAK;EACjB;AACF;AAAC,eAEcrB,SAAS;AAAA"}
{"version":3,"file":"createLog.js","names":["createLog","platformName","_","ctx","args","platformConfig","project","readableName","platformReadableName","getPlatformInfo","undefined","supportedPlatforms","CLIError","sdkNames","allDevices","listDevices","simulators","filter","type","length","logger","error","booted","state","interactive","udid","promptForDeviceToTailLogs","simulator","find","deviceUDID","tailDeviceLogs","device","logDir","path","join","os","homedir","info","name","log","spawnSync","stdio"],"sources":["../../../src/commands/logCommand/createLog.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport {spawnSync} from 'child_process';\nimport os from 'os';\nimport path from 'path';\nimport listDevices from '../../tools/listDevices';\nimport {getPlatformInfo} from '../runCommand/getPlatformInfo';\nimport {BuilderCommand, Device} from '../../types';\nimport {supportedPlatforms} from '@react-native-community/cli-config-apple';\nimport {promptForDeviceToTailLogs} from '../../tools/prompts';\n\n/**\n * Starts Apple device syslog tail\n */\n\ntype Args = {\n interactive: boolean;\n};\n\nconst createLog =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: Args) => {\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n const {readableName: platformReadableName} = getPlatformInfo(platformName);\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(`Unable to find ${platformName} platform config`);\n }\n\n const {sdkNames} = getPlatformInfo(platformName);\n const allDevices = await listDevices(sdkNames);\n const simulators = allDevices.filter(({type}) => type === 'simulator');\n\n if (simulators.length === 0) {\n logger.error('No simulators detected. Install simulators via Xcode.');\n return;\n }\n\n const booted = simulators.filter(({state}) => state === 'Booted');\n\n if (booted.length === 0) {\n logger.error(\n `No booted and available ${platformReadableName} simulators found.`,\n );\n return;\n }\n\n if (args.interactive && booted.length > 1) {\n const udid = await promptForDeviceToTailLogs(\n platformReadableName,\n booted,\n );\n\n const simulator = booted.find(\n ({udid: deviceUDID}) => deviceUDID === udid,\n );\n\n if (!simulator) {\n throw new CLIError(\n `Unable to find simulator with udid: ${udid} in booted simulators`,\n );\n }\n\n tailDeviceLogs(simulator);\n } else {\n tailDeviceLogs(booted[0]);\n }\n };\n\nfunction tailDeviceLogs(device: Device) {\n const logDir = path.join(\n os.homedir(),\n 'Library',\n 'Logs',\n 'CoreSimulator',\n device.udid,\n 'asl',\n );\n\n logger.info(`Tailing logs for device ${device.name} (${device.udid})`);\n\n const log = spawnSync('syslog', ['-w', '-F', 'std', '-d', logDir], {\n stdio: 'inherit',\n });\n\n if (log.error !== null) {\n throw log.error;\n }\n}\n\nexport default createLog;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA8D;AAE9D;AACA;AACA;;AAMA,MAAMA,SAAS,GACb,CAAC;EAACC;AAA4B,CAAC,KAC/B,OAAOC,CAAgB,EAAEC,GAAW,EAAEC,IAAU,KAAK;EACnD,MAAMC,cAAc,GAAGF,GAAG,CAACG,OAAO,CAACL,YAAY,CAAqB;EACpE,MAAM;IAACM,YAAY,EAAEC;EAAoB,CAAC,GAAG,IAAAC,gCAAe,EAACR,YAAY,CAAC;EAE1E,IACEI,cAAc,KAAKK,SAAS,IAC5BC,oCAAkB,CAACV,YAAY,CAAC,KAAKS,SAAS,EAC9C;IACA,MAAM,KAAIE,oBAAQ,EAAE,kBAAiBX,YAAa,kBAAiB,CAAC;EACtE;EAEA,MAAM;IAACY;EAAQ,CAAC,GAAG,IAAAJ,gCAAe,EAACR,YAAY,CAAC;EAChD,MAAMa,UAAU,GAAG,MAAM,IAAAC,oBAAW,EAACF,QAAQ,CAAC;E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,MAAMc,GAAG,GAAG,IAAAC,0BAAS,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAER,MAAM,CAAC,EAAE;IACjES,KAAK,EAAE;EACT,CAAC,CAAC;EAEF,IAAIF,GAAG,CAAClB,KAAK,KAAK,IAAI,EAAE;IACtB,MAAMkB,GAAG,CAAClB,KAAK;EACjB;AACF;AAAC,eAEcrB,SAAS;AAAA"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/logCommand/logOptions.js.map
//# sourceMappingURL=logOptions.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getLogOptions","name","description"],"sources":["../../../src/commands/logCommand/logOptions.ts"],"sourcesContent":["import {BuilderCommand} from '../../types';\n\nexport const getLogOptions = ({}: BuilderCommand) => [\n {\n name: '-i --interactive',\n description:\n 'Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator.',\n },\n];\n"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAG,CAAC,CAAiB,CAAC,KAAK,CACnD;EACEC,IAAI,EAAE,kBAAkB;EACxBC,WAAW,EACT;AACJ,CAAC,CACF;AAAC"}
{"version":3,"file":"logOptions.js","names":["getLogOptions","name","description"],"sources":["../../../src/commands/logCommand/logOptions.ts"],"sourcesContent":["import {BuilderCommand} from '../../types';\n\nexport const getLogOptions = ({}: BuilderCommand) => [\n {\n name: '-i --interactive',\n description:\n 'Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator.',\n },\n];\n"],"mappings":";;;;;;AAEO,MAAMA,aAAa,GAAG,CAAC,CAAiB,CAAC,KAAK,CACnD;EACEC,IAAI,EAAE,kBAAkB;EACxBC,WAAW,EACT;AACJ,CAAC,CACF;AAAC"}

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

simulator?: string;
device?: string | true;
udid?: string;

@@ -16,0 +15,0 @@ binaryPath?: string;

@@ -1,1 +0,1 @@

{"version":3,"file":"createRun.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/createRun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAC,MAAM,EAAmB,MAAM,mCAAmC,CAAC;AAY3E,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AASxD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAO3C,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,QAAA,MAAM,SAAS,qBACI,cAAc,SACrB,MAAM,MAAM,CAAC,OAAO,MAAM,QAAQ,MAAM,kBAuVjD,CAAC;AAEJ,eAAe,SAAS,CAAC"}
{"version":3,"file":"createRun.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/createRun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAC,MAAM,EAAmB,MAAM,mCAAmC,CAAC;AAY3E,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AASxD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAO3C,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,QAAA,MAAM,SAAS,qBACI,cAAc,SACrB,MAAM,MAAM,CAAC,OAAO,MAAM,QAAQ,MAAM,kBAuVjD,CAAC;AAEJ,eAAe,SAAS,CAAC"}

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

exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;

@@ -15,5 +15,5 @@ };

}
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;

@@ -23,5 +23,5 @@ };

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

@@ -209,3 +209,3 @@ };

// but the general case is this is a problem and device list will help
_cliTools().logger.warn(`Could not find a device with udid: "${_chalk().default.bold(args.udid)}". ${(0, _matchingDevice.printFoundDevices)(devices)}`);
_cliTools().logger.warn(`Could not find a device with udid: "${_picocolors().default.bold(args.udid)}". ${(0, _matchingDevice.printFoundDevices)(devices)}`);
}

@@ -238,7 +238,7 @@ if (((_device = device) === null || _device === void 0 ? void 0 : _device.type) === 'simulator') {

if (!deviceByUdid) {
return _cliTools().logger.error(`Could not find a physical device with name or unique device identifier: "${_chalk().default.bold(args.device)}". ${(0, _matchingDevice.printFoundDevices)(devices, 'device')}`);
return _cliTools().logger.error(`Could not find a physical device with name or unique device identifier: "${_picocolors().default.bold(typeof args.device === 'string' ? args.device : 'true')}". ${(0, _matchingDevice.printFoundDevices)(devices, 'device')}`);
}
device = deviceByUdid;
if (deviceByUdid.type === 'simulator') {
return _cliTools().logger.error(`The device with udid: "${_chalk().default.bold(args.device)}" is a simulator. If you want to run on a simulator, use the "--simulator" flag instead.`);
return _cliTools().logger.error(`The device with udid: "${_picocolors().default.bold(typeof args.device === 'string' ? args.device : 'true')}" is a simulator. If you want to run on a simulator, use the "--simulator" flag instead.`);
}

@@ -259,2 +259,2 @@ }

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/createRun.js.map
//# sourceMappingURL=createRun.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getPackageJson","root","require","path","join","CLIError","createRun","platformName","_","ctx","args","link","setPlatform","platformConfig","project","sdkNames","readableName","platformReadableName","getPlatformInfo","undefined","supportedPlatforms","packager","port","installedPods","automaticPodsInstallation","forcePods","onlyPods","isAppRunningNewArchitecture","sourceDir","getArchitecture","resolvePods","dependencies","reactNativePath","forceInstall","newArchEnabled","newPort","startPackager","findDevServerPort","startServerInNewWindow","terminal","reactNativeVersion","setVersion","xcodeProject","getXcodeProjectAndDir","process","chdir","binaryPath","isAbsolute","fs","existsSync","mode","scheme","getConfiguration","buildOutput","buildProject","openApp","target","devices","listDevices","length","logger","error","packageJson","preferredDevice","cacheManager","get","name","preferredDeviceIndex","findIndex","udid","device","splice","unshift","fallbackSimulator","getFallbackSimulator","interactive","warn","selectedDevice","promptForDeviceSelection","set","type","runOnSimulator","runOnDevice","simulator","bootedSimulators","filter","state","bootedDevices","booted","info","map","find","d","chalk","bold","printFoundDevices","matchingDevice","deviceByUdid"],"sources":["../../../src/commands/runCommand/createRun.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport path from 'path';\nimport fs from 'fs';\nimport chalk from 'chalk';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport {\n logger,\n CLIError,\n link,\n startServerInNewWindow,\n findDevServerPort,\n cacheManager,\n} from '@react-native-community/cli-tools';\nimport getArchitecture from '../../tools/getArchitecture';\nimport listDevices from '../../tools/listDevices';\nimport {promptForDeviceSelection} from '../../tools/prompts';\nimport {BuildFlags} from '../buildCommand/buildOptions';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {getConfiguration} from '../buildCommand/getConfiguration';\nimport {getXcodeProjectAndDir} from '../buildCommand/getXcodeProjectAndDir';\nimport {getFallbackSimulator} from './getFallbackSimulator';\nimport {getPlatformInfo} from './getPlatformInfo';\nimport {printFoundDevices, matchingDevice} from './matchingDevice';\nimport {runOnDevice} from './runOnDevice';\nimport {runOnSimulator} from './runOnSimulator';\nimport {BuilderCommand} from '../../types';\nimport {\n supportedPlatforms,\n resolvePods,\n} from '@react-native-community/cli-config-apple';\nimport openApp from './openApp';\n\nexport interface FlagsT extends BuildFlags {\n simulator?: string;\n device?: string | true;\n udid?: string;\n binaryPath?: string;\n listDevices?: boolean;\n packager?: boolean;\n port: number;\n terminal?: string;\n}\n\nfunction getPackageJson(root: string) {\n try {\n return require(path.join(root, 'package.json'));\n } catch {\n throw new CLIError(\n 'No package.json found. Please make sure the file exists in the current folder.',\n );\n }\n}\n\nconst createRun =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: FlagsT) => {\n // React Native docs assume platform is always ios/android\n link.setPlatform('ios');\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n const {sdkNames, readableName: platformReadableName} =\n getPlatformInfo(platformName);\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(\n `Unable to find ${platformReadableName} platform config`,\n );\n }\n\n let {packager, port} = args;\n let installedPods = false;\n // check if pods need to be installed\n if (\n platformConfig.automaticPodsInstallation ||\n args.forcePods ||\n args.onlyPods\n ) {\n const isAppRunningNewArchitecture = platformConfig.sourceDir\n ? await getArchitecture(platformConfig.sourceDir)\n : undefined;\n\n await resolvePods(\n ctx.root,\n platformConfig.sourceDir,\n ctx.dependencies,\n platformName,\n ctx.reactNativePath,\n {\n forceInstall: args.forcePods || args.onlyPods,\n newArchEnabled: isAppRunningNewArchitecture,\n },\n );\n\n installedPods = true;\n }\n\n if (args.onlyPods) {\n return;\n }\n\n if (packager) {\n const {port: newPort, startPackager} = await findDevServerPort(\n port,\n ctx.root,\n );\n\n if (startPackager) {\n await startServerInNewWindow(\n newPort,\n ctx.root,\n ctx.reactNativePath,\n args.terminal,\n );\n }\n }\n\n if (ctx.reactNativeVersion !== 'unknown') {\n link.setVersion(ctx.reactNativeVersion);\n }\n\n let {xcodeProject, sourceDir} = getXcodeProjectAndDir(\n platformConfig,\n platformName,\n installedPods,\n );\n\n process.chdir(sourceDir);\n\n if (args.binaryPath) {\n args.binaryPath = path.isAbsolute(args.binaryPath)\n ? args.binaryPath\n : path.join(ctx.root, args.binaryPath);\n\n if (!fs.existsSync(args.binaryPath)) {\n throw new CLIError(\n 'binary-path was specified, but the file was not found.',\n );\n }\n }\n\n const {mode, scheme} = await getConfiguration(\n xcodeProject,\n sourceDir,\n args,\n platformName,\n );\n\n if (platformName === 'macos') {\n const buildOutput = await buildProject(\n xcodeProject,\n platformName,\n undefined,\n mode,\n scheme,\n args,\n );\n\n openApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target: args.target,\n binaryPath: args.binaryPath,\n });\n\n return;\n }\n\n let devices = await listDevices(sdkNames);\n\n if (devices.length === 0) {\n return logger.error(\n `${platformReadableName} devices or simulators not detected. Install simulators via Xcode or connect a physical ${platformReadableName} device`,\n );\n }\n\n const packageJson = getPackageJson(ctx.root);\n\n const preferredDevice = cacheManager.get(\n packageJson.name,\n 'lastUsedIOSDeviceId',\n );\n\n if (preferredDevice) {\n const preferredDeviceIndex = devices.findIndex(\n ({udid}) => udid === preferredDevice,\n );\n\n if (preferredDeviceIndex > -1) {\n const [device] = devices.splice(preferredDeviceIndex, 1);\n devices.unshift(device);\n }\n }\n\n const fallbackSimulator =\n platformName === 'ios' || platformName === 'tvos'\n ? getFallbackSimulator(args)\n : devices[0];\n\n if (args.listDevices || args.interactive) {\n if (args.device || args.udid) {\n logger.warn(\n `Both ${\n args.device ? 'device' : 'udid'\n } and \"list-devices\" parameters were passed to \"run\" command. We will list available devices and let you choose from one.`,\n );\n }\n\n const selectedDevice = await promptForDeviceSelection(devices);\n\n if (!selectedDevice) {\n throw new CLIError(\n `Failed to select device, please try to run app without ${\n args.listDevices ? 'list-devices' : 'interactive'\n } command.`,\n );\n } else {\n if (selectedDevice.udid !== preferredDevice) {\n cacheManager.set(\n packageJson.name,\n 'lastUsedIOSDeviceId',\n selectedDevice.udid,\n );\n }\n }\n\n if (selectedDevice.type === 'simulator') {\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n selectedDevice,\n );\n } else {\n return runOnDevice(\n selectedDevice,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n }\n\n if (!args.device && !args.udid && !args.simulator) {\n const bootedSimulators = devices.filter(\n ({state, type}) => state === 'Booted' && type === 'simulator',\n );\n const bootedDevices = devices.filter(({type}) => type === 'device'); // Physical devices here are always booted\n const booted = [...bootedSimulators, ...bootedDevices];\n\n if (booted.length === 0) {\n logger.info(\n 'No booted devices or simulators found. Launching first available simulator...',\n );\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n }\n\n logger.info(`Found booted ${booted.map(({name}) => name).join(', ')}`);\n\n for (const simulator of bootedSimulators) {\n await runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n simulator || fallbackSimulator,\n );\n }\n\n for (const device of bootedDevices) {\n await runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n\n return;\n }\n\n if (args.device && args.udid) {\n return logger.error(\n 'The `device` and `udid` options are mutually exclusive.',\n );\n }\n\n if (args.udid) {\n let device = devices.find((d) => d.udid === args.udid);\n if (!device) {\n // We may be able to recover from this for macCatalyst app starts,\n // but the general case is this is a problem and device list will help\n logger.warn(\n `Could not find a device with udid: \"${chalk.bold(\n args.udid,\n )}\". ${printFoundDevices(devices)}`,\n );\n }\n if (device?.type === 'simulator') {\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n } else {\n if (!device) {\n // On arm64 machines, the catalyst UDID returned by 'xcrun xctrace list devices' is not correct\n // xcodebuild will return an error indicating the UDID is unknown and offering a different one\n // you may obtain it by running xcodebuild with the UDID you think works then parse out the other one from the returned error:\n // CATALYST_DESTINATION=$(xcodebuild -workspace ios/rnfbdemo.xcworkspace -configuration Debug -scheme rnfbdemo -destination id=7153382A-C92B-5798-BEA3-D82D195F25F8 2>&1|grep macOS|grep Catalyst|head -1 |cut -d':' -f5 |cut -d' ' -f1)\n //\n // How to handle the incorrect catalyst UDID?\n // Assume if a UDID is specified, the user knows what they are doing.\n // Use the given UDID and force the type, so \"catalyst\" will launch the app correctly\n device = {name: 'unknown', udid: args.udid, type: 'catalyst'};\n logger.warn(\n 'Running with provided udid anyway, and type \"catalyst\". \\'xcodebuild\\' command may return error.',\n );\n }\n return runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n } else if (args.device) {\n let device = matchingDevice(devices, args.device);\n\n if (!device) {\n const deviceByUdid = devices.find((d) => d.udid === args.device);\n if (!deviceByUdid) {\n return logger.error(\n `Could not find a physical device with name or unique device identifier: \"${chalk.bold(\n args.device,\n )}\". ${printFoundDevices(devices, 'device')}`,\n );\n }\n\n device = deviceByUdid;\n\n if (deviceByUdid.type === 'simulator') {\n return logger.error(\n `The device with udid: \"${chalk.bold(\n args.device,\n )}\" is a simulator. If you want to run on a simulator, use the \"--simulator\" flag instead.`,\n );\n }\n }\n\n if (device && device.type === 'simulator') {\n return logger.error(\n \"`--device` flag is intended for physical devices. If you're trying to run on a simulator, use `--simulator` instead.\",\n );\n }\n\n if (device && device.type === 'device') {\n return runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n } else {\n runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n }\n };\n\nexport default createRun;\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;A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AA2EgC,gBAAK,CAACC,IAAI,CACpFpF,IAAI,CAAC4D,MAAM,CACX,MAAK,IAAAyB,iCAAiB,EAACtC,OAAO,EAAE,QAAQ,CAAE,EAAC,CAC9C;MACH;MAEAa,MAAM,GAAG2B,YAAY;MAErB,IAAIA,YAAY,CAACjB,IAAI,KAAK,WAAW,EAAE;QACrC,OAAOpB,kBAAM,CAACC,KAAK,CAChB,0BAAyBgC,gBAAK,CAACC,IAAI,CAClCpF,IAAI,CAAC4D,MAAM,CACX,0FAAyF,CAC5F;MACH;IACF;IAEA,IAAIA,MAAM,IAAIA,MAAM,CAACU,IAAI,KAAK,WAAW,EAAE;MACzC,OAAOpB,kBAAM,CAACC,KAAK,CACjB,sHAAsH,CACvH;IACH;IAEA,IAAIS,MAAM,IAAIA,MAAM,CAACU,IAAI,KAAK,QAAQ,EAAE;MACtC,OAAO,IAAAE,wBAAW,EAChBZ,MAAM,EACN/D,YAAY,EACZ2C,IAAI,EACJC,MAAM,EACNT,YAAY,EACZhC,IAAI,CACL;IACH;EACF,CAAC,MAAM;IACL,IAAAuE,8BAAc,EACZvC,YAAY,EACZnC,YAAY,EACZ2C,IAAI,EACJC,MAAM,EACNzC,IAAI,EACJ+D,iBAAiB,CAClB;EACH;AACF,CAAC;AAAC,eAEWnE,SAAS;AAAA"}
{"version":3,"file":"createRun.js","names":["getPackageJson","root","require","path","join","CLIError","createRun","platformName","_","ctx","args","link","setPlatform","platformConfig","project","sdkNames","readableName","platformReadableName","getPlatformInfo","undefined","supportedPlatforms","packager","port","installedPods","automaticPodsInstallation","forcePods","onlyPods","isAppRunningNewArchitecture","sourceDir","getArchitecture","resolvePods","dependencies","reactNativePath","forceInstall","newArchEnabled","newPort","startPackager","findDevServerPort","startServerInNewWindow","terminal","reactNativeVersion","setVersion","xcodeProject","getXcodeProjectAndDir","process","chdir","binaryPath","isAbsolute","fs","existsSync","mode","scheme","getConfiguration","buildOutput","buildProject","openApp","target","devices","listDevices","length","logger","error","packageJson","preferredDevice","cacheManager","get","name","preferredDeviceIndex","findIndex","udid","device","splice","unshift","fallbackSimulator","getFallbackSimulator","interactive","warn","selectedDevice","promptForDeviceSelection","set","type","runOnSimulator","runOnDevice","simulator","bootedSimulators","filter","state","bootedDevices","booted","info","map","find","d","pico","bold","printFoundDevices","matchingDevice","deviceByUdid"],"sources":["../../../src/commands/runCommand/createRun.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport pico from 'picocolors';\nimport {Config, IOSProjectConfig} from '@react-native-community/cli-types';\nimport {\n logger,\n CLIError,\n link,\n startServerInNewWindow,\n findDevServerPort,\n cacheManager,\n} from '@react-native-community/cli-tools';\nimport getArchitecture from '../../tools/getArchitecture';\nimport listDevices from '../../tools/listDevices';\nimport {promptForDeviceSelection} from '../../tools/prompts';\nimport {BuildFlags} from '../buildCommand/buildOptions';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {getConfiguration} from '../buildCommand/getConfiguration';\nimport {getXcodeProjectAndDir} from '../buildCommand/getXcodeProjectAndDir';\nimport {getFallbackSimulator} from './getFallbackSimulator';\nimport {getPlatformInfo} from './getPlatformInfo';\nimport {printFoundDevices, matchingDevice} from './matchingDevice';\nimport {runOnDevice} from './runOnDevice';\nimport {runOnSimulator} from './runOnSimulator';\nimport {BuilderCommand} from '../../types';\nimport {\n supportedPlatforms,\n resolvePods,\n} from '@react-native-community/cli-config-apple';\nimport openApp from './openApp';\n\nexport interface FlagsT extends BuildFlags {\n simulator?: string;\n udid?: string;\n binaryPath?: string;\n listDevices?: boolean;\n packager?: boolean;\n port: number;\n terminal?: string;\n}\n\nfunction getPackageJson(root: string) {\n try {\n return require(path.join(root, 'package.json'));\n } catch {\n throw new CLIError(\n 'No package.json found. Please make sure the file exists in the current folder.',\n );\n }\n}\n\nconst createRun =\n ({platformName}: BuilderCommand) =>\n async (_: Array<string>, ctx: Config, args: FlagsT) => {\n // React Native docs assume platform is always ios/android\n link.setPlatform('ios');\n const platformConfig = ctx.project[platformName] as IOSProjectConfig;\n const {sdkNames, readableName: platformReadableName} =\n getPlatformInfo(platformName);\n\n if (\n platformConfig === undefined ||\n supportedPlatforms[platformName] === undefined\n ) {\n throw new CLIError(\n `Unable to find ${platformReadableName} platform config`,\n );\n }\n\n let {packager, port} = args;\n let installedPods = false;\n // check if pods need to be installed\n if (\n platformConfig.automaticPodsInstallation ||\n args.forcePods ||\n args.onlyPods\n ) {\n const isAppRunningNewArchitecture = platformConfig.sourceDir\n ? await getArchitecture(platformConfig.sourceDir)\n : undefined;\n\n await resolvePods(\n ctx.root,\n platformConfig.sourceDir,\n ctx.dependencies,\n platformName,\n ctx.reactNativePath,\n {\n forceInstall: args.forcePods || args.onlyPods,\n newArchEnabled: isAppRunningNewArchitecture,\n },\n );\n\n installedPods = true;\n }\n\n if (args.onlyPods) {\n return;\n }\n\n if (packager) {\n const {port: newPort, startPackager} = await findDevServerPort(\n port,\n ctx.root,\n );\n\n if (startPackager) {\n await startServerInNewWindow(\n newPort,\n ctx.root,\n ctx.reactNativePath,\n args.terminal,\n );\n }\n }\n\n if (ctx.reactNativeVersion !== 'unknown') {\n link.setVersion(ctx.reactNativeVersion);\n }\n\n let {xcodeProject, sourceDir} = getXcodeProjectAndDir(\n platformConfig,\n platformName,\n installedPods,\n );\n\n process.chdir(sourceDir);\n\n if (args.binaryPath) {\n args.binaryPath = path.isAbsolute(args.binaryPath)\n ? args.binaryPath\n : path.join(ctx.root, args.binaryPath);\n\n if (!fs.existsSync(args.binaryPath)) {\n throw new CLIError(\n 'binary-path was specified, but the file was not found.',\n );\n }\n }\n\n const {mode, scheme} = await getConfiguration(\n xcodeProject,\n sourceDir,\n args,\n platformName,\n );\n\n if (platformName === 'macos') {\n const buildOutput = await buildProject(\n xcodeProject,\n platformName,\n undefined,\n mode,\n scheme,\n args,\n );\n\n openApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target: args.target,\n binaryPath: args.binaryPath,\n });\n\n return;\n }\n\n let devices = await listDevices(sdkNames);\n\n if (devices.length === 0) {\n return logger.error(\n `${platformReadableName} devices or simulators not detected. Install simulators via Xcode or connect a physical ${platformReadableName} device`,\n );\n }\n\n const packageJson = getPackageJson(ctx.root);\n\n const preferredDevice = cacheManager.get(\n packageJson.name,\n 'lastUsedIOSDeviceId',\n );\n\n if (preferredDevice) {\n const preferredDeviceIndex = devices.findIndex(\n ({udid}) => udid === preferredDevice,\n );\n\n if (preferredDeviceIndex > -1) {\n const [device] = devices.splice(preferredDeviceIndex, 1);\n devices.unshift(device);\n }\n }\n\n const fallbackSimulator =\n platformName === 'ios' || platformName === 'tvos'\n ? getFallbackSimulator(args)\n : devices[0];\n\n if (args.listDevices || args.interactive) {\n if (args.device || args.udid) {\n logger.warn(\n `Both ${\n args.device ? 'device' : 'udid'\n } and \"list-devices\" parameters were passed to \"run\" command. We will list available devices and let you choose from one.`,\n );\n }\n\n const selectedDevice = await promptForDeviceSelection(devices);\n\n if (!selectedDevice) {\n throw new CLIError(\n `Failed to select device, please try to run app without ${\n args.listDevices ? 'list-devices' : 'interactive'\n } command.`,\n );\n } else {\n if (selectedDevice.udid !== preferredDevice) {\n cacheManager.set(\n packageJson.name,\n 'lastUsedIOSDeviceId',\n selectedDevice.udid,\n );\n }\n }\n\n if (selectedDevice.type === 'simulator') {\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n selectedDevice,\n );\n } else {\n return runOnDevice(\n selectedDevice,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n }\n\n if (!args.device && !args.udid && !args.simulator) {\n const bootedSimulators = devices.filter(\n ({state, type}) => state === 'Booted' && type === 'simulator',\n );\n const bootedDevices = devices.filter(({type}) => type === 'device'); // Physical devices here are always booted\n const booted = [...bootedSimulators, ...bootedDevices];\n\n if (booted.length === 0) {\n logger.info(\n 'No booted devices or simulators found. Launching first available simulator...',\n );\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n }\n\n logger.info(`Found booted ${booted.map(({name}) => name).join(', ')}`);\n\n for (const simulator of bootedSimulators) {\n await runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n simulator || fallbackSimulator,\n );\n }\n\n for (const device of bootedDevices) {\n await runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n\n return;\n }\n\n if (args.device && args.udid) {\n return logger.error(\n 'The `device` and `udid` options are mutually exclusive.',\n );\n }\n\n if (args.udid) {\n let device = devices.find((d) => d.udid === args.udid);\n if (!device) {\n // We may be able to recover from this for macCatalyst app starts,\n // but the general case is this is a problem and device list will help\n logger.warn(\n `Could not find a device with udid: \"${pico.bold(\n args.udid,\n )}\". ${printFoundDevices(devices)}`,\n );\n }\n if (device?.type === 'simulator') {\n return runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n } else {\n if (!device) {\n // On arm64 machines, the catalyst UDID returned by 'xcrun xctrace list devices' is not correct\n // xcodebuild will return an error indicating the UDID is unknown and offering a different one\n // you may obtain it by running xcodebuild with the UDID you think works then parse out the other one from the returned error:\n // CATALYST_DESTINATION=$(xcodebuild -workspace ios/rnfbdemo.xcworkspace -configuration Debug -scheme rnfbdemo -destination id=7153382A-C92B-5798-BEA3-D82D195F25F8 2>&1|grep macOS|grep Catalyst|head -1 |cut -d':' -f5 |cut -d' ' -f1)\n //\n // How to handle the incorrect catalyst UDID?\n // Assume if a UDID is specified, the user knows what they are doing.\n // Use the given UDID and force the type, so \"catalyst\" will launch the app correctly\n device = {name: 'unknown', udid: args.udid, type: 'catalyst'};\n logger.warn(\n 'Running with provided udid anyway, and type \"catalyst\". \\'xcodebuild\\' command may return error.',\n );\n }\n return runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n } else if (args.device) {\n let device = matchingDevice(devices, args.device);\n\n if (!device) {\n const deviceByUdid = devices.find((d) => d.udid === args.device);\n if (!deviceByUdid) {\n return logger.error(\n `Could not find a physical device with name or unique device identifier: \"${pico.bold(\n typeof args.device === 'string' ? args.device : 'true',\n )}\". ${printFoundDevices(devices, 'device')}`,\n );\n }\n\n device = deviceByUdid;\n\n if (deviceByUdid.type === 'simulator') {\n return logger.error(\n `The device with udid: \"${pico.bold(\n typeof args.device === 'string' ? args.device : 'true',\n )}\" is a simulator. If you want to run on a simulator, use the \"--simulator\" flag instead.`,\n );\n }\n }\n\n if (device && device.type === 'simulator') {\n return logger.error(\n \"`--device` flag is intended for physical devices. If you're trying to run on a simulator, use `--simulator` instead.\",\n );\n }\n\n if (device && device.type === 'device') {\n return runOnDevice(\n device,\n platformName,\n mode,\n scheme,\n xcodeProject,\n args,\n );\n }\n } else {\n runOnSimulator(\n xcodeProject,\n platformName,\n mode,\n scheme,\n args,\n fallbackSimulator,\n );\n }\n };\n\nexport default createRun;\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;AAAgC;AArChC;AACA;AACA;AACA;AACA;AACA;AACA;;AA2CA,SAASA,cAAc,CAACC,IAAY,EAAE;EACpC,IAAI;IACF,OAAOC,OAAO,CAACC,eAAI,CAACC,IAAI,CAACH,IAAI,EAAE,cAAc,CAAC,CAAC;EACjD,CAAC,CAAC,MAAM;IACN,MAAM,KAAII,oBAAQ,EAChB,gFAAgF,CACjF;EACH;AACF;AAEA,MAAMC,SAAS,GACb,CAAC;EAACC;AAA4B,CAAC,KAC/B,OAAOC,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,kBAAM,CAACC,KAAK,CACjB,sHAAsH,CACvH;IACH;IAEA,IAAIS,MAAM,IAAIA,MAAM,CAACU,IAAI,KAAK,QAAQ,EAAE;MACtC,OAAO,IAAAE,wBAAW,EAChBZ,MAAM,EACN/D,YAAY,EACZ2C,IAAI,EACJC,MAAM,EACNT,YAAY,EACZhC,IAAI,CACL;IACH;EACF,CAAC,MAAM;IACL,IAAAuE,8BAAc,EACZvC,YAAY,EACZnC,YAAY,EACZ2C,IAAI,EACJC,MAAM,EACNzC,IAAI,EACJ+D,iBAAiB,CAClB;EACH;AACF,CAAC;AAAC,eAEWnE,SAAS;AAAA"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/getBuildPath.js.map
//# sourceMappingURL=getBuildPath.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getBuildPath","buildSettings","platform","isCatalyst","targetBuildDir","TARGET_BUILD_DIR","executableFolderPath","EXECUTABLE_FOLDER_PATH","fullProductName","FULL_PRODUCT_NAME","CLIError","buildPath","path","join","match","fs","existsSync"],"sources":["../../../src/commands/runCommand/getBuildPath.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport path from 'path';\nimport fs from 'fs';\nimport {BuildSettings} from './getBuildSettings';\nimport {ApplePlatform} from '../../types';\n\nexport async function getBuildPath(\n buildSettings: BuildSettings,\n platform: ApplePlatform = 'ios',\n isCatalyst: boolean = false,\n) {\n let targetBuildDir = buildSettings.TARGET_BUILD_DIR;\n const executableFolderPath = buildSettings.EXECUTABLE_FOLDER_PATH;\n const fullProductName = buildSettings.FULL_PRODUCT_NAME;\n\n if (!targetBuildDir) {\n throw new CLIError('Failed to get the target build directory.');\n }\n\n if (!executableFolderPath) {\n throw new CLIError('Failed to get the app name.');\n }\n\n if (!fullProductName) {\n throw new CLIError('Failed to get product name.');\n }\n\n // Default is platform == ios && isCatalyst == false\n let buildPath = path.join(targetBuildDir, executableFolderPath);\n\n // platform == ios && isCatalyst == true needs build path suffix,\n // but this regresses from time to time with suffix present or not\n // so check - there may be one already, or we may need to add suffix\n if (platform === 'ios' && isCatalyst) {\n // make sure path has one and only one '-maccatalyst' suffix on end\n if (!targetBuildDir.match(/-maccatalyst$/)) {\n targetBuildDir = `${targetBuildDir}-maccatalyst`;\n }\n buildPath = path.join(targetBuildDir, executableFolderPath);\n }\n\n // macOS gets the product name, not the executable folder path\n if (platform === 'macos') {\n buildPath = path.join(targetBuildDir, fullProductName);\n }\n\n // Make sure the directory exists and fail fast vs silently failing\n if (!fs.existsSync(targetBuildDir)) {\n throw new CLIError(\n `target build directory ${targetBuildDir} does not exist`,\n );\n }\n\n return buildPath;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAoB;AAIb,eAAeA,YAAY,CAChCC,aAA4B,EAC5BC,QAAuB,GAAG,KAAK,EAC/BC,UAAmB,GAAG,KAAK,EAC3B;EACA,IAAIC,cAAc,GAAGH,aAAa,CAACI,gBAAgB;EACnD,MAAMC,oBAAoB,GAAGL,aAAa,CAACM,sBAAsB;EACjE,MAAMC,eAAe,GAAGP,aAAa,CAACQ,iBAAiB;EAEvD,IAAI,CAACL,cAAc,EAAE;IACnB,MAAM,KAAIM,oBAAQ,EAAC,2CAA2C,CAAC;EACjE;EAEA,IAAI,CAACJ,oBAAoB,EAAE;IACzB,MAAM,KAAII,oBAAQ,EAAC,6BAA6B,CAAC;EACnD;EAEA,IAAI,CAACF,eAAe,EAAE;IACpB,MAAM,KAAIE,oBAAQ,EAAC,6BAA6B,CAAC;EACnD;;EAEA;EACA,IAAIC,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEE,oBAAoB,CAAC;;EAE/D;EACA;EACA;EACA,IAAIJ,QAAQ,KAAK,KAAK,IAAIC,UAAU,EAAE;IACpC;IACA,IAAI,CAACC,cAAc,CAACU,KAAK,CAAC,eAAe,CAAC,EAAE;MAC1CV,cAAc,GAAI,GAAEA,cAAe,cAAa;IAClD;IACAO,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEE,oBAAoB,CAAC;EAC7D;;EAEA;EACA,IAAIJ,QAAQ,KAAK,OAAO,EAAE;IACxBS,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEI,eAAe,CAAC;EACxD;;EAEA;EACA,IAAI,CAACO,aAAE,CAACC,UAAU,CAACZ,cAAc,CAAC,EAAE;IAClC,MAAM,KAAIM,oBAAQ,EACf,0BAAyBN,cAAe,iBAAgB,CAC1D;EACH;EAEA,OAAOO,SAAS;AAClB"}
{"version":3,"file":"getBuildPath.js","names":["getBuildPath","buildSettings","platform","isCatalyst","targetBuildDir","TARGET_BUILD_DIR","executableFolderPath","EXECUTABLE_FOLDER_PATH","fullProductName","FULL_PRODUCT_NAME","CLIError","buildPath","path","join","match","fs","existsSync"],"sources":["../../../src/commands/runCommand/getBuildPath.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport path from 'path';\nimport fs from 'fs';\nimport {BuildSettings} from './getBuildSettings';\nimport {ApplePlatform} from '../../types';\n\nexport async function getBuildPath(\n buildSettings: BuildSettings,\n platform: ApplePlatform = 'ios',\n isCatalyst: boolean = false,\n) {\n let targetBuildDir = buildSettings.TARGET_BUILD_DIR;\n const executableFolderPath = buildSettings.EXECUTABLE_FOLDER_PATH;\n const fullProductName = buildSettings.FULL_PRODUCT_NAME;\n\n if (!targetBuildDir) {\n throw new CLIError('Failed to get the target build directory.');\n }\n\n if (!executableFolderPath) {\n throw new CLIError('Failed to get the app name.');\n }\n\n if (!fullProductName) {\n throw new CLIError('Failed to get product name.');\n }\n\n // Default is platform == ios && isCatalyst == false\n let buildPath = path.join(targetBuildDir, executableFolderPath);\n\n // platform == ios && isCatalyst == true needs build path suffix,\n // but this regresses from time to time with suffix present or not\n // so check - there may be one already, or we may need to add suffix\n if (platform === 'ios' && isCatalyst) {\n // make sure path has one and only one '-maccatalyst' suffix on end\n if (!targetBuildDir.match(/-maccatalyst$/)) {\n targetBuildDir = `${targetBuildDir}-maccatalyst`;\n }\n buildPath = path.join(targetBuildDir, executableFolderPath);\n }\n\n // macOS gets the product name, not the executable folder path\n if (platform === 'macos') {\n buildPath = path.join(targetBuildDir, fullProductName);\n }\n\n // Make sure the directory exists and fail fast vs silently failing\n if (!fs.existsSync(targetBuildDir)) {\n throw new CLIError(\n `target build directory ${targetBuildDir} does not exist`,\n );\n }\n\n return buildPath;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAoB;AAIb,eAAeA,YAAY,CAChCC,aAA4B,EAC5BC,QAAuB,GAAG,KAAK,EAC/BC,UAAmB,GAAG,KAAK,EAC3B;EACA,IAAIC,cAAc,GAAGH,aAAa,CAACI,gBAAgB;EACnD,MAAMC,oBAAoB,GAAGL,aAAa,CAACM,sBAAsB;EACjE,MAAMC,eAAe,GAAGP,aAAa,CAACQ,iBAAiB;EAEvD,IAAI,CAACL,cAAc,EAAE;IACnB,MAAM,KAAIM,oBAAQ,EAAC,2CAA2C,CAAC;EACjE;EAEA,IAAI,CAACJ,oBAAoB,EAAE;IACzB,MAAM,KAAII,oBAAQ,EAAC,6BAA6B,CAAC;EACnD;EAEA,IAAI,CAACF,eAAe,EAAE;IACpB,MAAM,KAAIE,oBAAQ,EAAC,6BAA6B,CAAC;EACnD;;EAEA;EACA,IAAIC,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEE,oBAAoB,CAAC;;EAE/D;EACA;EACA;EACA,IAAIJ,QAAQ,KAAK,KAAK,IAAIC,UAAU,EAAE;IACpC;IACA,IAAI,CAACC,cAAc,CAACU,KAAK,CAAC,eAAe,CAAC,EAAE;MAC1CV,cAAc,GAAI,GAAEA,cAAe,cAAa;IAClD;IACAO,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEE,oBAAoB,CAAC;EAC7D;;EAEA;EACA,IAAIJ,QAAQ,KAAK,OAAO,EAAE;IACxBS,SAAS,GAAGC,eAAI,CAACC,IAAI,CAACT,cAAc,EAAEI,eAAe,CAAC;EACxD;;EAEA;EACA,IAAI,CAACO,aAAE,CAACC,UAAU,CAACZ,cAAc,CAAC,EAAE;IAClC,MAAM,KAAIM,oBAAQ,EACf,0BAAyBN,cAAe,iBAAgB,CAC1D;EACH;EAEA,OAAOO,SAAS;AAClB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"getBuildSettings.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/getBuildSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAIjE,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,cAAc,EAC5B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAiD/B"}
{"version":3,"file":"getBuildSettings.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/getBuildSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAIjE,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,cAAc,EAC5B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA2C/B"}

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

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

@@ -35,9 +35,12 @@ };

const settings = JSON.parse(buildSettings);
const targets = settings.map(({
// Find all 'app' targets in the build settings
const applicationTargets = settings.filter(setting => setting.buildSettings.WRAPPER_EXTENSION === 'app').map(({
target: settingsTarget
}) => settingsTarget);
let selectedTarget = targets[0];
if (applicationTargets.length === 0) return null;
let selectedTarget = applicationTargets[0];
if (target) {
if (!targets.includes(target)) {
_cliTools().logger.info(`Target ${_chalk().default.bold(target)} not found for scheme ${_chalk().default.bold(scheme)}, automatically selected target ${_chalk().default.bold(selectedTarget)}`);
if (!applicationTargets.includes(target)) {
_cliTools().logger.info(`Target ${_picocolors().default.bold(target)} not found for scheme ${_picocolors().default.bold(scheme)}, automatically selected target ${_picocolors().default.bold(selectedTarget)}`);
} else {

@@ -47,11 +50,4 @@ selectedTarget = target;

}
// Find app in all building settings - look for WRAPPER_EXTENSION: 'app',
const targetIndex = targets.indexOf(selectedTarget);
const targetSettings = settings[targetIndex].buildSettings;
const wrapperExtension = targetSettings.WRAPPER_EXTENSION;
if (wrapperExtension === 'app') {
return settings[targetIndex].buildSettings;
}
return null;
const targetIndex = applicationTargets.indexOf(selectedTarget);
return settings[targetIndex].buildSettings;
}

@@ -67,2 +63,2 @@ function getPlatformName(buildOutput) {

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/getBuildSettings.js.map
//# sourceMappingURL=getBuildSettings.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getBuildSettings","xcodeProject","mode","buildOutput","scheme","target","buildSettings","child_process","execFileSync","isWorkspace","name","getPlatformName","encoding","settings","JSON","parse","targets","map","settingsTarget","selectedTarget","includes","logger","info","chalk","bold","targetIndex","indexOf","targetSettings","wrapperExtension","WRAPPER_EXTENSION","platformNameMatch","exec","CLIError"],"sources":["../../../src/commands/runCommand/getBuildSettings.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport chalk from 'chalk';\nimport child_process from 'child_process';\n\nexport type BuildSettings = {\n TARGET_BUILD_DIR: string;\n INFOPLIST_PATH: string;\n EXECUTABLE_FOLDER_PATH: string;\n FULL_PRODUCT_NAME: string;\n};\n\nexport async function getBuildSettings(\n xcodeProject: IOSProjectInfo,\n mode: string,\n buildOutput: string,\n scheme: string,\n target?: string,\n): Promise<BuildSettings | null> {\n const buildSettings = child_process.execFileSync(\n 'xcodebuild',\n [\n xcodeProject.isWorkspace ? '-workspace' : '-project',\n xcodeProject.name,\n '-scheme',\n scheme,\n '-sdk',\n getPlatformName(buildOutput),\n '-configuration',\n mode,\n '-showBuildSettings',\n '-json',\n ],\n {encoding: 'utf8'},\n );\n\n const settings = JSON.parse(buildSettings);\n\n const targets = settings.map(\n ({target: settingsTarget}: any) => settingsTarget,\n );\n\n let selectedTarget = targets[0];\n\n if (target) {\n if (!targets.includes(target)) {\n logger.info(\n `Target ${chalk.bold(target)} not found for scheme ${chalk.bold(\n scheme,\n )}, automatically selected target ${chalk.bold(selectedTarget)}`,\n );\n } else {\n selectedTarget = target;\n }\n }\n\n // Find app in all building settings - look for WRAPPER_EXTENSION: 'app',\n const targetIndex = targets.indexOf(selectedTarget);\n const targetSettings = settings[targetIndex].buildSettings;\n\n const wrapperExtension = targetSettings.WRAPPER_EXTENSION;\n\n if (wrapperExtension === 'app') {\n return settings[targetIndex].buildSettings;\n }\n\n return null;\n}\n\nfunction getPlatformName(buildOutput: string) {\n // Xcode can sometimes escape `=` with a backslash or put the value in quotes\n const platformNameMatch = /export PLATFORM_NAME\\\\?=\"?(\\w+)\"?$/m.exec(\n buildOutput,\n );\n if (!platformNameMatch) {\n throw new CLIError(\n 'Couldn\\'t find \"PLATFORM_NAME\" variable in xcodebuild output. Please report this issue and run your project with Xcode instead.',\n );\n }\n return platformNameMatch[1];\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0C;AASnC,eAAeA,gBAAgB,CACpCC,YAA4B,EAC5BC,IAAY,EACZC,WAAmB,EACnBC,MAAc,EACdC,MAAe,EACgB;EAC/B,MAAMC,aAAa,GAAGC,wBAAa,CAACC,YAAY,CAC9C,YAAY,EACZ,CACEP,YAAY,CAACQ,WAAW,GAAG,YAAY,GAAG,UAAU,EACpDR,YAAY,CAACS,IAAI,EACjB,SAAS,EACTN,MAAM,EACN,MAAM,EACNO,eAAe,CAACR,WAAW,CAAC,EAC5B,gBAAgB,EAChBD,IAAI,EACJ,oBAAoB,EACpB,OAAO,CACR,EACD;IAACU,QAAQ,EAAE;EAAM,CAAC,CACnB;EAED,MAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACT,aAAa,CAAC;EAE1C,MAAMU,OAAO,GAAGH,QAAQ,CAACI,GAAG,CAC1B,CAAC;IAACZ,MAAM,EAAEa;EAAmB,CAAC,KAAKA,cAAc,CAClD;EAED,IAAIC,cAAc,GAAGH,OAAO,CAAC,CAAC,CAAC;EAE/B,IAAIX,MAAM,EAAE;IACV,IAAI,CAACW,OAAO,CAACI,QAAQ,CAACf,MAAM,CAAC,EAAE;MAC7BgB,kBAAM,CAACC,IAAI,CACR,UAASC,gBAAK,CAACC,IAAI,CAACnB,MAAM,CAAE,yBAAwBkB,gBAAK,CAACC,IAAI,CAC7DpB,MAAM,CACN,mCAAkCmB,gBAAK,CAACC,IAAI,CAACL,cAAc,CAAE,EAAC,CACjE;IACH,CAAC,MAAM;MACLA,cAAc,GAAGd,MAAM;IACzB;EACF;;EAEA;EACA,MAAMoB,WAAW,GAAGT,OAAO,CAACU,OAAO,CAACP,cAAc,CAAC;EACnD,MAAMQ,cAAc,GAAGd,QAAQ,CAACY,WAAW,CAAC,CAACnB,aAAa;EAE1D,MAAMsB,gBAAgB,GAAGD,cAAc,CAACE,iBAAiB;EAEzD,IAAID,gBAAgB,KAAK,KAAK,EAAE;IAC9B,OAAOf,QAAQ,CAACY,WAAW,CAAC,CAACnB,aAAa;EAC5C;EAEA,OAAO,IAAI;AACb;AAEA,SAASK,eAAe,CAACR,WAAmB,EAAE;EAC5C;EACA,MAAM2B,iBAAiB,GAAG,qCAAqC,CAACC,IAAI,CAClE5B,WAAW,CACZ;EACD,IAAI,CAAC2B,iBAAiB,EAAE;IACtB,MAAM,KAAIE,oBAAQ,EAChB,iIAAiI,CAClI;EACH;EACA,OAAOF,iBAAiB,CAAC,CAAC,CAAC;AAC7B"}
{"version":3,"file":"getBuildSettings.js","names":["getBuildSettings","xcodeProject","mode","buildOutput","scheme","target","buildSettings","child_process","execFileSync","isWorkspace","name","getPlatformName","encoding","settings","JSON","parse","applicationTargets","filter","setting","WRAPPER_EXTENSION","map","settingsTarget","length","selectedTarget","includes","logger","info","pico","bold","targetIndex","indexOf","platformNameMatch","exec","CLIError"],"sources":["../../../src/commands/runCommand/getBuildSettings.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport pico from 'picocolors';\nimport child_process from 'child_process';\n\nexport type BuildSettings = {\n TARGET_BUILD_DIR: string;\n INFOPLIST_PATH: string;\n EXECUTABLE_FOLDER_PATH: string;\n FULL_PRODUCT_NAME: string;\n};\n\nexport async function getBuildSettings(\n xcodeProject: IOSProjectInfo,\n mode: string,\n buildOutput: string,\n scheme: string,\n target?: string,\n): Promise<BuildSettings | null> {\n const buildSettings = child_process.execFileSync(\n 'xcodebuild',\n [\n xcodeProject.isWorkspace ? '-workspace' : '-project',\n xcodeProject.name,\n '-scheme',\n scheme,\n '-sdk',\n getPlatformName(buildOutput),\n '-configuration',\n mode,\n '-showBuildSettings',\n '-json',\n ],\n {encoding: 'utf8'},\n );\n\n const settings = JSON.parse(buildSettings);\n\n // Find all 'app' targets in the build settings\n const applicationTargets = settings\n .filter((setting: any) => setting.buildSettings.WRAPPER_EXTENSION === 'app')\n .map(({target: settingsTarget}: any) => settingsTarget);\n\n if (applicationTargets.length === 0) return null;\n\n let selectedTarget = applicationTargets[0];\n\n if (target) {\n if (!applicationTargets.includes(target)) {\n logger.info(\n `Target ${pico.bold(target)} not found for scheme ${pico.bold(\n scheme,\n )}, automatically selected target ${pico.bold(selectedTarget)}`,\n );\n } else {\n selectedTarget = target;\n }\n }\n\n const targetIndex = applicationTargets.indexOf(selectedTarget);\n return settings[targetIndex].buildSettings;\n}\n\nfunction getPlatformName(buildOutput: string) {\n // Xcode can sometimes escape `=` with a backslash or put the value in quotes\n const platformNameMatch = /export PLATFORM_NAME\\\\?=\"?(\\w+)\"?$/m.exec(\n buildOutput,\n );\n if (!platformNameMatch) {\n throw new CLIError(\n 'Couldn\\'t find \"PLATFORM_NAME\" variable in xcodebuild output. Please report this issue and run your project with Xcode instead.',\n );\n }\n return platformNameMatch[1];\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0C;AASnC,eAAeA,gBAAgB,CACpCC,YAA4B,EAC5BC,IAAY,EACZC,WAAmB,EACnBC,MAAc,EACdC,MAAe,EACgB;EAC/B,MAAMC,aAAa,GAAGC,wBAAa,CAACC,YAAY,CAC9C,YAA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,iBAAiB,EAAE;IACtB,MAAM,KAAIE,oBAAQ,EAChB,iIAAiI,CAClI;EACH;EACA,OAAOF,iBAAiB,CAAC,CAAC,CAAC;AAC7B"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/getFallbackSimulator.js.map
//# sourceMappingURL=getFallbackSimulator.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getFallbackSimulator","args","fallbackSimulators","selectedSimulator","getDestinationSimulator","CLIError","simulator","udid"],"sources":["../../../src/commands/runCommand/getFallbackSimulator.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport {getDestinationSimulator} from '../../tools/getDestinationSimulator';\nimport {Device} from '../../types';\nimport {FlagsT} from './createRun';\n\nexport function getFallbackSimulator(args: FlagsT): Device {\n /**\n * If provided simulator does not exist, try simulators in following order\n * - iPhone 14\n * - iPhone 13\n * - iPhone 12\n * - iPhone 11\n */\n\n const fallbackSimulators = [\n 'iPhone 14',\n 'iPhone 13',\n 'iPhone 12',\n 'iPhone 11',\n ];\n const selectedSimulator = getDestinationSimulator(args, fallbackSimulators);\n\n if (!selectedSimulator) {\n throw new CLIError(\n `No simulator available with ${\n args.simulator ? `name \"${args.simulator}\"` : `udid \"${args.udid}\"`\n }`,\n );\n }\n\n return selectedSimulator;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAIO,SAASA,oBAAoB,CAACC,IAAY,EAAU;EACzD;AACF;AACA;AACA;AACA;AACA;AACA;;EAEE,MAAMC,kBAAkB,GAAG,CACzB,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,CACZ;EACD,MAAMC,iBAAiB,GAAG,IAAAC,gDAAuB,EAACH,IAAI,EAAEC,kBAAkB,CAAC;EAE3E,IAAI,CAACC,iBAAiB,EAAE;IACtB,MAAM,KAAIE,oBAAQ,EACf,+BACCJ,IAAI,CAACK,SAAS,GAAI,SAAQL,IAAI,CAACK,SAAU,GAAE,GAAI,SAAQL,IAAI,CAACM,IAAK,GAClE,EAAC,CACH;EACH;EAEA,OAAOJ,iBAAiB;AAC1B"}
{"version":3,"file":"getFallbackSimulator.js","names":["getFallbackSimulator","args","fallbackSimulators","selectedSimulator","getDestinationSimulator","CLIError","simulator","udid"],"sources":["../../../src/commands/runCommand/getFallbackSimulator.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport {getDestinationSimulator} from '../../tools/getDestinationSimulator';\nimport {Device} from '../../types';\nimport {FlagsT} from './createRun';\n\nexport function getFallbackSimulator(args: FlagsT): Device {\n /**\n * If provided simulator does not exist, try simulators in following order\n * - iPhone 14\n * - iPhone 13\n * - iPhone 12\n * - iPhone 11\n */\n\n const fallbackSimulators = [\n 'iPhone 14',\n 'iPhone 13',\n 'iPhone 12',\n 'iPhone 11',\n ];\n const selectedSimulator = getDestinationSimulator(args, fallbackSimulators);\n\n if (!selectedSimulator) {\n throw new CLIError(\n `No simulator available with ${\n args.simulator ? `name \"${args.simulator}\"` : `udid \"${args.udid}\"`\n }`,\n );\n }\n\n return selectedSimulator;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAIO,SAASA,oBAAoB,CAACC,IAAY,EAAU;EACzD;AACF;AACA;AACA;AACA;AACA;AACA;;EAEE,MAAMC,kBAAkB,GAAG,CACzB,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,CACZ;EACD,MAAMC,iBAAiB,GAAG,IAAAC,gDAAuB,EAACH,IAAI,EAAEC,kBAAkB,CAAC;EAE3E,IAAI,CAACC,iBAAiB,EAAE;IACtB,MAAM,KAAIE,oBAAQ,EACf,+BACCJ,IAAI,CAACK,SAAS,GAAI,SAAQL,IAAI,CAACK,SAAU,GAAE,GAAI,SAAQL,IAAI,CAACM,IAAK,GAClE,EAAC,CACH;EACH;EAEA,OAAOJ,iBAAiB;AAC1B"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/getPlatformInfo.js.map
//# sourceMappingURL=getPlatformInfo.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getPlatformInfo","platform","iosPlatformInfo","readableName","sdkNames"],"sources":["../../../src/commands/runCommand/getPlatformInfo.ts"],"sourcesContent":["import {ApplePlatform} from '../../types';\n\ninterface PlatformInfo {\n readableName: string;\n sdkNames: string[];\n}\n\n/**\n * Returns platform readable name and list of SDKs for given platform.\n * We can get list of SDKs from `xcodebuild -showsdks` command.\n *\n * Falls back to iOS if platform is not supported.\n */\nexport function getPlatformInfo(platform: ApplePlatform): PlatformInfo {\n const iosPlatformInfo: PlatformInfo = {\n readableName: 'iOS',\n sdkNames: ['iphonesimulator', 'iphoneos'],\n };\n\n switch (platform) {\n case 'ios':\n return iosPlatformInfo;\n case 'tvos':\n return {\n readableName: 'tvOS',\n sdkNames: ['appletvsimulator', 'appletvos'],\n };\n case 'visionos':\n return {\n readableName: 'visionOS',\n sdkNames: ['xrsimulator', 'xros'],\n };\n case 'macos':\n return {\n readableName: 'macOS',\n sdkNames: ['macosx'],\n };\n default:\n return iosPlatformInfo;\n }\n}\n"],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAe,CAACC,QAAuB,EAAgB;EACrE,MAAMC,eAA6B,GAAG;IACpCC,YAAY,EAAE,KAAK;IACnBC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,UAAU;EAC1C,CAAC;EAED,QAAQH,QAAQ;IACd,KAAK,KAAK;MACR,OAAOC,eAAe;IACxB,KAAK,MAAM;MACT,OAAO;QACLC,YAAY,EAAE,MAAM;QACpBC,QAAQ,EAAE,CAAC,kBAAkB,EAAE,WAAW;MAC5C,CAAC;IACH,KAAK,UAAU;MACb,OAAO;QACLD,YAAY,EAAE,UAAU;QACxBC,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM;MAClC,CAAC;IACH,KAAK,OAAO;MACV,OAAO;QACLD,YAAY,EAAE,OAAO;QACrBC,QAAQ,EAAE,CAAC,QAAQ;MACrB,CAAC;IACH;MACE,OAAOF,eAAe;EAAC;AAE7B"}
{"version":3,"file":"getPlatformInfo.js","names":["getPlatformInfo","platform","iosPlatformInfo","readableName","sdkNames"],"sources":["../../../src/commands/runCommand/getPlatformInfo.ts"],"sourcesContent":["import {ApplePlatform} from '../../types';\n\ninterface PlatformInfo {\n readableName: string;\n sdkNames: string[];\n}\n\n/**\n * Returns platform readable name and list of SDKs for given platform.\n * We can get list of SDKs from `xcodebuild -showsdks` command.\n *\n * Falls back to iOS if platform is not supported.\n */\nexport function getPlatformInfo(platform: ApplePlatform): PlatformInfo {\n const iosPlatformInfo: PlatformInfo = {\n readableName: 'iOS',\n sdkNames: ['iphonesimulator', 'iphoneos'],\n };\n\n switch (platform) {\n case 'ios':\n return iosPlatformInfo;\n case 'tvos':\n return {\n readableName: 'tvOS',\n sdkNames: ['appletvsimulator', 'appletvos'],\n };\n case 'visionos':\n return {\n readableName: 'visionOS',\n sdkNames: ['xrsimulator', 'xros'],\n };\n case 'macos':\n return {\n readableName: 'macOS',\n sdkNames: ['macosx'],\n };\n default:\n return iosPlatformInfo;\n }\n}\n"],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAe,CAACC,QAAuB,EAAgB;EACrE,MAAMC,eAA6B,GAAG;IACpCC,YAAY,EAAE,KAAK;IACnBC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,UAAU;EAC1C,CAAC;EAED,QAAQH,QAAQ;IACd,KAAK,KAAK;MACR,OAAOC,eAAe;IACxB,KAAK,MAAM;MACT,OAAO;QACLC,YAAY,EAAE,MAAM;QACpBC,QAAQ,EAAE,CAAC,kBAAkB,EAAE,WAAW;MAC5C,CAAC;IACH,KAAK,UAAU;MACb,OAAO;QACLD,YAAY,EAAE,UAAU;QACxBC,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM;MAClC,CAAC;IACH,KAAK,OAAO;MACV,OAAO;QACLD,YAAY,EAAE,OAAO;QACrBC,QAAQ,EAAE,CAAC,QAAQ;MACrB,CAAC;IACH;MACE,OAAOF,eAAe;EAAC;AAE7B"}

@@ -1,1 +0,1 @@

{"version":3,"file":"installApp.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/installApp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAKjE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAc1C,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAA8B,UAAU,CAAC,EACvC,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAkB,GACnB,EAAE,OAAO,iBAmET"}
{"version":3,"file":"installApp.d.ts","sourceRoot":"","sources":["../../../src/commands/runCommand/installApp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAKjE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAc1C,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAA8B,UAAU,CAAC,EACvC,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAkB,GACnB,EAAE,OAAO,iBAkET"}

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

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

@@ -67,3 +67,4 @@ };

const infoPlistPath = buildSettings.INFOPLIST_PATH;
if (!infoPlistPath) {
const plistPath = appPath ? _path().default.join(appPath, 'Info.plist') : _path().default.join(targetBuildDir, infoPlistPath);
if (!plistPath) {
throw new (_cliTools().CLIError)('Failed to find Info.plist');

@@ -74,3 +75,3 @@ }

}
_cliTools().logger.info(`Installing "${_chalk().default.bold(appPath)}`);
_cliTools().logger.info(`Installing "${_picocolors().default.bold(appPath)}`);
if (udid && appPath) {

@@ -82,6 +83,6 @@ const installParameters = isSimulator ? ['simctl', 'install', udid, appPath] : ['devicectl', 'device', 'install', 'app', '--device', udid, appPath];

}
const bundleID = _child_process().default.execFileSync('/usr/libexec/PlistBuddy', ['-c', 'Print:CFBundleIdentifier', _path().default.join(targetBuildDir, infoPlistPath)], {
const bundleID = _child_process().default.execFileSync('/usr/libexec/PlistBuddy', ['-c', 'Print:CFBundleIdentifier', plistPath], {
encoding: 'utf8'
}).trim();
_cliTools().logger.info(`Launching "${_chalk().default.bold(bundleID)}"`);
_cliTools().logger.info(`Launching "${_picocolors().default.bold(bundleID)}"`);
const launchParameters = isSimulator ? ['simctl', 'launch', udid, bundleID] : ['devicectl', 'device', 'process', 'launch', '--device', udid, bundleID];

@@ -92,2 +93,2 @@ const result = _child_process().default.spawnSync('xcrun', launchParameters);

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/installApp.js.map
//# sourceMappingURL=installApp.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["handleLaunchResult","success","errorMessage","errorDetails","logger","error","installApp","buildOutput","xcodeProject","mode","scheme","target","udid","binaryPath","platform","isSimulator","appPath","buildSettings","getBuildSettings","CLIError","getBuildPath","targetBuildDir","TARGET_BUILD_DIR","infoPlistPath","INFOPLIST_PATH","info","chalk","bold","installParameters","child_process","spawnSync","stdio","bundleID","execFileSync","path","join","encoding","trim","launchParameters","result","status","stderr","toString"],"sources":["../../../src/commands/runCommand/installApp.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport chalk from 'chalk';\nimport {getBuildPath} from './getBuildPath';\nimport {getBuildSettings} from './getBuildSettings';\nimport path from 'path';\nimport {ApplePlatform} from '../../types';\n\nfunction handleLaunchResult(\n success: boolean,\n errorMessage: string,\n errorDetails = '',\n) {\n if (success) {\n logger.success('Successfully launched the app');\n } else {\n logger.error(errorMessage, errorDetails);\n }\n}\n\ntype Options = {\n buildOutput: string;\n xcodeProject: IOSProjectInfo;\n mode: string;\n scheme: string;\n target?: string;\n udid: string;\n binaryPath?: string;\n platform?: ApplePlatform;\n isSimulator?: boolean;\n};\n\nexport default async function installApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target,\n udid,\n binaryPath,\n platform,\n isSimulator = true,\n}: Options) {\n let appPath = binaryPath;\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n target,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n if (!appPath) {\n appPath = await getBuildPath(buildSettings, platform);\n }\n\n const targetBuildDir = buildSettings.TARGET_BUILD_DIR;\n const infoPlistPath = buildSettings.INFOPLIST_PATH;\n\n if (!infoPlistPath) {\n throw new CLIError('Failed to find Info.plist');\n }\n\n if (!targetBuildDir) {\n throw new CLIError('Failed to get target build directory.');\n }\n\n logger.info(`Installing \"${chalk.bold(appPath)}`);\n\n if (udid && appPath) {\n const installParameters = isSimulator\n ? ['simctl', 'install', udid, appPath]\n : ['devicectl', 'device', 'install', 'app', '--device', udid, appPath];\n\n child_process.spawnSync('xcrun', installParameters, {\n stdio: 'inherit',\n });\n }\n\n const bundleID = child_process\n .execFileSync(\n '/usr/libexec/PlistBuddy',\n [\n '-c',\n 'Print:CFBundleIdentifier',\n path.join(targetBuildDir, infoPlistPath),\n ],\n {encoding: 'utf8'},\n )\n .trim();\n\n logger.info(`Launching \"${chalk.bold(bundleID)}\"`);\n\n const launchParameters = isSimulator\n ? ['simctl', 'launch', udid, bundleID]\n : ['devicectl', 'device', 'process', 'launch', '--device', udid, bundleID];\n\n const result = child_process.spawnSync('xcrun', launchParameters);\n\n handleLaunchResult(\n result.status === 0,\n 'Failed to launch the app on simulator',\n result.stderr.toString(),\n );\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAGxB,SAASA,kBAAkB,CACzBC,OAAgB,EAChBC,YAAoB,EACpBC,YAAY,GAAG,EAAE,EACjB;EACA,IAAIF,OAAO,EAAE;IACXG,kBAAM,CAACH,OAAO,CAAC,+BAA+B,CAAC;EACjD,CAAC,MAAM;IACLG,kBAAM,CAACC,KAAK,CAACH,YAAY,EAAEC,YAAY,CAAC;EAC1C;AACF;AAce,eAAeG,UAAU,CAAC;EACvCC,WAAW;EACXC,YAAY;EACZC,IAAI;EACJC,MAAM;EACNC,MAAM;EACNC,IAAI;EACJC,UAAU;EACVC,QAAQ;EACRC,WAAW,GAAG;AACP,CAAC,EAAE;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ACAC,IAAI,EAAE;EAETjC,kBAAM,CAACqB,IAAI,CAAE,cAAaC,gBAAK,CAACC,IAAI,CAACK,QAAQ,CAAE,GAAE,CAAC;EAElD,MAAMM,gBAAgB,GAAGvB,WAAW,GAChC,CAAC,QAAQ,EAAE,QAAQ,EAAEH,IAAI,EAAEoB,QAAQ,CAAC,GACpC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAEpB,IAAI,EAAEoB,QAAQ,CAAC;EAE5E,MAAMO,MAAM,GAAGV,wBAAa,CAACC,SAAS,CAAC,OAAO,EAAEQ,gBAAgB,CAAC;EAEjEtC,kBAAkB,CAChBuC,MAAM,CAACC,MAAM,KAAK,CAAC,EACnB,uCAAuC,EACvCD,MAAM,CAACE,MAAM,CAACC,QAAQ,EAAE,CACzB;AACH"}
{"version":3,"file":"installApp.js","names":["handleLaunchResult","success","errorMessage","errorDetails","logger","error","installApp","buildOutput","xcodeProject","mode","scheme","target","udid","binaryPath","platform","isSimulator","appPath","buildSettings","getBuildSettings","CLIError","getBuildPath","targetBuildDir","TARGET_BUILD_DIR","infoPlistPath","INFOPLIST_PATH","plistPath","path","join","info","pico","bold","installParameters","child_process","spawnSync","stdio","bundleID","execFileSync","encoding","trim","launchParameters","result","status","stderr","toString"],"sources":["../../../src/commands/runCommand/installApp.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport pico from 'picocolors';\nimport {getBuildPath} from './getBuildPath';\nimport {getBuildSettings} from './getBuildSettings';\nimport path from 'path';\nimport {ApplePlatform} from '../../types';\n\nfunction handleLaunchResult(\n success: boolean,\n errorMessage: string,\n errorDetails = '',\n) {\n if (success) {\n logger.success('Successfully launched the app');\n } else {\n logger.error(errorMessage, errorDetails);\n }\n}\n\ntype Options = {\n buildOutput: string;\n xcodeProject: IOSProjectInfo;\n mode: string;\n scheme: string;\n target?: string;\n udid: string;\n binaryPath?: string;\n platform?: ApplePlatform;\n isSimulator?: boolean;\n};\n\nexport default async function installApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target,\n udid,\n binaryPath,\n platform,\n isSimulator = true,\n}: Options) {\n let appPath = binaryPath;\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n target,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n if (!appPath) {\n appPath = await getBuildPath(buildSettings, platform);\n }\n\n const targetBuildDir = buildSettings.TARGET_BUILD_DIR;\n const infoPlistPath = buildSettings.INFOPLIST_PATH;\n\n const plistPath = appPath\n ? path.join(appPath, 'Info.plist')\n : path.join(targetBuildDir, infoPlistPath);\n if (!plistPath) {\n throw new CLIError('Failed to find Info.plist');\n }\n\n if (!targetBuildDir) {\n throw new CLIError('Failed to get target build directory.');\n }\n\n logger.info(`Installing \"${pico.bold(appPath)}`);\n\n if (udid && appPath) {\n const installParameters = isSimulator\n ? ['simctl', 'install', udid, appPath]\n : ['devicectl', 'device', 'install', 'app', '--device', udid, appPath];\n\n child_process.spawnSync('xcrun', installParameters, {\n stdio: 'inherit',\n });\n }\n\n const bundleID = child_process\n .execFileSync(\n '/usr/libexec/PlistBuddy',\n ['-c', 'Print:CFBundleIdentifier', plistPath],\n {encoding: 'utf8'},\n )\n .trim();\n\n logger.info(`Launching \"${pico.bold(bundleID)}\"`);\n\n const launchParameters = isSimulator\n ? ['simctl', 'launch', udid, bundleID]\n : ['devicectl', 'device', 'process', 'launch', '--device', udid, bundleID];\n\n const result = child_process.spawnSync('xcrun', launchParameters);\n\n handleLaunchResult(\n result.status === 0,\n 'Failed to launch the app on simulator',\n result.stderr.toString(),\n );\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;A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cC,qBAAI,CAACC,IAAI,CAACd,OAAO,CAAE,EAAC,CAAC;EAEhD,IAAIJ,IAAI,IAAII,OAAO,EAAE;IACnB,MAAMe,iBAAiB,GAAGhB,WAAW,GACjC,CAAC,QAAQ,EAAE,SAAS,EAAEH,IAAI,EAAEI,OAAO,CAAC,GACpC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAEJ,IAAI,EAAEI,OAAO,CAAC;IAExEgB,wBAAa,CAACC,SAAS,CAAC,OAAO,EAAEF,iBAAiB,EAAE;MAClDG,KAAK,EAAE;IACT,CAAC,CAAC;EACJ;EAEA,MAAMC,QAAQ,GAAGH,wBAAa,CAC3BI,YAAY,CACX,yBAAyB,EACzB,CAAC,IAAI,EAAE,0BAA0B,EAAEX,SAAS,CAAC,EAC7C;IAACY,QAAQ,EAAE;EAAM,CAAC,CACnB,CACAC,IAAI,EAAE;EAETlC,kBAAM,CAACwB,IAAI,CAAE,cAAaC,qBAAI,CAACC,IAAI,CAACK,QAAQ,CAAE,GAAE,CAAC;EAEjD,MAAMI,gBAAgB,GAAGxB,WAAW,GAChC,CAAC,QAAQ,EAAE,QAAQ,EAAEH,IAAI,EAAEuB,QAAQ,CAAC,GACpC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAEvB,IAAI,EAAEuB,QAAQ,CAAC;EAE5E,MAAMK,MAAM,GAAGR,wBAAa,CAACC,SAAS,CAAC,OAAO,EAAEM,gBAAgB,CAAC;EAEjEvC,kBAAkB,CAChBwC,MAAM,CAACC,MAAM,KAAK,CAAC,EACnB,uCAAuC,EACvCD,MAAM,CAACE,MAAM,CAACC,QAAQ,EAAE,CACzB;AACH"}

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

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

@@ -30,3 +30,3 @@ };

if (firstIOSDevice) {
_cliTools().logger.info(`Using first available device named "${_chalk().default.bold(firstIOSDevice.name)}" due to lack of name supplied.`);
_cliTools().logger.info(`Using first available device named "${_picocolors().default.bold(firstIOSDevice.name)}" due to lack of name supplied.`);
return firstIOSDevice;

@@ -54,2 +54,2 @@ } else {

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/matchingDevice.js.map
//# sourceMappingURL=matchingDevice.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["matchingDevice","devices","deviceName","firstIOSDevice","find","d","type","logger","info","chalk","bold","name","error","undefined","device","formattedDeviceName","simulator","version","printFoundDevices","filteredDevice","filter","map","udid","join"],"sources":["../../../src/commands/runCommand/matchingDevice.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport chalk from 'chalk';\nimport {Device, DeviceType} from '../../types';\n\nexport function matchingDevice(\n devices: Array<Device>,\n deviceName: string | true | undefined,\n) {\n // The condition specifically checks if the value is `true`, not just truthy to allow for `--device` flag without a value\n if (deviceName === true) {\n const firstIOSDevice = devices.find((d) => d.type === 'device')!;\n if (firstIOSDevice) {\n logger.info(\n `Using first available device named \"${chalk.bold(\n firstIOSDevice.name,\n )}\" due to lack of name supplied.`,\n );\n return firstIOSDevice;\n } else {\n logger.error('No iOS devices connected.');\n return undefined;\n }\n }\n return devices.find(\n (device) =>\n device.name === deviceName || formattedDeviceName(device) === deviceName,\n );\n}\n\nexport function formattedDeviceName(simulator: Device) {\n return simulator.version\n ? `${simulator.name} (${simulator.version})`\n : simulator.name;\n}\n\nexport function printFoundDevices(devices: Array<Device>, type?: DeviceType) {\n let filteredDevice = [...devices];\n\n if (type) {\n filteredDevice = filteredDevice.filter((device) => device.type === type);\n }\n\n return [\n 'Available devices:',\n ...filteredDevice.map(({name, udid}) => ` - ${name} (${udid})`),\n ].join('\\n');\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;E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chingDevice.js","names":["matchingDevice","devices","deviceName","firstIOSDevice","find","d","type","logger","info","pico","bold","name","error","undefined","device","formattedDeviceName","simulator","version","printFoundDevices","filteredDevice","filter","map","udid","join"],"sources":["../../../src/commands/runCommand/matchingDevice.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport pico from 'picocolors';\nimport {Device, DeviceType} from '../../types';\n\nexport function matchingDevice(\n devices: Array<Device>,\n deviceName: string | true | undefined,\n) {\n // The condition specifically checks if the value is `true`, not just truthy to allow for `--device` flag without a value\n if (deviceName === true) {\n const firstIOSDevice = devices.find((d) => d.type === 'device')!;\n if (firstIOSDevice) {\n logger.info(\n `Using first available device named \"${pico.bold(\n firstIOSDevice.name,\n )}\" due to lack of name supplied.`,\n );\n return firstIOSDevice;\n } else {\n logger.error('No iOS devices connected.');\n return undefined;\n }\n }\n return devices.find(\n (device) =>\n device.name === deviceName || formattedDeviceName(device) === deviceName,\n );\n}\n\nexport function formattedDeviceName(simulator: Device) {\n return simulator.version\n ? `${simulator.name} (${simulator.version})`\n : simulator.name;\n}\n\nexport function printFoundDevices(devices: Array<Device>, type?: DeviceType) {\n let filteredDevice = [...devices];\n\n if (type) {\n filteredDevice = filteredDevice.filter((device) => device.type === type);\n }\n\n return [\n 'Available devices:',\n ...filteredDevice.map(({name, udid}) => ` - ${name} (${udid})`),\n ].join('\\n');\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8B;AAGvB,SAASA,cAAc,CAC5BC,OAAsB,EACtBC,UAAqC,EACrC;EACA;EACA,IAAIA,UAAU,KAAK,IAAI,EAAE;IACvB,MAAMC,cAAc,GAAGF,OAAO,CAACG,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,KAAK,QAAQ,CAAE;IAChE,IAAIH,cAAc,EAAE;MAClBI,kBAAM,CAACC,IAAI,CACR,uCAAsCC,qBAAI,CAACC,IAAI,CAC9CP,cAAc,CAACQ,IAAI,CACnB,iCAAgC,CACnC;MACD,OAAOR,cAAc;IACvB,CAAC,MAAM;MACLI,kBAAM,CAACK,KAAK,CAAC,2BAA2B,CAAC;MACzC,OAAOC,SAAS;IAClB;EACF;EACA,OAAOZ,OAAO,CAACG,IAAI,CAChBU,MAAM,IACLA,MAAM,CAACH,IAAI,KAAKT,UAAU,IAAIa,mBAAmB,CAACD,MAAM,CAAC,KAAKZ,UAAU,CAC3E;AACH;AAEO,SAASa,mBAAmB,CAACC,SAAiB,EAAE;EACrD,OAAOA,SAAS,CAACC,OAAO,GACnB,GAAED,SAAS,CAACL,IAAK,KAAIK,SAAS,CAACC,OAAQ,GAAE,GAC1CD,SAAS,CAACL,IAAI;AACpB;AAEO,SAASO,iBAAiB,CAACjB,OAAsB,EAAEK,IAAiB,EAAE;EAC3E,IAAIa,cAAc,GAAG,CAAC,GAAGlB,OAAO,CAAC;EAEjC,IAAIK,IAAI,EAAE;IACRa,cAAc,GAAGA,cAAc,CAACC,MAAM,CAAEN,MAAM,IAAKA,MAAM,CAACR,IAAI,KAAKA,IAAI,CAAC;EAC1E;EAEA,OAAO,CACL,oBAAoB,EACpB,GAAGa,cAAc,CAACE,GAAG,CAAC,CAAC;IAACV,IAAI;IAAEW;EAAI,CAAC,KAAM,OAAMX,IAAK,KAAIW,IAAK,GAAE,CAAC,CACjE,CAACC,IAAI,CAAC,IAAI,CAAC;AACd"}

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

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

@@ -48,3 +48,3 @@ };

}
_cliTools().logger.info(`Opening "${_chalk().default.bold(appPath)}"`);
_cliTools().logger.info(`Opening "${_picocolors().default.bold(appPath)}"`);
try {

@@ -58,2 +58,2 @@ await (0, _execa().default)(`open ${appPath}`);

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/openApp.js.map
//# sourceMappingURL=openApp.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["openApp","buildOutput","xcodeProject","mode","scheme","target","binaryPath","appPath","buildSettings","getBuildSettings","CLIError","getBuildPath","logger","info","chalk","bold","execa","success","e","error"],"sources":["../../../src/commands/runCommand/openApp.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport chalk from 'chalk';\nimport {getBuildPath} from './getBuildPath';\nimport {getBuildSettings} from './getBuildSettings';\nimport execa from 'execa';\n\ntype Options = {\n buildOutput: string;\n xcodeProject: IOSProjectInfo;\n mode: string;\n scheme: string;\n target?: string;\n binaryPath?: string;\n};\n\nexport default async function openApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target,\n binaryPath,\n}: Options) {\n let appPath = binaryPath;\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n target,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n if (!appPath) {\n appPath = await getBuildPath(buildSettings, 'macos');\n }\n\n logger.info(`Opening \"${chalk.bold(appPath)}\"`);\n\n try {\n await execa(`open ${appPath}`);\n logger.success('Successfully launched the app');\n } catch (e) {\n logger.error('Failed to launch the app', e as string);\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAWX,eAAeA,OAAO,CAAC;EACpCC,WAAW;EACXC,YAAY;EACZC,IAAI;EACJC,MAAM;EACNC,MAAM;EACNC;AACO,CAAC,EAAE;EACV,IAAIC,OAAO,GAAGD,UAAU;EAExB,MAAME,aAAa,GAAG,MAAM,IAAAC,kCAAgB,EAC1CP,YAAY,EACZC,IAAI,EACJF,WAAW,EACXG,MAAM,EACNC,MAAM,CACP;EAED,IAAI,CAACG,aAAa,EAAE;IAClB,MAAM,KAAIE,oBAAQ,EAAC,+CAA+C,CAAC;EACrE;EAEA,IAAI,CAACH,OAAO,EAAE;IACZA,OAAO,GAAG,MAAM,IAAAI,0BAAY,EAACH,aAAa,EAAE,OAAO,CAAC;EACtD;EAEAI,kBAAM,CAACC,IAAI,CAAE,YAAWC,gBAAK,CAACC,IAAI,CAACR,OAAO,CAAE,GAAE,CAAC;EAE/C,IAAI;IACF,MAAM,IAAAS,gBAAK,EAAE,QAAOT,OAAQ,EAAC,CAAC;IAC9BK,kBAAM,CAACK,OAAO,CAAC,+BAA+B,CAAC;EACjD,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVN,kBAAM,CAACO,KAAK,CAAC,0BAA0B,EAAED,CAAC,CAAW;EACvD;AACF"}
{"version":3,"file":"openApp.js","names":["openApp","buildOutput","xcodeProject","mode","scheme","target","binaryPath","appPath","buildSettings","getBuildSettings","CLIError","getBuildPath","logger","info","pico","bold","execa","success","e","error"],"sources":["../../../src/commands/runCommand/openApp.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport pico from 'picocolors';\nimport {getBuildPath} from './getBuildPath';\nimport {getBuildSettings} from './getBuildSettings';\nimport execa from 'execa';\n\ntype Options = {\n buildOutput: string;\n xcodeProject: IOSProjectInfo;\n mode: string;\n scheme: string;\n target?: string;\n binaryPath?: string;\n};\n\nexport default async function openApp({\n buildOutput,\n xcodeProject,\n mode,\n scheme,\n target,\n binaryPath,\n}: Options) {\n let appPath = binaryPath;\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n target,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n if (!appPath) {\n appPath = await getBuildPath(buildSettings, 'macos');\n }\n\n logger.info(`Opening \"${pico.bold(appPath)}\"`);\n\n try {\n await execa(`open ${appPath}`);\n logger.success('Successfully launched the app');\n } catch (e) {\n logger.error('Failed to launch the app', e as string);\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAWX,eAAeA,OAAO,CAAC;EACpCC,WAAW;EACXC,YAAY;EACZC,IAAI;EACJC,MAAM;EACNC,MAAM;EACNC;AACO,CAAC,EAAE;EACV,IAAIC,OAAO,GAAGD,UAAU;EAExB,MAAME,aAAa,GAAG,MAAM,IAAAC,kCAAgB,EAC1CP,YAAY,EACZC,IAAI,EACJF,WAAW,EACXG,MAAM,EACNC,MAAM,CACP;EAED,IAAI,CAACG,aAAa,EAAE;IAClB,MAAM,KAAIE,oBAAQ,EAAC,+CAA+C,CAAC;EACrE;EAEA,IAAI,CAACH,OAAO,EAAE;IACZA,OAAO,GAAG,MAAM,IAAAI,0BAAY,EAACH,aAAa,EAAE,OAAO,CAAC;EACtD;EAEAI,kBAAM,CAACC,IAAI,CAAE,YAAWC,qBAAI,CAACC,IAAI,CAACR,OAAO,CAAE,GAAE,CAAC;EAE9C,IAAI;IACF,MAAM,IAAAS,gBAAK,EAAE,QAAOT,OAAQ,EAAC,CAAC;IAC9BK,kBAAM,CAACK,OAAO,CAAC,+BAA+B,CAAC;EACjD,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVN,kBAAM,CAACO,KAAK,CAAC,0BAA0B,EAAED,CAAC,CAAW;EACvD;AACF"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/runOnDevice.js.map
//# sourceMappingURL=runOnDevice.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["runOnDevice","selectedDevice","platform","mode","scheme","xcodeProject","args","binaryPath","type","CLIError","buildOutput","buildProject","udid","buildSettings","getBuildSettings","appPath","getBuildPath","appProcess","child_process","spawn","detached","stdio","unref","target","logger","info","name","installApp","isSimulator","success"],"sources":["../../../src/commands/runCommand/runOnDevice.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {ApplePlatform, Device} from '../../types';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {CLIError, logger} from '@react-native-community/cli-tools';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {getBuildPath} from './getBuildPath';\nimport {FlagsT} from './createRun';\nimport {getBuildSettings} from './getBuildSettings';\nimport installApp from './installApp';\n\nexport async function runOnDevice(\n selectedDevice: Device,\n platform: ApplePlatform,\n mode: string,\n scheme: string,\n xcodeProject: IOSProjectInfo,\n args: FlagsT,\n) {\n if (args.binaryPath && selectedDevice.type === 'catalyst') {\n throw new CLIError(\n 'binary-path was specified for catalyst device, which is not supported.',\n );\n }\n\n if (selectedDevice.type === 'catalyst') {\n const buildOutput = await buildProject(\n xcodeProject,\n platform,\n selectedDevice.udid,\n mode,\n scheme,\n args,\n );\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n const appPath = await getBuildPath(buildSettings, platform, true);\n const appProcess = child_process.spawn(`${appPath}/${scheme}`, [], {\n detached: true,\n stdio: 'ignore',\n });\n appProcess.unref();\n } else {\n const {binaryPath, target} = args;\n\n let buildOutput;\n if (!binaryPath) {\n buildOutput = await buildProject(\n xcodeProject,\n platform,\n selectedDevice.udid,\n mode,\n scheme,\n args,\n );\n }\n\n logger.info(`Installing and launching your app on ${selectedDevice.name}`);\n\n installApp({\n buildOutput: buildOutput ?? '',\n xcodeProject,\n mode,\n scheme,\n target,\n udid: selectedDevice.udid,\n binaryPath,\n isSimulator: false,\n });\n }\n\n return logger.success('Installed the app on the device.');\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAA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,CAACC,IAAI,CAAE,wCAAuCxB,cAAc,CAACyB,IAAK,EAAC,CAAC;IAE1E,IAAAC,mBAAU,EAAC;MACTjB,WAAW,EAAEA,WAAW,IAAI,EAAE;MAC9BL,YAAY;MACZF,IAAI;MACJC,MAAM;MACNmB,MAAM;MACNX,IAAI,EAAEX,cAAc,CAACW,IAAI;MACzBL,UAAU;MACVqB,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;EAEA,OAAOJ,kBAAM,CAACK,OAAO,CAAC,kCAAkC,CAAC;AAC3D"}
{"version":3,"file":"runOnDevice.js","names":["runOnDevice","selectedDevice","platform","mode","scheme","xcodeProject","args","binaryPath","type","CLIError","buildOutput","buildProject","udid","buildSettings","getBuildSettings","appPath","getBuildPath","appProcess","child_process","spawn","detached","stdio","unref","target","logger","info","name","installApp","isSimulator","success"],"sources":["../../../src/commands/runCommand/runOnDevice.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {ApplePlatform, Device} from '../../types';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {CLIError, logger} from '@react-native-community/cli-tools';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {getBuildPath} from './getBuildPath';\nimport {FlagsT} from './createRun';\nimport {getBuildSettings} from './getBuildSettings';\nimport installApp from './installApp';\n\nexport async function runOnDevice(\n selectedDevice: Device,\n platform: ApplePlatform,\n mode: string,\n scheme: string,\n xcodeProject: IOSProjectInfo,\n args: FlagsT,\n) {\n if (args.binaryPath && selectedDevice.type === 'catalyst') {\n throw new CLIError(\n 'binary-path was specified for catalyst device, which is not supported.',\n );\n }\n\n if (selectedDevice.type === 'catalyst') {\n const buildOutput = await buildProject(\n xcodeProject,\n platform,\n selectedDevice.udid,\n mode,\n scheme,\n args,\n );\n\n const buildSettings = await getBuildSettings(\n xcodeProject,\n mode,\n buildOutput,\n scheme,\n );\n\n if (!buildSettings) {\n throw new CLIError('Failed to get build settings for your project');\n }\n\n const appPath = await getBuildPath(buildSettings, platform, true);\n const appProcess = child_process.spawn(`${appPath}/${scheme}`, [], {\n detached: true,\n stdio: 'ignore',\n });\n appProcess.unref();\n } else {\n const {binaryPath, target} = args;\n\n let buildOutput;\n if (!binaryPath) {\n buildOutput = await buildProject(\n xcodeProject,\n platform,\n selectedDevice.udid,\n mode,\n scheme,\n args,\n );\n }\n\n logger.info(`Installing and launching your app on ${selectedDevice.name}`);\n\n installApp({\n buildOutput: buildOutput ?? '',\n xcodeProject,\n mode,\n scheme,\n target,\n udid: selectedDevice.udid,\n binaryPath,\n isSimulator: false,\n });\n }\n\n return logger.success('Installed the app on the device.');\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;AAEA;AACA;AAAsC;AAE/B,eAAeA,WAAW,CAC/BC,cAAsB,EACtBC,QAAuB,EACvBC,IAAY,EACZC,MAAc,EACdC,YAA4B,EAC5BC,IAAY,EACZ;EACA,IAAIA,IAAI,CAACC,UAAU,IAAIN,cAAc,CAACO,IAAI,KAAK,UAAU,EAAE;IACzD,MAAM,KAAIC,oBAAQ,EAChB,wEAAwE,CACzE;EACH;EAEA,IAAIR,cAAc,CAACO,IAAI,KAAK,UAAU,EAAE;IACtC,MAAME,WAAW,GAAG,MAAM,IAAAC,0BAAY,EACpCN,YAAY,EACZH,QAAQ,EACRD,cAAc,CAACW,IAAI,EACnBT,IAAI,EACJC,MAAM,EACNE,IAAI,CACL;IAED,MAAMO,aAAa,GAAG,MAAM,IAAAC,kCAAgB,EAC1CT,YAAY,EACZF,IAAI,EACJO,WAAW,EACXN,MAAM,CACP;IAED,IAAI,CAACS,aAAa,EAAE;MAClB,MAAM,KAAIJ,oBAAQ,EAAC,+CAA+C,CAAC;IACrE;IAEA,MAAMM,OAAO,GAAG,MAAM,IAAAC,0BAAY,EAACH,aAAa,EAAEX,QAAQ,EAAE,IAAI,CAAC;IACjE,MAAMe,UAAU,GAAGC,wBAAa,CAACC,KAAK,CAAE,GAAEJ,OAAQ,IAAGX,MAAO,EAAC,EAAE,EAAE,EAAE;MACjEgB,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE;IACT,CAAC,CAAC;IACFJ,UAAU,CAACK,KAAK,EAAE;EACpB,CAAC,MAAM;IACL,MAAM;MAACf,UAAU;MAAEgB;IAAM,CAAC,GAAGjB,IAAI;IAEjC,IAAII,WAAW;IACf,IAAI,CAACH,UAAU,EAAE;MACfG,WAAW,GAAG,MAAM,IAAAC,0BAAY,EAC9BN,YAAY,EACZH,QAAQ,EACRD,cAAc,CAACW,IAAI,EACnBT,IAAI,EACJC,MAAM,EACNE,IAAI,CACL;IACH;IAEAkB,kBAAM,CAACC,IAAI,CAAE,wCAAuCxB,cAAc,CAACyB,IAAK,EAAC,CAAC;IAE1E,IAAAC,mBAAU,EAAC;MACTjB,WAAW,EAAEA,WAAW,IAAI,EAAE;MAC9BL,YAAY;MACZF,IAAI;MACJC,MAAM;MACNmB,MAAM;MACNX,IAAI,EAAEX,cAAc,CAACW,IAAI;MACzBL,UAAU;MACVqB,WAAW,EAAE;IACf,CAAC,CAAC;EACJ;EAEA,OAAOJ,kBAAM,CAACK,OAAO,CAAC,kCAAkC,CAAC;AAC3D"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/runOnSimulator.js.map
//# sourceMappingURL=runOnSimulator.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["runOnSimulator","xcodeProject","platform","mode","scheme","args","simulator","binaryPath","target","activeDeveloperDir","child_process","execFileSync","encoding","trim","udid","state","bootSimulator","buildOutput","buildProject","installApp","selectedSimulator","simulatorFullName","formattedDeviceName","logger","info","spawnSync"],"sources":["../../../src/commands/runCommand/runOnSimulator.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {logger} from '@react-native-community/cli-tools';\nimport {ApplePlatform, Device} from '../../types';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {formattedDeviceName} from './matchingDevice';\nimport {FlagsT} from './createRun';\nimport installApp from './installApp';\n\nexport async function runOnSimulator(\n xcodeProject: IOSProjectInfo,\n platform: ApplePlatform,\n mode: string,\n scheme: string,\n args: FlagsT,\n simulator: Device,\n) {\n const {binaryPath, target} = args;\n\n /**\n * Booting simulator through `xcrun simctl boot` will boot it in the `headless` mode\n * (running in the background).\n *\n * In order for user to see the app and the simulator itself, we have to make sure\n * that the Simulator.app is running.\n *\n * We also pass it `-CurrentDeviceUDID` so that when we launch it for the first time,\n * it will not boot the \"default\" device, but the one we set. If the app is already running,\n * this flag has no effect.\n */\n const activeDeveloperDir = child_process\n .execFileSync('xcode-select', ['-p'], {encoding: 'utf8'})\n .trim();\n\n child_process.execFileSync('open', [\n `${activeDeveloperDir}/Applications/Simulator.app`,\n '--args',\n '-CurrentDeviceUDID',\n simulator.udid,\n ]);\n\n if (simulator.state !== 'Booted') {\n bootSimulator(simulator);\n }\n\n let buildOutput;\n if (!binaryPath) {\n buildOutput = await buildProject(\n xcodeProject,\n platform,\n simulator.udid,\n mode,\n scheme,\n args,\n );\n }\n\n installApp({\n buildOutput: buildOutput ?? '',\n xcodeProject,\n mode,\n scheme,\n target,\n udid: simulator.udid,\n binaryPath,\n });\n}\n\nfunction bootSimulator(selectedSimulator: Device) {\n const simulatorFullName = formattedDeviceName(selectedSimulator);\n logger.info(`Launching ${simulatorFullName}`);\n\n child_process.spawnSync('xcrun', ['simctl', 'boot', selectedSimulator.udid]);\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AACA;AAEA;AAAsC;AAE/B,eAAeA,cAAc,CAClCC,YAA4B,EAC5BC,QAAuB,EACvBC,IAAY,EACZC,MAAc,EACdC,IAAY,EACZC,SAAiB,EACjB;EACA,MAAM;IAACC,UAAU;IAAEC;EAAM,CAAC,GAAGH,IAAI;;EAEjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMI,kBAAkB,GAAGC,wBAAa,CACrCC,YAAY,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE;IAACC,QAAQ,EAAE;EAAM,CAAC,CAAC,CACxDC,IAAI,EAAE;EAETH,wBAAa,CAACC,YAAY,CAAC,MAAM,EAAE,CAChC,GAAEF,kBAAmB,6BAA4B,EAClD,QAAQ,EACR,oBAAoB,EACpBH,SAAS,CAACQ,IAAI,CACf,CAAC;EAEF,IAAIR,SAAS,CAACS,KAAK,KAAK,QAAQ,EAAE;IAChCC,aAAa,CAACV,SAAS,CAAC;EAC1B;EAEA,IAAIW,WAAW;EACf,IAAI,CAACV,UAAU,EAAE;IACfU,WAAW,GAAG,MAAM,IAAAC,0BAAY,EAC9BjB,YAAY,EACZC,QAAQ,EACRI,SAAS,CAACQ,IAAI,EACdX,IAAI,EACJC,MAAM,EACNC,IAAI,CACL;EACH;EAEA,IAAAc,mBAAU,EAAC;IACTF,WAAW,EAAEA,WAAW,IAAI,EAAE;IAC9BhB,YAAY;IACZE,IAAI;IACJC,MAAM;IACNI,MAAM;IACNM,IAAI,EAAER,SAAS,CAACQ,IAAI;IACpBP;EACF,CAAC,CAAC;AACJ;AAEA,SAASS,aAAa,CAACI,iBAAyB,EAAE;EAChD,MAAMC,iBAAiB,GAAG,IAAAC,mCAAmB,EAACF,iBAAiB,CAAC;EAChEG,kBAAM,CAACC,IAAI,CAAE,aAAYH,iBAAkB,EAAC,CAAC;EAE7CX,wBAAa,CAACe,SAAS,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAEL,iBAAiB,CAACN,IAAI,CAAC,CAAC;AAC9E"}
{"version":3,"file":"runOnSimulator.js","names":["runOnSimulator","xcodeProject","platform","mode","scheme","args","simulator","binaryPath","target","activeDeveloperDir","child_process","execFileSync","encoding","trim","udid","state","bootSimulator","buildOutput","buildProject","installApp","selectedSimulator","simulatorFullName","formattedDeviceName","logger","info","spawnSync"],"sources":["../../../src/commands/runCommand/runOnSimulator.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {IOSProjectInfo} from '@react-native-community/cli-types';\nimport {logger} from '@react-native-community/cli-tools';\nimport {ApplePlatform, Device} from '../../types';\nimport {buildProject} from '../buildCommand/buildProject';\nimport {formattedDeviceName} from './matchingDevice';\nimport {FlagsT} from './createRun';\nimport installApp from './installApp';\n\nexport async function runOnSimulator(\n xcodeProject: IOSProjectInfo,\n platform: ApplePlatform,\n mode: string,\n scheme: string,\n args: FlagsT,\n simulator: Device,\n) {\n const {binaryPath, target} = args;\n\n /**\n * Booting simulator through `xcrun simctl boot` will boot it in the `headless` mode\n * (running in the background).\n *\n * In order for user to see the app and the simulator itself, we have to make sure\n * that the Simulator.app is running.\n *\n * We also pass it `-CurrentDeviceUDID` so that when we launch it for the first time,\n * it will not boot the \"default\" device, but the one we set. If the app is already running,\n * this flag has no effect.\n */\n const activeDeveloperDir = child_process\n .execFileSync('xcode-select', ['-p'], {encoding: 'utf8'})\n .trim();\n\n child_process.execFileSync('open', [\n `${activeDeveloperDir}/Applications/Simulator.app`,\n '--args',\n '-CurrentDeviceUDID',\n simulator.udid,\n ]);\n\n if (simulator.state !== 'Booted') {\n bootSimulator(simulator);\n }\n\n let buildOutput;\n if (!binaryPath) {\n buildOutput = await buildProject(\n xcodeProject,\n platform,\n simulator.udid,\n mode,\n scheme,\n args,\n );\n }\n\n installApp({\n buildOutput: buildOutput ?? '',\n xcodeProject,\n mode,\n scheme,\n target,\n udid: simulator.udid,\n binaryPath,\n });\n}\n\nfunction bootSimulator(selectedSimulator: Device) {\n const simulatorFullName = formattedDeviceName(selectedSimulator);\n logger.info(`Launching ${simulatorFullName}`);\n\n child_process.spawnSync('xcrun', ['simctl', 'boot', selectedSimulator.udid]);\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;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AC,QAAQ,EAAE,MAAM,EAAEL,iBAAiB,CAACN,IAAI,CAAC,CAAC;AAC9E"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/commands/runCommand/runOptions.js.map
//# sourceMappingURL=runOptions.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getRunOptions","platformName","readableName","getPlatformInfo","isMac","name","description","default","process","env","RCT_METRO_PORT","parse","Number","getDefaultUserTerminal","getBuildOptions"],"sources":["../../../src/commands/runCommand/runOptions.ts"],"sourcesContent":["import {getDefaultUserTerminal} from '@react-native-community/cli-tools';\nimport {BuilderCommand} from '../../types';\nimport {getPlatformInfo} from './getPlatformInfo';\nimport {getBuildOptions} from '../buildCommand/buildOptions';\n\nexport const getRunOptions = ({platformName}: BuilderCommand) => {\n const {readableName} = getPlatformInfo(platformName);\n const isMac = platformName === 'macos';\n return [\n {\n name: '--no-packager',\n description: 'Do not launch packager while running the app',\n },\n {\n name: '--port <number>',\n default: process.env.RCT_METRO_PORT || 8081,\n parse: Number,\n },\n {\n name: '--terminal <string>',\n description:\n 'Launches the Metro Bundler in a new window using the specified terminal path.',\n default: getDefaultUserTerminal(),\n },\n {\n name: '--binary-path <string>',\n description:\n 'Path relative to project root where pre-built .app binary lives.',\n },\n {\n name: '--list-devices',\n description: `List all available ${readableName} devices and simulators and let you choose one to run the app. `,\n },\n {\n name: '--udid <string>',\n description: 'Explicitly set the device to use by UDID',\n },\n !isMac && {\n name: '--simulator <string>',\n description:\n `Explicitly set the simulator to use. Optionally set the ${readableName} version ` +\n 'between parentheses at the end to match an exact version: ' +\n '\"iPhone 15 (17.0)\"',\n },\n ...getBuildOptions({platformName}),\n ];\n};\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AACA;AAEO,MAAMA,aAAa,GAAG,CAAC;EAACC;AAA4B,CAAC,KAAK;EAC/D,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,gCAAe,EAACF,YAAY,CAAC;EACpD,MAAMG,KAAK,GAAGH,YAAY,KAAK,OAAO;EACtC,OAAO,CACL;IACEI,IAAI,EAAE,eAAe;IACrBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,iBAAiB;IACvBE,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACC,cAAc,IAAI,IAAI;IAC3CC,KAAK,EAAEC;EACT,CAAC,EACD;IACEP,IAAI,EAAE,qBAAqB;IAC3BC,WAAW,EACT,+EAA+E;IACjFC,OAAO,EAAE,IAAAM,kCAAsB;EACjC,CAAC,EACD;IACER,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAG,sBAAqBJ,YAAa;EAClD,CAAC,EACD;IACEG,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;EACf,CAAC,EACD,CAACF,KAAK,IAAI;IACRC,IAAI,EAAE,sBAAsB;IAC5BC,WAAW,EACR,2DAA0DJ,YAAa,WAAU,GAClF,4DAA4D,GAC5D;EACJ,CAAC,EACD,GAAG,IAAAY,6BAAe,EAAC;IAACb;EAAY,CAAC,CAAC,CACnC;AACH,CAAC;AAAC"}
{"version":3,"file":"runOptions.js","names":["getRunOptions","platformName","readableName","getPlatformInfo","isMac","name","description","default","process","env","RCT_METRO_PORT","parse","Number","getDefaultUserTerminal","getBuildOptions"],"sources":["../../../src/commands/runCommand/runOptions.ts"],"sourcesContent":["import {getDefaultUserTerminal} from '@react-native-community/cli-tools';\nimport {BuilderCommand} from '../../types';\nimport {getPlatformInfo} from './getPlatformInfo';\nimport {getBuildOptions} from '../buildCommand/buildOptions';\n\nexport const getRunOptions = ({platformName}: BuilderCommand) => {\n const {readableName} = getPlatformInfo(platformName);\n const isMac = platformName === 'macos';\n return [\n {\n name: '--no-packager',\n description: 'Do not launch packager while running the app',\n },\n {\n name: '--port <number>',\n default: process.env.RCT_METRO_PORT || 8081,\n parse: Number,\n },\n {\n name: '--terminal <string>',\n description:\n 'Launches the Metro Bundler in a new window using the specified terminal path.',\n default: getDefaultUserTerminal(),\n },\n {\n name: '--binary-path <string>',\n description:\n 'Path relative to project root where pre-built .app binary lives.',\n },\n {\n name: '--list-devices',\n description: `List all available ${readableName} devices and simulators and let you choose one to run the app. `,\n },\n {\n name: '--udid <string>',\n description: 'Explicitly set the device to use by UDID',\n },\n !isMac && {\n name: '--simulator <string>',\n description:\n `Explicitly set the simulator to use. Optionally set the ${readableName} version ` +\n 'between parentheses at the end to match an exact version: ' +\n '\"iPhone 15 (17.0)\"',\n },\n ...getBuildOptions({platformName}),\n ];\n};\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AACA;AAEO,MAAMA,aAAa,GAAG,CAAC;EAACC;AAA4B,CAAC,KAAK;EAC/D,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,gCAAe,EAACF,YAAY,CAAC;EACpD,MAAMG,KAAK,GAAGH,YAAY,KAAK,OAAO;EACtC,OAAO,CACL;IACEI,IAAI,EAAE,eAAe;IACrBC,WAAW,EAAE;EACf,CAAC,EACD;IACED,IAAI,EAAE,iBAAiB;IACvBE,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACC,cAAc,IAAI,IAAI;IAC3CC,KAAK,EAAEC;EACT,CAAC,EACD;IACEP,IAAI,EAAE,qBAAqB;IAC3BC,WAAW,EACT,+EAA+E;IACjFC,OAAO,EAAE,IAAAM,kCAAsB;EACjC,CAAC,EACD;IACER,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EACT;EACJ,CAAC,EACD;IACED,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAG,sBAAqBJ,YAAa;EAClD,CAAC,EACD;IACEG,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;EACf,CAAC,EACD,CAACF,KAAK,IAAI;IACRC,IAAI,EAAE,sBAAsB;IAC5BC,WAAW,EACR,2DAA0DJ,YAAa,WAAU,GAClF,4DAA4D,GAC5D;EACJ,CAAC,EACD,GAAG,IAAAY,6BAAe,EAAC;IAACb;EAAY,CAAC,CAAC,CACnC;AACH,CAAC;AAAC"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/index.js.map
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":[],"sources":["../src/index.ts"],"sourcesContent":["export {\n getDependencyConfig,\n getProjectConfig,\n findPodfilePaths,\n installPods,\n findXcodeProject,\n findPbxprojFile,\n} from '@react-native-community/cli-config-apple';\n\nexport {getBuildOptions} from './commands/buildCommand/buildOptions';\nexport {getLogOptions} from './commands/logCommand/logOptions';\nexport {getRunOptions} from './commands/runCommand/runOptions';\n\nexport {default as createBuild} from './commands/buildCommand/createBuild';\nexport {default as createLog} from './commands/logCommand/createLog';\nexport {default as createRun} from './commands/runCommand/createRun';\n\nexport {default as getArchitecture} from './tools/getArchitecture';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AASA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAmE"}
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export {\n getDependencyConfig,\n getProjectConfig,\n findPodfilePaths,\n installPods,\n findXcodeProject,\n findPbxprojFile,\n} from '@react-native-community/cli-config-apple';\n\nexport {getBuildOptions} from './commands/buildCommand/buildOptions';\nexport {getLogOptions} from './commands/logCommand/logOptions';\nexport {getRunOptions} from './commands/runCommand/runOptions';\n\nexport {default as createBuild} from './commands/buildCommand/createBuild';\nexport {default as createLog} from './commands/logCommand/createLog';\nexport {default as createRun} from './commands/runCommand/createRun';\n\nexport {default as getArchitecture} from './tools/getArchitecture';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AASA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAmE"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/checkIfConfigurationExists.js.map
//# sourceMappingURL=checkIfConfigurationExists.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["checkIfConfigurationExists","configurations","mode","length","logger","warn","includes","CLIError","join"],"sources":["../../src/tools/checkIfConfigurationExists.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\n\nexport function checkIfConfigurationExists(\n configurations: string[],\n mode: string,\n) {\n if (configurations.length === 0) {\n logger.warn(`Unable to check whether \"${mode}\" exists in your project`);\n return;\n }\n\n if (!configurations.includes(mode)) {\n throw new CLIError(\n `Configuration \"${mode}\" does not exist in your project. Please use one of the existing configurations: ${configurations.join(\n ', ',\n )}`,\n );\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,SAASA,0BAA0B,CACxCC,cAAwB,EACxBC,IAAY,EACZ;EACA,IAAID,cAAc,CAACE,MAAM,KAAK,CAAC,EAAE;IAC/BC,kBAAM,CAACC,IAAI,CAAE,4BAA2BH,IAAK,0BAAyB,CAAC;IACvE;EACF;EAEA,IAAI,CAACD,cAAc,CAACK,QAAQ,CAACJ,IAAI,CAAC,EAAE;IAClC,MAAM,KAAIK,oBAAQ,EACf,kBAAiBL,IAAK,oFAAmFD,cAAc,CAACO,IAAI,CAC3H,IAAI,CACJ,EAAC,CACJ;EACH;AACF"}
{"version":3,"file":"checkIfConfigurationExists.js","names":["checkIfConfigurationExists","configurations","mode","length","logger","warn","includes","CLIError","join"],"sources":["../../src/tools/checkIfConfigurationExists.ts"],"sourcesContent":["import {CLIError, logger} from '@react-native-community/cli-tools';\n\nexport function checkIfConfigurationExists(\n configurations: string[],\n mode: string,\n) {\n if (configurations.length === 0) {\n logger.warn(`Unable to check whether \"${mode}\" exists in your project`);\n return;\n }\n\n if (!configurations.includes(mode)) {\n throw new CLIError(\n `Configuration \"${mode}\" does not exist in your project. Please use one of the existing configurations: ${configurations.join(\n ', ',\n )}`,\n );\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,SAASA,0BAA0B,CACxCC,cAAwB,EACxBC,IAAY,EACZ;EACA,IAAID,cAAc,CAACE,MAAM,KAAK,CAAC,EAAE;IAC/BC,kBAAM,CAACC,IAAI,CAAE,4BAA2BH,IAAK,0BAAyB,CAAC;IACvE;EACF;EAEA,IAAI,CAACD,cAAc,CAACK,QAAQ,CAACJ,IAAI,CAAC,EAAE;IAClC,MAAM,KAAIK,oBAAQ,EACf,kBAAiBL,IAAK,oFAAmFD,cAAc,CAACO,IAAI,CAC3H,IAAI,CACJ,EAAC,CACJ;EACH;AACF"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/findMatchingSimulator.js.map
//# sourceMappingURL=findMatchingSimulator.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["findMatchingSimulator","simulators","findOptions","devices","simulatorVersion","simulatorName","simulator","parsedSimulatorName","match","undefined","fallbackMatch","sortedDevices","Object","fromEntries","entries","sort","a","b","Number","includes","versionDescriptor","device","version","test","replace","endsWith","i","availability","isAvailable","lastBootedAt","simulatorDescriptor","udid","name","state"],"sources":["../../src/tools/findMatchingSimulator.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {Device} from '../types';\n\n/**\n * Takes in a parsed simulator list and a desired name, and returns an object with the matching simulator. The desired\n * name can optionally include the iOS version in between parenthesis after the device name. Ex: \"iPhone 6 (9.2)\" in\n * which case it'll attempt to find a simulator with the exact version specified.\n *\n * If the simulatorString argument is null, we'll go into default mode and return the currently booted simulator,\n * the last booted simulator or\n * if none is booted, it will be the first in the list.\n *\n * @param simulators a parsed list from `xcrun simctl list --json devices` command\n * @param findOptions null or an object containing:\n * ```\n * {\n * simulator: name of desired simulator\n * udid: udid of desired simulator\n * }\n * ```\n * If null, it will use the currently booted simulator, or if none are booted, the first in the list.\n */\nfunction findMatchingSimulator(\n simulators: {devices: {[index: string]: Array<Device>}},\n findOptions?: null | {simulator?: string; udid?: string},\n) {\n if (!simulators.devices) {\n return null;\n }\n const devices = simulators.devices;\n let simulatorVersion;\n let simulatorName = null;\n\n if (findOptions && findOptions.simulator) {\n const parsedSimulatorName = findOptions.simulator.match(\n /(.*)? (?:\\((\\d+\\.\\d+)?\\))$/,\n );\n if (parsedSimulatorName && parsedSimulatorName[2] !== undefined) {\n simulatorVersion = parsedSimulatorName[2];\n simulatorName = parsedSimulatorName[1];\n } else {\n simulatorName = findOptions.simulator;\n }\n }\n\n let match;\n let fallbackMatch;\n\n const sortedDevices = Object.fromEntries(\n Object.entries(devices).sort(\n (a, b) => Number(b[0].includes('iOS')) - Number(a[0].includes('iOS')),\n ),\n );\n\n for (const versionDescriptor in sortedDevices) {\n const device = sortedDevices[versionDescriptor];\n let version = versionDescriptor;\n\n if (/^com\\.apple\\.CoreSimulator\\.SimRuntime\\./g.test(version)) {\n // Transform \"com.apple.CoreSimulator.SimRuntime.iOS-12-2\" into \"iOS 12.2\"\n version = version.replace(\n /^com\\.apple\\.CoreSimulator\\.SimRuntime\\.([^-]+)-([^-]+)-([^-]+)$/g,\n '$1 $2.$3',\n );\n }\n\n // Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)\n if (!version.includes('iOS') && !version.includes('tvOS')) {\n continue;\n }\n if (simulatorVersion && !version.endsWith(simulatorVersion)) {\n continue;\n }\n for (const i in device) {\n const simulator = device[i];\n // Skipping non-available simulator\n if (\n simulator.availability !== '(available)' &&\n // @ts-ignore verify isAvailable parameter\n simulator.isAvailable !== 'YES' &&\n simulator.isAvailable !== true\n ) {\n continue;\n }\n const lastBootedAt = simulator.lastBootedAt;\n const simulatorDescriptor: Device = {\n udid: simulator.udid,\n name: simulator.name,\n state: simulator.state,\n version,\n };\n if (findOptions && findOptions.udid) {\n if (simulator.udid === findOptions.udid) {\n return simulatorDescriptor;\n }\n } else {\n if (simulator.state === 'Booted' && simulatorName === null) {\n return simulatorDescriptor;\n }\n if (simulator.name === simulatorName && !match) {\n match = simulatorDescriptor;\n }\n // If no match found, use first available simulator that was booted before\n if (!!lastBootedAt && !match) {\n fallbackMatch = simulatorDescriptor;\n }\n // Keeps track of the first available simulator for use if we can't find one above.\n if (simulatorName === null && !match) {\n match = simulatorDescriptor;\n }\n }\n }\n }\n\n return match ?? fallbackMatch ?? null;\n}\n\nexport default findMatchingSimulator;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,qBAAqB,CAC5BC,UAAuD,EACvDC,WAAwD,EACxD;EACA,IAAI,CAACD,UAAU,CAACE,OAAO,EAAE;IACvB,OAAO,IAAI;EACb;EACA,MAAMA,OAAO,GAAGF,UAAU,CAACE,OAAO;EAClC,IAAIC,gBAAgB;EACpB,IAAIC,aAAa,GAAG,IAAI;EAExB,IAAIH,WAAW,IAAIA,WAAW,CAACI,SAAS,EAAE;IACxC,MAAMC,mBAAmB,GAAGL,WAAW,CAACI,SAAS,CAACE,KAAK,CACrD,4BAA4B,CAC7B;IACD,IAAID,mBAAmB,IAAIA,mBAAmB,CAAC,CAAC,CAAC,KAAKE,SAAS,EAAE;MAC/DL,gBAAgB,GAAGG,mBAAmB,CAAC,CAAC,CAAC;MACzCF,aAAa,GAAGE,m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MC,mBAA2B,GAAG;QAClCC,IAAI,EAAEzB,SAAS,CAACyB,IAAI;QACpBC,IAAI,EAAE1B,SAAS,CAAC0B,IAAI;QACpBC,KAAK,EAAE3B,SAAS,CAAC2B,KAAK;QACtBX;MACF,CAAC;MACD,IAAIpB,WAAW,IAAIA,WAAW,CAAC6B,IAAI,EAAE;QACnC,IAAIzB,SAAS,CAACyB,IAAI,KAAK7B,WAAW,CAAC6B,IAAI,EAAE;UACvC,OAAOD,mBAAmB;QAC5B;MACF,CAAC,MAAM;QACL,IAAIxB,SAAS,CAAC2B,KAAK,KAAK,QAAQ,IAAI5B,aAAa,KAAK,IAAI,EAAE;UAC1D,OAAOyB,mBAAmB;QAC5B;QACA,IAAIxB,SAAS,CAAC0B,IAAI,KAAK3B,aAAa,IAAI,CAACG,KAAK,EAAE;UAC9CA,KAAK,GAAGsB,mBAAmB;QAC7B;QACA;QACA,IAAI,CAAC,CAACD,YAAY,IAAI,CAACrB,KAAK,EAAE;UAC5BE,aAAa,GAAGoB,mBAAmB;QACrC;QACA;QACA,IAAIzB,aAAa,KAAK,IAAI,IAAI,CAACG,KAAK,EAAE;UACpCA,KAAK,GAAGsB,mBAAmB;QAC7B;MACF;IACF;EACF;EAEA,OAAOtB,KAAK,IAAIE,aAAa,IAAI,IAAI;AACvC;AAAC,eAEcV,qBAAqB;AAAA"}
{"version":3,"file":"findMatchingSimulator.js","names":["findMatchingSimulator","simulators","findOptions","devices","simulatorVersion","simulatorName","simulator","parsedSimulatorName","match","undefined","fallbackMatch","sortedDevices","Object","fromEntries","entries","sort","a","b","Number","includes","versionDescriptor","device","version","test","replace","endsWith","i","availability","isAvailable","lastBootedAt","simulatorDescriptor","udid","name","state"],"sources":["../../src/tools/findMatchingSimulator.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {Device} from '../types';\n\n/**\n * Takes in a parsed simulator list and a desired name, and returns an object with the matching simulator. The desired\n * name can optionally include the iOS version in between parenthesis after the device name. Ex: \"iPhone 6 (9.2)\" in\n * which case it'll attempt to find a simulator with the exact version specified.\n *\n * If the simulatorString argument is null, we'll go into default mode and return the currently booted simulator,\n * the last booted simulator or\n * if none is booted, it will be the first in the list.\n *\n * @param simulators a parsed list from `xcrun simctl list --json devices` command\n * @param findOptions null or an object containing:\n * ```\n * {\n * simulator: name of desired simulator\n * udid: udid of desired simulator\n * }\n * ```\n * If null, it will use the currently booted simulator, or if none are booted, the first in the list.\n */\nfunction findMatchingSimulator(\n simulators: {devices: {[index: string]: Array<Device>}},\n findOptions?: null | {simulator?: string; udid?: string},\n) {\n if (!simulators.devices) {\n return null;\n }\n const devices = simulators.devices;\n let simulatorVersion;\n let simulatorName = null;\n\n if (findOptions && findOptions.simulator) {\n const parsedSimulatorName = findOptions.simulator.match(\n /(.*)? (?:\\((\\d+\\.\\d+)?\\))$/,\n );\n if (parsedSimulatorName && parsedSimulatorName[2] !== undefined) {\n simulatorVersion = parsedSimulatorName[2];\n simulatorName = parsedSimulatorName[1];\n } else {\n simulatorName = findOptions.simulator;\n }\n }\n\n let match;\n let fallbackMatch;\n\n const sortedDevices = Object.fromEntries(\n Object.entries(devices).sort(\n (a, b) => Number(b[0].includes('iOS')) - Number(a[0].includes('iOS')),\n ),\n );\n\n for (const versionDescriptor in sortedDevices) {\n const device = sortedDevices[versionDescriptor];\n let version = versionDescriptor;\n\n if (/^com\\.apple\\.CoreSimulator\\.SimRuntime\\./g.test(version)) {\n // Transform \"com.apple.CoreSimulator.SimRuntime.iOS-12-2\" into \"iOS 12.2\"\n version = version.replace(\n /^com\\.apple\\.CoreSimulator\\.SimRuntime\\.([^-]+)-([^-]+)-([^-]+)$/g,\n '$1 $2.$3',\n );\n }\n\n // Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)\n if (!version.includes('iOS') && !version.includes('tvOS')) {\n continue;\n }\n if (simulatorVersion && !version.endsWith(simulatorVersion)) {\n continue;\n }\n for (const i in device) {\n const simulator = device[i];\n // Skipping non-available simulator\n if (\n simulator.availability !== '(available)' &&\n // @ts-ignore verify isAvailable parameter\n simulator.isAvailable !== 'YES' &&\n simulator.isAvailable !== true\n ) {\n continue;\n }\n const lastBootedAt = simulator.lastBootedAt;\n const simulatorDescriptor: Device = {\n udid: simulator.udid,\n name: simulator.name,\n state: simulator.state,\n version,\n };\n if (findOptions && findOptions.udid) {\n if (simulator.udid === findOptions.udid) {\n return simulatorDescriptor;\n }\n } else {\n if (simulator.state === 'Booted' && simulatorName === null) {\n return simulatorDescriptor;\n }\n if (simulator.name === simulatorName && !match) {\n match = simulatorDescriptor;\n }\n // If no match found, use first available simulator that was booted before\n if (!!lastBootedAt && !match) {\n fallbackMatch = simulatorDescriptor;\n }\n // Keeps track of the first available simulator for use if we can't find one above.\n if (simulatorName === null && !match) {\n match = simulatorDescriptor;\n }\n }\n }\n }\n\n return match ?? fallbackMatch ?? null;\n}\n\nexport default findMatchingSimulator;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,qBAAqB,CAC5BC,UAAuD,EACvDC,WAAwD,EACxD;EACA,IAAI,CAACD,UAAU,CAACE,OAAO,EAAE;IACvB,OAAO,IAAI;EACb;EACA,MAAMA,OAAO,GAAGF,UAAU,CAACE,OAAO;EAClC,IAAIC,gBAAgB;EACpB,IAAIC,aAAa,GAAG,IAAI;EAExB,IAAIH,WAAW,IAAIA,WAAW,CAACI,SAAS,EAAE;IACxC,MAAMC,mBAAmB,GAAGL,WAAW,CAACI,SAAS,CAACE,KAAK,CACrD,4BAA4B,CAC7B;IACD,IAAID,mBAAmB,IAAIA,mBAAmB,CAAC,CAAC,CAAC,KAAKE,SAAS,EAAE;MAC/DL,gBAAgB,GAAGG,mBAAmB,CA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AAGvB,SAAS,CAACuB,YAAY;MAC3C,MAAMC,mBAA2B,GAAG;QAClCC,IAAI,EAAEzB,SAAS,CAACyB,IAAI;QACpBC,IAAI,EAAE1B,SAAS,CAAC0B,IAAI;QACpBC,KAAK,EAAE3B,SAAS,CAAC2B,KAAK;QACtBX;MACF,CAAC;MACD,IAAIpB,WAAW,IAAIA,WAAW,CAAC6B,IAAI,EAAE;QACnC,IAAIzB,SAAS,CAACyB,IAAI,KAAK7B,WAAW,CAAC6B,IAAI,EAAE;UACvC,OAAOD,mBAAmB;QAC5B;MACF,CAAC,MAAM;QACL,IAAIxB,SAAS,CAAC2B,KAAK,KAAK,QAAQ,IAAI5B,aAAa,KAAK,IAAI,EAAE;UAC1D,OAAOyB,mBAAmB;QAC5B;QACA,IAAIxB,SAAS,CAAC0B,IAAI,KAAK3B,aAAa,IAAI,CAACG,KAAK,EAAE;UAC9CA,KAAK,GAAGsB,mBAAmB;QAC7B;QACA;QACA,IAAI,CAAC,CAACD,YAAY,IAAI,CAACrB,KAAK,EAAE;UAC5BE,aAAa,GAAGoB,mBAAmB;QACrC;QACA;QACA,IAAIzB,aAAa,KAAK,IAAI,IAAI,CAACG,KAAK,EAAE;UACpCA,KAAK,GAAGsB,mBAAmB;QAC7B;MACF;IACF;EACF;EAEA,OAAOtB,KAAK,IAAIE,aAAa,IAAI,IAAI;AACvC;AAAC,eAEcV,qBAAqB;AAAA"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/getArchitecture.js.map
//# sourceMappingURL=getArchitecture.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getArchitecture","iosSourceDir","project","readFile","path","join","includes"],"sources":["../../src/tools/getArchitecture.ts"],"sourcesContent":["import {readFile} from 'fs-extra';\nimport path from 'path';\n\nexport default async function getArchitecture(iosSourceDir: string) {\n try {\n const project = await readFile(\n path.join(iosSourceDir, '/Pods/Pods.xcodeproj/project.pbxproj'),\n );\n\n return project.includes('-DRCT_NEW_ARCH_ENABLED=1');\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAET,eAAeA,eAAe,CAACC,YAAoB,EAAE;EAClE,IAAI;IACF,MAAMC,OAAO,GAAG,MAAM,IAAAC,mBAAQ,EAC5BC,eAAI,CAACC,IAAI,CAACJ,YAAY,EAAE,sCAAsC,CAAC,CAChE;IAED,OAAOC,OAAO,CAACI,QAAQ,CAAC,0BAA0B,CAAC;EACrD,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF"}
{"version":3,"file":"getArchitecture.js","names":["getArchitecture","iosSourceDir","project","readFile","path","join","includes"],"sources":["../../src/tools/getArchitecture.ts"],"sourcesContent":["import {readFile} from 'fs-extra';\nimport path from 'path';\n\nexport default async function getArchitecture(iosSourceDir: string) {\n try {\n const project = await readFile(\n path.join(iosSourceDir, '/Pods/Pods.xcodeproj/project.pbxproj'),\n );\n\n return project.includes('-DRCT_NEW_ARCH_ENABLED=1');\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAET,eAAeA,eAAe,CAACC,YAAoB,EAAE;EAClE,IAAI;IACF,MAAMC,OAAO,GAAG,MAAM,IAAAC,mBAAQ,EAC5BC,eAAI,CAACC,IAAI,CAACJ,YAAY,EAAE,sCAAsC,CAAC,CAChE;IAED,OAAOC,OAAO,CAACI,QAAQ,CAAC,0BAA0B,CAAC;EACrD,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF"}

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

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

@@ -62,3 +62,3 @@ };

} catch {
const projectSchemes = (projectInfo === null || projectInfo === void 0 ? void 0 : projectInfo.schemes) && projectInfo.schemes.length > 0 ? `${projectInfo.schemes.map(name => _chalk().default.bold(name)).join(', ')}` : 'No schemes';
const projectSchemes = (projectInfo === null || projectInfo === void 0 ? void 0 : projectInfo.schemes) && projectInfo.schemes.length > 0 ? `${projectInfo.schemes.map(name => _picocolors().default.bold(name)).join(', ')}` : 'No schemes';
throw new (_cliTools().CLIError)(`Could not load the shared scheme for ${scheme}. Your project configuration includes: ${projectSchemes}. Please ensure a valid .xcscheme file exists in xcshareddata/xcschemes.`);

@@ -69,2 +69,2 @@ }

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/getBuildConfigurationFromXcScheme.js.map
//# sourceMappingURL=getBuildConfigurationFromXcScheme.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["xmlParser","XMLParser","ignoreAttributes","getBuildConfigurationFromXcScheme","scheme","configuration","sourceDir","projectInfo","xcProject","fs","readdirSync","find","dir","endsWith","xmlScheme","readFileSync","path","join","encoding","Scheme","parse","LaunchAction","projectSchemes","schemes","length","map","name","chalk","bold","CLIError"],"sources":["../../src/tools/getBuildConfigurationFromXcScheme.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport chalk from 'chalk';\nimport {XMLParser} from 'fast-xml-parser';\nimport fs from 'fs';\nimport path from 'path';\nimport {IosInfo} from '../types';\n\nconst xmlParser = new XMLParser({ignoreAttributes: false});\n\nexport function getBuildConfigurationFromXcScheme(\n scheme: string,\n configuration: string,\n sourceDir: string,\n projectInfo: IosInfo | undefined,\n): string {\n // can not assume .xcodeproj exists.\n // for more info see: https://github.com/react-native-community/cli/pull/2196\n try {\n const xcProject = fs\n .readdirSync(sourceDir)\n .find((dir) => dir.endsWith('.xcodeproj'));\n\n if (xcProject) {\n const xmlScheme = fs.readFileSync(\n path.join(\n sourceDir,\n xcProject,\n 'xcshareddata',\n 'xcschemes',\n `${scheme}.xcscheme`,\n ),\n {\n encoding: 'utf-8',\n },\n );\n\n const {Scheme} = xmlParser.parse(xmlScheme);\n\n return Scheme.LaunchAction['@_buildConfiguration'];\n }\n } catch {\n const projectSchemes =\n projectInfo?.schemes && projectInfo.schemes.length > 0\n ? `${projectInfo.schemes.map((name) => chalk.bold(name)).join(', ')}`\n : 'No schemes';\n\n throw new CLIError(\n `Could not load the shared scheme for ${scheme}. Your project configuration includes: ${projectSchemes}. Please ensure a valid .xcscheme file exists in xcshareddata/xcschemes.`,\n );\n }\n\n return configuration;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAGxB,MAAMA,SAAS,GAAG,KAAIC,0BAAS,EAAC;EAACC,gBAAgB,EAAE;AAAK,CAAC,CAAC;AAEnD,SAASC,iCAAiC,CAC/CC,MAAc,EACdC,aAAqB,EACrBC,SAAiB,EACjBC,WAAgC,EACxB;EACR;EACA;EACA,IAAI;IACF,MAAMC,SAAS,GAAGC,aAAE,CACjBC,WAAW,CAACJ,SAAS,CAAC,CACtBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE5C,IAAIL,SAAS,EAAE;MACb,MAAMM,SAAS,GAAGL,aAAE,CAACM,YAAY,CAC/BC,eAAI,CAACC,IAAI,CACPX,SAAS,EACTE,SAAS,EACT,cAAc,EACd,WAAW,EACV,GAAEJ,MAAO,WAAU,CACrB,EACD;QACEc,QAAQ,EAAE;MACZ,CAAC,CACF;MAED,MAAM;QAACC;MAAM,CAAC,GAAGnB,SAAS,CAACoB,KAAK,CAACN,SAAS,CAAC;MAE3C,OAAOK,MAAM,CAACE,YAAY,CAAC,sBAAsB,CAAC;IACpD;EACF,CAAC,CAAC,MAAM;IACN,MAAMC,cAAc,GAClB,CAAAf,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEgB,OAAO,KAAIhB,WAAW,CAACgB,OAAO,CAACC,MAAM,GAAG,CAAC,GACjD,GAAEjB,WAAW,CAACgB,OAAO,CAACE,GAAG,CAAEC,IAAI,IAAKC,gBAAK,CAACC,IAAI,CAACF,IAAI,CAAC,CAAC,CAACT,IAAI,CAAC,IAAI,CAAE,EAAC,GACnE,YAAY;IAElB,MAAM,KAAIY,oBAAQ,EACf,wCAAuCzB,MAAO,0CAAyCkB,cAAe,0EAAyE,CACjL;EACH;EAEA,OAAOjB,aAAa;AACtB"}
{"version":3,"file":"getBuildConfigurationFromXcScheme.js","names":["xmlParser","XMLParser","ignoreAttributes","getBuildConfigurationFromXcScheme","scheme","configuration","sourceDir","projectInfo","xcProject","fs","readdirSync","find","dir","endsWith","xmlScheme","readFileSync","path","join","encoding","Scheme","parse","LaunchAction","projectSchemes","schemes","length","map","name","pico","bold","CLIError"],"sources":["../../src/tools/getBuildConfigurationFromXcScheme.ts"],"sourcesContent":["import {CLIError} from '@react-native-community/cli-tools';\nimport pico from 'picocolors';\nimport {XMLParser} from 'fast-xml-parser';\nimport fs from 'fs';\nimport path from 'path';\nimport {IosInfo} from '../types';\n\nconst xmlParser = new XMLParser({ignoreAttributes: false});\n\nexport function getBuildConfigurationFromXcScheme(\n scheme: string,\n configuration: string,\n sourceDir: string,\n projectInfo: IosInfo | undefined,\n): string {\n // can not assume .xcodeproj exists.\n // for more info see: https://github.com/react-native-community/cli/pull/2196\n try {\n const xcProject = fs\n .readdirSync(sourceDir)\n .find((dir) => dir.endsWith('.xcodeproj'));\n\n if (xcProject) {\n const xmlScheme = fs.readFileSync(\n path.join(\n sourceDir,\n xcProject,\n 'xcshareddata',\n 'xcschemes',\n `${scheme}.xcscheme`,\n ),\n {\n encoding: 'utf-8',\n },\n );\n\n const {Scheme} = xmlParser.parse(xmlScheme);\n\n return Scheme.LaunchAction['@_buildConfiguration'];\n }\n } catch {\n const projectSchemes =\n projectInfo?.schemes && projectInfo.schemes.length > 0\n ? `${projectInfo.schemes.map((name) => pico.bold(name)).join(', ')}`\n : 'No schemes';\n\n throw new CLIError(\n `Could not load the shared scheme for ${scheme}. Your project configuration includes: ${projectSchemes}. Please ensure a valid .xcscheme file exists in xcshareddata/xcschemes.`,\n );\n }\n\n return configuration;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAGxB,MAAMA,SAAS,GAAG,KAAIC,0BAAS,EAAC;EAACC,gBAAgB,EAAE;AAAK,CAAC,CAAC;AAEnD,SAASC,iCAAiC,CAC/CC,MAAc,EACdC,aAAqB,EACrBC,SAAiB,EACjBC,WAAgC,EACxB;EACR;EACA;EACA,IAAI;IACF,MAAMC,SAAS,GAAGC,aAAE,CACjBC,WAAW,CAACJ,SAAS,CAAC,CACtBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE5C,IAAIL,SAAS,EAAE;MACb,MAAMM,SAAS,GAAGL,aAAE,CAACM,YAAY,CAC/BC,eAAI,CAACC,IAAI,CACPX,SAAS,EACTE,SAAS,EACT,cAAc,EACd,WAAW,EACV,GAAEJ,MAAO,WAAU,CACrB,EACD;QACEc,QAAQ,EAAE;MACZ,CAAC,CACF;MAED,MAAM;QAACC;MAAM,CAAC,GAAGnB,SAAS,CAACoB,KAAK,CAACN,SAAS,CAAC;MAE3C,OAAOK,MAAM,CAACE,YAAY,CAAC,sBAAsB,CAAC;IACpD;EACF,CAAC,CAAC,MAAM;IACN,MAAMC,cAAc,GAClB,CAAAf,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEgB,OAAO,KAAIhB,WAAW,CAACgB,OAAO,CAACC,MAAM,GAAG,CAAC,GACjD,GAAEjB,WAAW,CAACgB,OAAO,CAACE,GAAG,CAAEC,IAAI,IAAKC,qBAAI,CAACC,IAAI,CAACF,IAAI,CAAC,CAAC,CAACT,IAAI,CAAC,IAAI,CAAE,EAAC,GAClE,YAAY;IAElB,MAAM,KAAIY,oBAAQ,EACf,wCAAuCzB,MAAO,0CAAyCkB,cAAe,0EAAyE,CACjL;EACH;EAEA,OAAOjB,aAAa;AACtB"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/getDestinationSimulator.js.map
//# sourceMappingURL=getDestinationSimulator.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getDestinationSimulator","args","fallbackSimulators","simulators","JSON","parse","child_process","execFileSync","encoding","error","CLIError","selectedSimulator","reduce","simulator","fallback","findMatchingSimulator","udid"],"sources":["../../src/tools/getDestinationSimulator.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {CLIError} from '@react-native-community/cli-tools';\nimport {Device} from '../types';\nimport findMatchingSimulator from './findMatchingSimulator';\n\ntype FlagsT = {\n simulator?: string;\n udid?: string;\n};\n\nexport function getDestinationSimulator(\n args: FlagsT,\n fallbackSimulators: string[] = [],\n) {\n let simulators: {devices: {[index: string]: Array<Device>}};\n try {\n simulators = JSON.parse(\n child_process.execFileSync(\n 'xcrun',\n ['simctl', 'list', '--json', 'devices'],\n {encoding: 'utf8'},\n ),\n );\n } catch (error) {\n throw new CLIError(\n 'Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.',\n error as Error,\n );\n }\n\n const selectedSimulator = fallbackSimulators.reduce((simulator, fallback) => {\n return (\n simulator || findMatchingSimulator(simulators, {simulator: fallback})\n );\n }, findMatchingSimulator(simulators, args));\n\n if (!selectedSimulator) {\n throw new CLIError(\n `No simulator available with ${\n args.simulator ? `name \"${args.simulator}\"` : `udid \"${args.udid}\"`\n }`,\n );\n }\n return selectedSimulator;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAA4D;AAOrD,SAASA,uBAAuB,CACrCC,IAAY,EACZC,kBAA4B,GAAG,EAAE,EACjC;EACA,IAAIC,UAAuD;EAC3D,IAAI;IACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CACrBC,wBAAa,CAACC,YAAY,CACxB,OAAO,EACP,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EACvC;MAACC,QAAQ,EAAE;IAAM,CAAC,CACnB,CACF;EACH,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,MAAM,KAAIC,oBAAQ,EAChB,6IAA6I,EAC7ID,KAAK,CACN;EACH;EAEA,MAAME,iBAAiB,GAAGT,kBAAkB,CAACU,MAAM,CAAC,CAACC,SAAS,EAAEC,QAAQ,KAAK;IAC3E,OACED,SAAS,IAAI,IAAAE,8BAAqB,EAACZ,UAAU,EAAE;MAACU,SAAS,EAAEC;IAAQ,CAAC,CAAC;EAEzE,CAAC,EAAE,IAAAC,8BAAqB,EAACZ,UAAU,EAAEF,IAAI,CAAC,CAAC;EAE3C,IAAI,CAACU,iBAAiB,EAAE;IACtB,MAAM,KAAID,oBAAQ,EACf,+BACCT,IAAI,CAACY,SAAS,GAAI,SAAQZ,IAAI,CAACY,SAAU,GAAE,GAAI,SAAQZ,IAAI,CAACe,IAAK,GAClE,EAAC,CACH;EACH;EACA,OAAOL,iBAAiB;AAC1B"}
{"version":3,"file":"getDestinationSimulator.js","names":["getDestinationSimulator","args","fallbackSimulators","simulators","JSON","parse","child_process","execFileSync","encoding","error","CLIError","selectedSimulator","reduce","simulator","fallback","findMatchingSimulator","udid"],"sources":["../../src/tools/getDestinationSimulator.ts"],"sourcesContent":["import child_process from 'child_process';\nimport {CLIError} from '@react-native-community/cli-tools';\nimport {Device} from '../types';\nimport findMatchingSimulator from './findMatchingSimulator';\n\ntype FlagsT = {\n simulator?: string;\n udid?: string;\n};\n\nexport function getDestinationSimulator(\n args: FlagsT,\n fallbackSimulators: string[] = [],\n) {\n let simulators: {devices: {[index: string]: Array<Device>}};\n try {\n simulators = JSON.parse(\n child_process.execFileSync(\n 'xcrun',\n ['simctl', 'list', '--json', 'devices'],\n {encoding: 'utf8'},\n ),\n );\n } catch (error) {\n throw new CLIError(\n 'Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.',\n error as Error,\n );\n }\n\n const selectedSimulator = fallbackSimulators.reduce((simulator, fallback) => {\n return (\n simulator || findMatchingSimulator(simulators, {simulator: fallback})\n );\n }, findMatchingSimulator(simulators, args));\n\n if (!selectedSimulator) {\n throw new CLIError(\n `No simulator available with ${\n args.simulator ? `name \"${args.simulator}\"` : `udid \"${args.udid}\"`\n }`,\n );\n }\n return selectedSimulator;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAA4D;AAOrD,SAASA,uBAAuB,CACrCC,IAAY,EACZC,kBAA4B,GAAG,EAAE,EACjC;EACA,IAAIC,UAAuD;EAC3D,IAAI;IACFA,UAAU,GAAGC,IAAI,CAACC,KAAK,CACrBC,wBAAa,CAACC,YAAY,CACxB,OAAO,EACP,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EACvC;MAACC,QAAQ,EAAE;IAAM,CAAC,CACnB,CACF;EACH,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,MAAM,KAAIC,oBAAQ,EAChB,6IAA6I,EAC7ID,KAAK,CACN;EACH;EAEA,MAAME,iBAAiB,GAAGT,kBAAkB,CAACU,MAAM,CAAC,CAACC,SAAS,EAAEC,QAAQ,KAAK;IAC3E,OACED,SAAS,IAAI,IAAAE,8BAAqB,EAACZ,UAAU,EAAE;MAACU,SAAS,EAAEC;IAAQ,CAAC,CAAC;EAEzE,CAAC,EAAE,IAAAC,8BAAqB,EAACZ,UAAU,EAAEF,IAAI,CAAC,CAAC;EAE3C,IAAI,CAACU,iBAAiB,EAAE;IACtB,MAAM,KAAID,oBAAQ,EACf,+BACCT,IAAI,CAACY,SAAS,GAAI,SAAQZ,IAAI,CAACY,SAAU,GAAE,GAAI,SAAQZ,IAAI,CAACe,IAAK,GAClE,EAAC,CACH;EACH;EACA,OAAOL,iBAAiB;AAC1B"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/getInfo.js.map
//# sourceMappingURL=getInfo.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["isErrorLike","err","Boolean","message","parseTargetList","json","info","JSON","parse","project","workspace","undefined","error","match","Error","getInfo","projectInfo","sourceDir","isWorkspace","xcodebuild","execa","sync","stdout","xmlParser","XMLParser","ignoreAttributes","xcworkspacedata","path","join","name","fs","readFileSync","encoding","fileRef","Workspace","FileRef","refs","Array","isArray","reduce","result","ref","location","endsWith","replace","schemes","length","concat"],"sources":["../../src/tools/getInfo.ts"],"sourcesContent":["import type {IOSProjectInfo} from '@react-native-community/cli-types';\nimport execa from 'execa';\nimport {XMLParser} from 'fast-xml-parser';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type {IosInfo} from '../types';\n\nfunction isErrorLike(err: unknown): err is {message: string} {\n return Boolean(\n err &&\n typeof err === 'object' &&\n 'message' in err &&\n typeof err.message === 'string',\n );\n}\n\nfunction parseTargetList(json: string): IosInfo | undefined {\n try {\n const info = JSON.parse(json);\n\n if ('project' in info) {\n return info.project;\n } else if ('workspace' in info) {\n return info.workspace;\n }\n\n return undefined;\n } catch (error) {\n if (isErrorLike(error)) {\n const match = error.message.match(/xcodebuild: error: (.*)/);\n if (match) {\n throw new Error(match[0]);\n }\n }\n\n throw error;\n }\n}\n\nexport function getInfo(\n projectInfo: IOSProjectInfo,\n sourceDir: string,\n): IosInfo | undefined {\n if (!projectInfo.isWorkspace) {\n const xcodebuild = execa.sync('xcodebuild', ['-list', '-json']);\n return parseTargetList(xcodebuild.stdout);\n }\n\n const xmlParser = new XMLParser({ignoreAttributes: false});\n const xcworkspacedata = path.join(\n sourceDir,\n projectInfo.name,\n 'contents.xcworkspacedata',\n );\n const workspace = fs.readFileSync(xcworkspacedata, {encoding: 'utf-8'});\n const fileRef = xmlParser.parse(workspace).Workspace.FileRef;\n const refs = Array.isArray(fileRef) ? fileRef : [fileRef];\n\n return refs.reduce<IosInfo | undefined>((result, ref) => {\n const location = ref['@_location'];\n\n if (!location.endsWith('.xcodeproj')) {\n return result;\n }\n\n // Ignore the project generated by CocoaPods\n if (location.endsWith('/Pods.xcodeproj')) {\n return result;\n }\n\n const xcodebuild = execa.sync('xcodebuild', [\n '-list',\n '-json',\n '-project',\n path.join(sourceDir, location.replace('group:', '')),\n ]);\n const info = parseTargetList(xcodebuild.stdout);\n if (!info) {\n return result;\n }\n\n const schemes = info.schemes;\n\n // If this is the first project, use it as the \"main\" project\n if (!result) {\n if (!Array.isArray(schemes)) {\n info.schemes = [];\n }\n return info;\n }\n\n if (!Array.isArray(result.schemes)) {\n throw new Error(\"This shouldn't happen since we set it earlier\");\n }\n\n // For subsequent projects, merge schemes list\n if (Array.isArray(schemes) && schemes.length > 0) {\n result.schemes = result.schemes.concat(schemes);\n }\n\n return result;\n }, undefined);\n}\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAAA;AAAA;AAG7B,SAASA,WAAW,CAACC,GAAY,EAA4B;E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CAACO,OAAO,CAAC,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;MAChDN,MAAM,CAACK,OAAO,GAAGL,MAAM,CAACK,OAAO,CAACE,MAAM,CAACF,OAAO,CAAC;IACjD;IAEA,OAAOL,MAAM;EACf,CAAC,EAAE7B,SAAS,CAAC;AACf"}
{"version":3,"file":"getInfo.js","names":["isErrorLike","err","Boolean","message","parseTargetList","json","info","JSON","parse","project","workspace","undefined","error","match","Error","getInfo","projectInfo","sourceDir","isWorkspace","xcodebuild","execa","sync","stdout","xmlParser","XMLParser","ignoreAttributes","xcworkspacedata","path","join","name","fs","readFileSync","encoding","fileRef","Workspace","FileRef","refs","Array","isArray","reduce","result","ref","location","endsWith","replace","schemes","length","concat"],"sources":["../../src/tools/getInfo.ts"],"sourcesContent":["import type {IOSProjectInfo} from '@react-native-community/cli-types';\nimport execa from 'execa';\nimport {XMLParser} from 'fast-xml-parser';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type {IosInfo} from '../types';\n\nfunction isErrorLike(err: unknown): err is {message: string} {\n return Boolean(\n err &&\n typeof err === 'object' &&\n 'message' in err &&\n typeof err.message === 'string',\n );\n}\n\nfunction parseTargetList(json: string): IosInfo | undefined {\n try {\n const info = JSON.parse(json);\n\n if ('project' in info) {\n return info.project;\n } else if ('workspace' in info) {\n return info.workspace;\n }\n\n return undefined;\n } catch (error) {\n if (isErrorLike(error)) {\n const match = error.message.match(/xcodebuild: error: (.*)/);\n if (match) {\n throw new Error(match[0]);\n }\n }\n\n throw error;\n }\n}\n\nexport function getInfo(\n projectInfo: IOSProjectInfo,\n sourceDir: string,\n): IosInfo | undefined {\n if (!projectInfo.isWorkspace) {\n const xcodebuild = execa.sync('xcodebuild', ['-list', '-json']);\n return parseTargetList(xcodebuild.stdout);\n }\n\n const xmlParser = new XMLParser({ignoreAttributes: false});\n const xcworkspacedata = path.join(\n sourceDir,\n projectInfo.name,\n 'contents.xcworkspacedata',\n );\n const workspace = fs.readFileSync(xcworkspacedata, {encoding: 'utf-8'});\n const fileRef = xmlParser.parse(workspace).Workspace.FileRef;\n const refs = Array.isArray(fileRef) ? fileRef : [fileRef];\n\n return refs.reduce<IosInfo | undefined>((result, ref) => {\n const location = ref['@_location'];\n\n if (!location.endsWith('.xcodeproj')) {\n return result;\n }\n\n // Ignore the project generated by CocoaPods\n if (location.endsWith('/Pods.xcodeproj')) {\n return result;\n }\n\n const xcodebuild = execa.sync('xcodebuild', [\n '-list',\n '-json',\n '-project',\n path.join(sourceDir, location.replace('group:', '')),\n ]);\n const info = parseTargetList(xcodebuild.stdout);\n if (!info) {\n return result;\n }\n\n const schemes = info.schemes;\n\n // If this is the first project, use it as the \"main\" project\n if (!result) {\n if (!Array.isArray(schemes)) {\n info.schemes = [];\n }\n return info;\n }\n\n if (!Array.isArray(result.schemes)) {\n throw new Error(\"This shouldn't happen since we set it earlier\");\n }\n\n // For subsequent projects, merge schemes list\n if (Array.isArray(schemes) && schemes.length > 0) {\n result.schemes = result.schemes.concat(schemes);\n }\n\n return result;\n }, undefined);\n}\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAAA;AAAA;AAG7B,SAASA,WAAW,CAACC,GAAY,EAA4B;EAC3D,OAAOC,OAAO,CACZD,GAAG,IACD,OAAOA,GAAG,KAAK,QAAQ,IACvB,SAAS,IAAIA,GAAG,IAChB,OAAOA,GAAG,CAACE,OAAO,KAAK,QAAQ,CAClC;AACH;AAEA,SAASC,eAAe,CAACC,IAAY,EAAuB;EAC1D,IAAI;IACF,MAAMC,IAAI,GAAGC,IAAI,CAACC,KAAK,CAACH,IAAI,CAAC;IAE7B,IAAI,SAAS,IAAIC,IAAI,EAAE;MACrB,OAAOA,IAAI,CAACG,OAAO;IACrB,CAA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Y,CAAC;IAElC,IAAI,CAACC,QAAQ,CAACC,QAAQ,CAAC,YAAY,CAAC,EAAE;MACpC,OAAOH,MAAM;IACf;;IAEA;IACA,IAAIE,QAAQ,CAACC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;MACxC,OAAOH,MAAM;IACf;IAEA,MAAMrB,UAAU,GAAGC,gBAAK,CAACC,IAAI,CAAC,YAAY,EAAE,CAC1C,OAAO,EACP,OAAO,EACP,UAAU,EACVM,IAAI,GAACC,IAAI,CAACX,SAAS,EAAEyB,QAAQ,CAACE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CACrD,CAAC;IACF,MAAMtC,IAAI,GAAGF,eAAe,CAACe,UAAU,CAACG,MAAM,CAAC;IAC/C,IAAI,CAAChB,IAAI,EAAE;MACT,OAAOkC,MAAM;IACf;IAEA,MAAMK,OAAO,GAAGvC,IAAI,CAACuC,OAAO;;IAE5B;IACA,IAAI,CAACL,MAAM,EAAE;MACX,IAAI,CAACH,KAAK,CAACC,OAAO,CAACO,OAAO,CAAC,EAAE;QAC3BvC,IAAI,CAACuC,OAAO,GAAG,EAAE;MACnB;MACA,OAAOvC,IAAI;IACb;IAEA,IAAI,CAAC+B,KAAK,CAACC,OAAO,CAACE,MAAM,CAACK,OAAO,CAAC,EAAE;MAClC,MAAM,IAAI/B,KAAK,CAAC,+CAA+C,CAAC;IAClE;;IAEA;IACA,IAAIuB,KAAK,CAACC,OAAO,CAACO,OAAO,CAAC,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;MAChDN,MAAM,CAACK,OAAO,GAAGL,MAAM,CAACK,OAAO,CAACE,MAAM,CAACF,OAAO,CAAC;IACjD;IAEA,OAAOL,MAAM;EACf,CAAC,EAAE7B,SAAS,CAAC;AACf"}

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

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/listDevices.js.map
//# sourceMappingURL=listDevices.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["parseXcdeviceList","text","sdkNames","rawOutput","JSON","parse","devices","filter","device","includes","stripPlatform","platform","sort","simulator","map","isAvailable","available","name","udid","identifier","sdk","version","operatingSystemVersion","availabilityError","error","description","type","listDevices","xcdeviceOutput","execa","sync","stdout","parsedXcdeviceOutput","simctlOutput","parsedSimctlOutput","Object","keys","key","reduce","acc","val","concat","merged","matchedUdids","Set","forEach","first","match","find","second","add","push","item","has","replace"],"sources":["../../src/tools/listDevices.ts"],"sourcesContent":["import {Device} from '../types';\nimport execa from 'execa';\n\ntype DeviceOutput = {\n modelCode: string;\n simulator: boolean;\n modelName: string;\n error: {\n code: number;\n failureReason: string;\n underlyingErrors: [\n {\n code: number;\n failureReason: string;\n description: string;\n recoverySuggestion: string;\n domain: string;\n },\n ];\n description: string;\n recoverySuggestion: string;\n domain: string;\n };\n operatingSystemVersion: string;\n identifier: string;\n platform: string;\n architecture: string;\n interface: string;\n available: boolean;\n name: string;\n modelUTI: string;\n};\n\nconst parseXcdeviceList = (text: string, sdkNames: string[] = []): Device[] => {\n const rawOutput = JSON.parse(text) as DeviceOutput[];\n\n const devices: Device[] = rawOutput\n .filter((device) => sdkNames.includes(stripPlatform(device?.platform)))\n .sort((device) => (device.simulator ? 1 : -1))\n .map((device) => ({\n isAvailable: device.available,\n name: device.name,\n udid: device.identifier,\n sdk: device.platform,\n version: device.operatingSystemVersion,\n availabilityError: device.error?.description,\n type: device.simulator ? 'simulator' : 'device',\n }));\n return devices;\n};\n\n/**\n * Executes `xcrun xcdevice list` and `xcrun simctl list --json devices`, and connects parsed output of these two commands. We are running these two commands as they are necessary to display both physical devices and simulators. However, it's important to note that neither command provides a combined output of both.\n * @param sdkNames\n * @returns List of available devices and simulators.\n */\nasync function listDevices(sdkNames: string[]): Promise<Device[]> {\n const xcdeviceOutput = execa.sync('xcrun', ['xcdevice', 'list']).stdout;\n const parsedXcdeviceOutput = parseXcdeviceList(xcdeviceOutput, sdkNames);\n\n const simctlOutput = JSON.parse(\n execa.sync('xcrun', ['simctl', 'list', '--json', 'devices']).stdout,\n );\n\n const parsedSimctlOutput: Device[] = Object.keys(simctlOutput.devices)\n .map((key) => simctlOutput.devices[key])\n .reduce((acc, val) => acc.concat(val), []);\n\n const merged: Device[] = [];\n const matchedUdids = new Set();\n\n parsedXcdeviceOutput.forEach((first) => {\n const match = parsedSimctlOutput.find(\n (second) => first.udid === second.udid,\n );\n if (match) {\n matchedUdids.add(first.udid);\n merged.push({...first, ...match});\n } else {\n merged.push({...first});\n }\n });\n\n parsedSimctlOutput.forEach((item) => {\n if (!matchedUdids.has(item.udid)) {\n merged.push({...item});\n }\n });\n\n return merged.filter(({isAvailable}) => isAvailable === true);\n}\n\nexport function stripPlatform(platform: string): string {\n return platform.replace('com.apple.platform.', '');\n}\n\nexport default listDevices;\n"],"mappings":";;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAgC1B,MAAMA,iBAAiB,GAAG,CAACC,IAAY,EAAEC,QAAkB,GAAG,EAAE,KAAe;EAC7E,MAAMC,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAmB;EAEpD,MAAMK,OAAiB,GAAGH,SAAS,CAChCI,MAAM,CAAEC,MAAM,IAAKN,QAAQ,CAACO,QAAQ,CAACC,aAAa,CAACF,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEG,QAAQ,CAAC,CAAC,CAAC,CACtEC,IAAI,CAAEJ,MAAM,IAAMA,MAAM,CAACK,SAAS,GAAG,CAAC,GAAG,CAAC,CAAE,CAAC,CAC7CC,GAAG,CAAEN,MAAM;IAAA;IAAA,OAAM;MAChBO,WAAW,EAAEP,MAAM,CAACQ,SAAS;MAC7BC,IAAI,EAAET,MAAM,CAACS,IAAI;MACjBC,IAAI,EAAEV,MAAM,CAACW,UAAU;MACvBC,GAAG,EAAEZ,MAAM,CAACG,QAAQ;MACpBU,OAAO,EAAEb,MAAM,CAACc,sBAAsB;MACtCC,iBAAi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C;QAAC,GAAGL,KAAK;QAAE,GAAGC;MAAK,CAAC,CAAC;IACnC,CAAC,MAAM;MACLL,MAAM,CAACS,IAAI,CAAC;QAAC,GAAGL;MAAK,CAAC,CAAC;IACzB;EACF,CAAC,CAAC;EAEFZ,kBAAkB,CAACW,OAAO,CAAEO,IAAI,IAAK;IACnC,IAAI,CAACT,YAAY,CAACU,GAAG,CAACD,IAAI,CAAClC,IAAI,CAAC,EAAE;MAChCwB,MAAM,CAACS,IAAI,CAAC;QAAC,GAAGC;MAAI,CAAC,CAAC;IACxB;EACF,CAAC,CAAC;EAEF,OAAOV,MAAM,CAACnC,MAAM,CAAC,CAAC;IAACQ;EAAW,CAAC,KAAKA,WAAW,KAAK,IAAI,CAAC;AAC/D;AAEO,SAASL,aAAa,CAACC,QAAgB,EAAU;EACtD,OAAOA,QAAQ,CAAC2C,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC;AACpD;AAAC,eAEc3B,WAAW;AAAA"}
{"version":3,"file":"listDevices.js","names":["parseXcdeviceList","text","sdkNames","rawOutput","JSON","parse","devices","filter","device","includes","stripPlatform","platform","sort","simulator","map","isAvailable","available","name","udid","identifier","sdk","version","operatingSystemVersion","availabilityError","error","description","type","listDevices","xcdeviceOutput","execa","sync","stdout","parsedXcdeviceOutput","simctlOutput","parsedSimctlOutput","Object","keys","key","reduce","acc","val","concat","merged","matchedUdids","Set","forEach","first","match","find","second","add","push","item","has","replace"],"sources":["../../src/tools/listDevices.ts"],"sourcesContent":["import {Device} from '../types';\nimport execa from 'execa';\n\ntype DeviceOutput = {\n modelCode: string;\n simulator: boolean;\n modelName: string;\n error: {\n code: number;\n failureReason: string;\n underlyingErrors: [\n {\n code: number;\n failureReason: string;\n description: string;\n recoverySuggestion: string;\n domain: string;\n },\n ];\n description: string;\n recoverySuggestion: string;\n domain: string;\n };\n operatingSystemVersion: string;\n identifier: string;\n platform: string;\n architecture: string;\n interface: string;\n available: boolean;\n name: string;\n modelUTI: string;\n};\n\nconst parseXcdeviceList = (text: string, sdkNames: string[] = []): Device[] => {\n const rawOutput = JSON.parse(text) as DeviceOutput[];\n\n const devices: Device[] = rawOutput\n .filter((device) => sdkNames.includes(stripPlatform(device?.platform)))\n .sort((device) => (device.simulator ? 1 : -1))\n .map((device) => ({\n isAvailable: device.available,\n name: device.name,\n udid: device.identifier,\n sdk: device.platform,\n version: device.operatingSystemVersion,\n availabilityError: device.error?.description,\n type: device.simulator ? 'simulator' : 'device',\n }));\n return devices;\n};\n\n/**\n * Executes `xcrun xcdevice list` and `xcrun simctl list --json devices`, and connects parsed output of these two commands. We are running these two commands as they are necessary to display both physical devices and simulators. However, it's important to note that neither command provides a combined output of both.\n * @param sdkNames\n * @returns List of available devices and simulators.\n */\nasync function listDevices(sdkNames: string[]): Promise<Device[]> {\n const xcdeviceOutput = execa.sync('xcrun', ['xcdevice', 'list']).stdout;\n const parsedXcdeviceOutput = parseXcdeviceList(xcdeviceOutput, sdkNames);\n\n const simctlOutput = JSON.parse(\n execa.sync('xcrun', ['simctl', 'list', '--json', 'devices']).stdout,\n );\n\n const parsedSimctlOutput: Device[] = Object.keys(simctlOutput.devices)\n .map((key) => simctlOutput.devices[key])\n .reduce((acc, val) => acc.concat(val), []);\n\n const merged: Device[] = [];\n const matchedUdids = new Set();\n\n parsedXcdeviceOutput.forEach((first) => {\n const match = parsedSimctlOutput.find(\n (second) => first.udid === second.udid,\n );\n if (match) {\n matchedUdids.add(first.udid);\n merged.push({...first, ...match});\n } else {\n merged.push({...first});\n }\n });\n\n parsedSimctlOutput.forEach((item) => {\n if (!matchedUdids.has(item.udid)) {\n merged.push({...item});\n }\n });\n\n return merged.filter(({isAvailable}) => isAvailable === true);\n}\n\nexport function stripPlatform(platform: string): string {\n return platform.replace('com.apple.platform.', '');\n}\n\nexport default listDevices;\n"],"mappings":";;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAgC1B,MAAMA,iBAAiB,GAAG,CAACC,IAAY,EAAEC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@ "use strict";

exports.promptForSchemeSelection = promptForSchemeSelection;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
function _picocolors() {
const data = _interopRequireDefault(require("picocolors"));
_picocolors = function () {
return data;

@@ -70,5 +70,5 @@ };

}) => type === 'device' || type === 'simulator').map(d => {
const availability = !d.isAvailable && !!d.availabilityError ? _chalk().default.red(`(unavailable - ${d.availabilityError})`) : '';
const availability = !d.isAvailable && !!d.availabilityError ? _picocolors().default.red(`(unavailable - ${d.availabilityError})`) : '';
return {
title: `${_chalk().default.bold(`${d.name}${getVersionFromDevice(d)}`)} ${availability}`,
title: `${_picocolors().default.bold(`${d.name}${getVersionFromDevice(d)}`)} ${availability}`,
value: d,

@@ -97,2 +97,2 @@ disabled: !d.isAvailable

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/prompts.js.map
//# sourceMappingURL=prompts.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["getVersionFromDevice","version","match","promptForSchemeSelection","schemes","scheme","prompt","name","type","message","choices","map","value","title","promptForConfigurationSelection","configurations","configuration","promptForDeviceSelection","devices","device","filter","d","availability","isAvailable","availabilityError","chalk","red","bold","disabled","min","promptForDeviceToTailLogs","platformReadableName","simulators","udid","simulator","trim"],"sources":["../../src/tools/prompts.ts"],"sourcesContent":["import chalk from 'chalk';\nimport {Device} from '../types';\nimport {prompt} from '@react-native-community/cli-tools';\n\nfunction getVersionFromDevice({version}: Device) {\n return version ? ` (${version.match(/^(\\d+\\.\\d+)/)?.[1]})` : '';\n}\n\nexport async function promptForSchemeSelection(\n schemes: string[],\n): Promise<string> {\n const {scheme} = await prompt({\n name: 'scheme',\n type: 'select',\n message: 'Select the scheme you want to use',\n choices: schemes.map((value) => ({\n title: value,\n value: value,\n })),\n });\n\n return scheme;\n}\n\nexport async function promptForConfigurationSelection(\n configurations: string[],\n): Promise<string> {\n const {configuration} = await prompt({\n name: 'configuration',\n type: 'select',\n message: 'Select the configuration you want to use',\n choices: configurations.map((value) => ({\n title: value,\n value: value,\n })),\n });\n\n return configuration;\n}\n\nexport async function promptForDeviceSelection(\n devices: Device[],\n): Promise<Device | undefined> {\n const {device} = await prompt({\n type: 'select',\n name: 'device',\n message: 'Select the device you want to use',\n choices: devices\n .filter(({type}) => type === 'device' || type === 'simulator')\n .map((d) => {\n const availability =\n !d.isAvailable && !!d.availabilityError\n ? chalk.red(`(unavailable - ${d.availabilityError})`)\n : '';\n\n return {\n title: `${chalk.bold(\n `${d.name}${getVersionFromDevice(d)}`,\n )} ${availability}`,\n value: d,\n disabled: !d.isAvailable,\n };\n }),\n min: 1,\n });\n return device;\n}\n\nexport async function promptForDeviceToTailLogs(\n platformReadableName: string,\n simulators: Device[],\n): Promise<string> {\n const {udid} = await prompt({\n type: 'select',\n name: 'udid',\n message: `Select ${platformReadableName} simulators to tail logs from`,\n choices: simulators.map((simulator) => ({\n title: `${simulator.name}${getVersionFromDevice(simulator)}`.trim(),\n value: simulator.udid,\n })),\n });\n\n return udid;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAyD;AAEzD,SAASA,oBAAoB,CAAC;EAACC;AAAe,CAAC,EAAE;EAAA;EAC/C,OAAOA,OAAO,GAAI,KAAE,kBAAEA,OAAO,CAACC,KAAK,CAAC,aAAa,CAAC,mDAA5B,eAA+B,CAAC,CAAE,GAAE,GAAG,EAAE;AACjE;AAEO,eAAeC,wBAAwB,CAC5CC,OAAiB,EACA;EACjB,MAAM;IAACC;EAAM,CAAC,GAAG,MAAM,IAAAC,kBAAM,EAAC;IAC5BC,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,mCAAmC;IAC5CC,OAAO,EAAEN,OAAO,CAACO,GAAG,CAAEC,KAAK,KAAM;MAC/BC,KAAK,EAAED,KAAK;MACZA,KAAK,EAAEA;IACT,CAAC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BAAyB,CAC7CC,oBAA4B,EAC5BC,UAAoB,EACH;EACjB,MAAM;IAACC;EAAI,CAAC,GAAG,MAAM,IAAA3B,kBAAM,EAAC;IAC1BE,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE,MAAM;IACZE,OAAO,EAAG,UAASsB,oBAAqB,+BAA8B;IACtErB,OAAO,EAAEsB,UAAU,CAACrB,GAAG,CAAEuB,SAAS,KAAM;MACtCrB,KAAK,EAAG,GAAEqB,SAAS,CAAC3B,IAAK,GAAEP,oBAAoB,CAACkC,SAAS,CAAE,EAAC,CAACC,IAAI,EAAE;MACnEvB,KAAK,EAAEsB,SAAS,CAACD;IACnB,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOA,IAAI;AACb"}
{"version":3,"file":"prompts.js","names":["getVersionFromDevice","version","match","promptForSchemeSelection","schemes","scheme","prompt","name","type","message","choices","map","value","title","promptForConfigurationSelection","configurations","configuration","promptForDeviceSelection","devices","device","filter","d","availability","isAvailable","availabilityError","pico","red","bold","disabled","min","promptForDeviceToTailLogs","platformReadableName","simulators","udid","simulator","trim"],"sources":["../../src/tools/prompts.ts"],"sourcesContent":["import pico from 'picocolors';\nimport {Device} from '../types';\nimport {prompt} from '@react-native-community/cli-tools';\n\nfunction getVersionFromDevice({version}: Device) {\n return version ? ` (${version.match(/^(\\d+\\.\\d+)/)?.[1]})` : '';\n}\n\nexport async function promptForSchemeSelection(\n schemes: string[],\n): Promise<string> {\n const {scheme} = await prompt({\n name: 'scheme',\n type: 'select',\n message: 'Select the scheme you want to use',\n choices: schemes.map((value) => ({\n title: value,\n value: value,\n })),\n });\n\n return scheme;\n}\n\nexport async function promptForConfigurationSelection(\n configurations: string[],\n): Promise<string> {\n const {configuration} = await prompt({\n name: 'configuration',\n type: 'select',\n message: 'Select the configuration you want to use',\n choices: configurations.map((value) => ({\n title: value,\n value: value,\n })),\n });\n\n return configuration;\n}\n\nexport async function promptForDeviceSelection(\n devices: Device[],\n): Promise<Device | undefined> {\n const {device} = await prompt({\n type: 'select',\n name: 'device',\n message: 'Select the device you want to use',\n choices: devices\n .filter(({type}) => type === 'device' || type === 'simulator')\n .map((d) => {\n const availability =\n !d.isAvailable && !!d.availabilityError\n ? pico.red(`(unavailable - ${d.availabilityError})`)\n : '';\n\n return {\n title: `${pico.bold(\n `${d.name}${getVersionFromDevice(d)}`,\n )} ${availability}`,\n value: d,\n disabled: !d.isAvailable,\n };\n }),\n min: 1,\n });\n return device;\n}\n\nexport async function promptForDeviceToTailLogs(\n platformReadableName: string,\n simulators: Device[],\n): Promise<string> {\n const {udid} = await prompt({\n type: 'select',\n name: 'udid',\n message: `Select ${platformReadableName} simulators to tail logs from`,\n choices: simulators.map((simulator) => ({\n title: `${simulator.name}${getVersionFromDevice(simulator)}`.trim(),\n value: simulator.udid,\n })),\n });\n\n return udid;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAyD;AAEzD,SAASA,oBAAoB,CAAC;EAACC;AAAe,CAAC,EAAE;EAAA;EAC/C,OAAOA,OAAO,GAAI,KAAE,kBAAEA,OAAO,CAACC,KAAK,CAAC,aAAa,CAAC,mDAA5B,eAA+B,CAAC,CAAE,GAAE,GAAG,EAAE;AACjE;AAEO,eAAeC,wBAAwB,CAC5CC,OAAiB,EACA;EACjB,MAAM;IAACC;EAAM,CAAC,GAAG,MAAM,IAAAC,kBAAM,EAAC;IAC5BC,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,mCAAmC;IAC5CC,OAAO,EAAEN,OAAO,CAACO,GAAG,CAAEC,KAAK,KAAM;MAC/BC,KAAK,EAAED,KAAK;MACZA,KAAK,EAAEA;IACT,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOP,MAAM;AACf;AAEO,eAAeS,+BAA+B,CACnDC,cAAwB,EACP;EACjB,MAAM;IAACC;EAA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1BE,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE,MAAM;IACZE,OAAO,EAAG,UAASsB,oBAAqB,+BAA8B;IACtErB,OAAO,EAAEsB,UAAU,CAACrB,GAAG,CAAEuB,SAAS,KAAM;MACtCrB,KAAK,EAAG,GAAEqB,SAAS,CAAC3B,IAAK,GAAEP,oBAAoB,CAACkC,SAAS,CAAE,EAAC,CAACC,IAAI,EAAE;MACnEvB,KAAK,EAAEsB,SAAS,CAACD;IACnB,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOA,IAAI;AACb"}

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

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

@@ -35,3 +35,3 @@ };

} else {
_cliTools().logger.info(`Automatically selected ${_chalk().default.bold(scheme)} scheme.`);
_cliTools().logger.info(`Automatically selected ${_picocolors().default.bold(scheme)} scheme.`);
}

@@ -42,3 +42,3 @@ const configurations = info === null || info === void 0 ? void 0 : info.configurations;

} else {
_cliTools().logger.info(`Automatically selected ${_chalk().default.bold(mode)} configuration.`);
_cliTools().logger.info(`Automatically selected ${_picocolors().default.bold(mode)} configuration.`);
}

@@ -51,2 +51,2 @@ return {

//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/tools/selectFromInteractiveMode.js.map
//# sourceMappingURL=selectFromInteractiveMode.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":["selectFromInteractiveMode","scheme","mode","info","newScheme","newMode","schemes","length","promptForSchemeSelection","logger","chalk","bold","configurations","promptForConfigurationSelection"],"sources":["../../src/tools/selectFromInteractiveMode.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport chalk from 'chalk';\nimport {IosInfo} from '../types';\nimport {\n promptForConfigurationSelection,\n promptForSchemeSelection,\n} from './prompts';\n\ninterface Args {\n scheme?: string;\n mode?: string;\n info: IosInfo | undefined;\n}\n\nexport async function selectFromInteractiveMode({\n scheme,\n mode,\n info,\n}: Args): Promise<{scheme?: string; mode?: string}> {\n let newScheme = scheme;\n let newMode = mode;\n\n const schemes = info?.schemes;\n if (schemes && schemes.length > 1) {\n newScheme = await promptForSchemeSelection(schemes);\n } else {\n logger.info(`Automatically selected ${chalk.bold(scheme)} scheme.`);\n }\n\n const configurations = info?.configurations;\n if (configurations && configurations.length > 1) {\n newMode = await promptForConfigurationSelection(configurations);\n } else {\n logger.info(`Automatically selected ${chalk.bold(mode)} configuration.`);\n }\n\n return {\n scheme: newScheme,\n mode: newMode,\n };\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAGmB;AAQZ,eAAeA,yBAAyB,CAAC;EAC9CC,MAAM;EACNC,IAAI;EACJC;AACI,CAAC,EAA6C;EAClD,IAAIC,SAAS,GAAGH,MAAM;EACtB,IAAII,OAAO,GAAGH,IAAI;EAElB,MAAMI,OAAO,GAAGH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,OAAO;EAC7B,IAAIA,OAAO,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;IACjCH,SAAS,GAAG,MAAM,IAAAI,iCAAwB,EAACF,OAAO,CAAC;EACrD,CAAC,MAAM;IACLG,kBAAM,CAACN,IAAI,CAAE,0BAAyBO,gBAAK,CAACC,IAAI,CAACV,MAAM,CAAE,UAAS,CAAC;EACrE;EAEA,MAAMW,cAAc,GAAGT,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAES,cAAc;EAC3C,IAAIA,cAAc,IAAIA,cAAc,CAACL,MAAM,GAAG,CAAC,EAAE;IAC/CF,OAAO,GAAG,MAAM,IAAAQ,wCAA+B,EAACD,cAAc,CAAC;EACjE,CAAC,MAAM;IACLH,kBAAM,CAACN,IAAI,CAAE,0BAAyBO,gBAAK,CAACC,IAAI,CAACT,IAAI,CAAE,iBAAgB,CAAC;EAC1E;EAEA,OAAO;IACLD,MAAM,EAAEG,SAAS;IACjBF,IAAI,EAAEG;EACR,CAAC;AACH"}
{"version":3,"file":"selectFromInteractiveMode.js","names":["selectFromInteractiveMode","scheme","mode","info","newScheme","newMode","schemes","length","promptForSchemeSelection","logger","pico","bold","configurations","promptForConfigurationSelection"],"sources":["../../src/tools/selectFromInteractiveMode.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport pico from 'picocolors';\nimport {IosInfo} from '../types';\nimport {\n promptForConfigurationSelection,\n promptForSchemeSelection,\n} from './prompts';\n\ninterface Args {\n scheme?: string;\n mode?: string;\n info: IosInfo | undefined;\n}\n\nexport async function selectFromInteractiveMode({\n scheme,\n mode,\n info,\n}: Args): Promise<{scheme?: string; mode?: string}> {\n let newScheme = scheme;\n let newMode = mode;\n\n const schemes = info?.schemes;\n if (schemes && schemes.length > 1) {\n newScheme = await promptForSchemeSelection(schemes);\n } else {\n logger.info(`Automatically selected ${pico.bold(scheme)} scheme.`);\n }\n\n const configurations = info?.configurations;\n if (configurations && configurations.length > 1) {\n newMode = await promptForConfigurationSelection(configurations);\n } else {\n logger.info(`Automatically selected ${pico.bold(mode)} configuration.`);\n }\n\n return {\n scheme: newScheme,\n mode: newMode,\n };\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;AAGmB;AAQZ,eAAeA,yBAAyB,CAAC;EAC9CC,MAAM;EACNC,IAAI;EACJC;AACI,CAAC,EAA6C;EAClD,IAAIC,SAAS,GAAGH,MAAM;EACtB,IAAII,OAAO,GAAGH,IAAI;EAElB,MAAMI,OAAO,GAAGH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,OAAO;EAC7B,IAAIA,OAAO,IAAIA,OAAO,CAACC,MAAM,GAAG,CAAC,EAAE;IACjCH,SAAS,GAAG,MAAM,IAAAI,iCAAwB,EAACF,OAAO,CAAC;EACrD,CAAC,MAAM;IACLG,kBAAM,CAACN,IAAI,CAAE,0BAAyBO,qBAAI,CAACC,IAAI,CAACV,MAAM,CAAE,UAAS,CAAC;EACpE;EAEA,MAAMW,cAAc,GAAGT,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAES,cAAc;EAC3C,IAAIA,cAAc,IAAIA,cAAc,CAACL,MAAM,GAAG,CAAC,EAAE;IAC/CF,OAAO,GAAG,MAAM,IAAAQ,wCAA+B,EAACD,cAAc,CAAC;EACjE,CAAC,MAAM;IACLH,kBAAM,CAACN,IAAI,CAAE,0BAAyBO,qBAAI,CAACC,IAAI,CAACT,IAAI,CAAE,iBAAgB,CAAC;EACzE;EAEA,OAAO;IACLD,MAAM,EAAEG,SAAS;IACjBF,IAAI,EAAEG;EACR,CAAC;AACH"}
"use strict";
//# sourceMappingURL=/Users/thymikee/Developer/rnccli/packages/cli-platform-apple/build/types.js.map
//# sourceMappingURL=types.js.map

@@ -1,1 +0,1 @@

{"version":3,"names":[],"sources":["../src/types.ts"],"sourcesContent":["import {supportedPlatforms} from '@react-native-community/cli-config-apple';\n\ntype ObjectValues<T> = T[keyof T];\n\nexport type ApplePlatform = ObjectValues<typeof supportedPlatforms>;\nexport interface Device {\n name: string;\n udid: string;\n state?: string;\n availability?: string;\n isAvailable?: boolean;\n version?: string;\n sdk?: string;\n availabilityError?: string;\n type?: DeviceType;\n lastBootedAt?: string;\n}\n\nexport type DeviceType = 'simulator' | 'device' | 'catalyst';\n\nexport interface IosInfo {\n name: string;\n schemes?: string[];\n configurations?: string[];\n targets?: string[];\n}\n\nexport interface BuilderCommand {\n /**\n * Lowercase name of the platform.\n * Example: 'ios', 'visionos'\n */\n platformName: ApplePlatform;\n}\n"],"mappings":""}
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import {supportedPlatforms} from '@react-native-community/cli-config-apple';\n\ntype ObjectValues<T> = T[keyof T];\n\nexport type ApplePlatform = ObjectValues<typeof supportedPlatforms>;\nexport interface Device {\n name: string;\n udid: string;\n state?: string;\n availability?: string;\n isAvailable?: boolean;\n version?: string;\n sdk?: string;\n availabilityError?: string;\n type?: DeviceType;\n lastBootedAt?: string;\n}\n\nexport type DeviceType = 'simulator' | 'device' | 'catalyst';\n\nexport interface IosInfo {\n name: string;\n schemes?: string[];\n configurations?: string[];\n targets?: string[];\n}\n\nexport interface BuilderCommand {\n /**\n * Lowercase name of the platform.\n * Example: 'ios', 'visionos'\n */\n platformName: ApplePlatform;\n}\n"],"mappings":""}
{
"name": "@react-native-community/cli-platform-apple",
"version": "20.0.2",
"version": "20.1.0",
"license": "MIT",

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

"dependencies": {
"@react-native-community/cli-config-apple": "20.0.2",
"@react-native-community/cli-tools": "20.0.2",
"chalk": "^4.1.2",
"@react-native-community/cli-config-apple": "20.1.0",
"@react-native-community/cli-tools": "20.1.0",
"execa": "^5.0.0",
"fast-xml-parser": "^4.4.1"
"fast-xml-parser": "^4.4.1",
"picocolors": "^1.1.1"
},
"devDependencies": {
"@react-native-community/cli-types": "20.0.2"
"@react-native-community/cli-types": "20.1.0"
},

@@ -31,3 +31,3 @@ "files": [

},
"gitHead": "7c8951c9cd536d9688fd14fe39a977cbe3ec91c5"
"gitHead": "24f026e108a6ef9a01c37b6be215361de38ce640"
}