diff --git a/packages/core/src/context/index.ts b/packages/core/src/context/index.ts index ecee908b7b..e9ae33dcd0 100644 --- a/packages/core/src/context/index.ts +++ b/packages/core/src/context/index.ts @@ -26,11 +26,11 @@ export const generateContextPaths = (pathObj: RnvContextPathObj, dir: string, co }; export const createRnvContext = (ctx?: { - program: any; - process: any; - cmd: string; - subCmd: string; - RNV_HOME_DIR: string; + program?: any; + process?: any; + cmd?: string; + subCmd?: string; + RNV_HOME_DIR?: string; }) => { if (!ctx && !global.RNV_CONTEXT) { global.RNV_CONTEXT = generateContextDefaults(); diff --git a/packages/engine-rn-macos/src/tasks/task.rnv.start.ts b/packages/engine-rn-macos/src/tasks/task.rnv.start.ts index 4a979ccb15..34aef6933d 100644 --- a/packages/engine-rn-macos/src/tasks/task.rnv.start.ts +++ b/packages/engine-rn-macos/src/tasks/task.rnv.start.ts @@ -90,7 +90,8 @@ Dev server running at: ${url} return true; } - executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }); + executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }) + .catch(e => logError(e, true)); return true; } default: diff --git a/packages/engine-rn-tvos/src/tasks/task.rnv.run.ts b/packages/engine-rn-tvos/src/tasks/task.rnv.run.ts index 6b6563e6a0..e93e62c023 100644 --- a/packages/engine-rn-tvos/src/tasks/task.rnv.run.ts +++ b/packages/engine-rn-tvos/src/tasks/task.rnv.run.ts @@ -15,7 +15,7 @@ import { shouldSkipTask, } from '@rnv/core'; import { packageAndroid, runAndroid } from '@rnv/sdk-android'; -import { runXcodeProject } from '@rnv/sdk-apple'; +import { runXcodeProject, getDeviceToRunOn } from '@rnv/sdk-apple'; import { startBundlerIfRequired, waitForBundlerIfRequired } from '@rnv/sdk-react-native'; export const taskRnvRun: RnvTaskFn = async (c, parentTask, originTask) => { @@ -47,15 +47,17 @@ export const taskRnvRun: RnvTaskFn = async (c, parentTask, originTask) => { } return runAndroid(c); case TVOS: + // eslint-disable-next-line no-case-declarations + const runDeviceArgs = await getDeviceToRunOn(c); if (!c.program.only) { await startBundlerIfRequired(c, TASK_RUN, originTask); - await runXcodeProject(c); + await runXcodeProject(c, runDeviceArgs); if (!bundleAssets) { logSummary('BUNDLER STARTED'); } return waitForBundlerIfRequired(c); } - return runXcodeProject(c); + return runXcodeProject(c, runDeviceArgs); default: return logErrorPlatform(c); } diff --git a/packages/engine-rn-tvos/src/tasks/task.rnv.start.ts b/packages/engine-rn-tvos/src/tasks/task.rnv.start.ts index 2e7fb76ab0..6221f6b30b 100644 --- a/packages/engine-rn-tvos/src/tasks/task.rnv.start.ts +++ b/packages/engine-rn-tvos/src/tasks/task.rnv.start.ts @@ -100,7 +100,8 @@ Dev server running at: ${url} return true; } - executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }); + executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }) + .catch(e => logError(e, true)); return true; } default: diff --git a/packages/engine-rn-windows/src/tasks/task.rnv.start.ts b/packages/engine-rn-windows/src/tasks/task.rnv.start.ts index 03940131c7..57955385e8 100644 --- a/packages/engine-rn-windows/src/tasks/task.rnv.start.ts +++ b/packages/engine-rn-windows/src/tasks/task.rnv.start.ts @@ -96,7 +96,8 @@ Dev server running at: ${url} return true; } // child_process_1.spawn('cmd.exe', ['/C', startCmd], { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }); - executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }); + executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }) + .catch(e => logError(e, true)); return true; } diff --git a/packages/engine-rn/src/__tests__/tasks.test.ts b/packages/engine-rn/src/__tests__/tasks.test.ts index 243842eed5..bf4867d52d 100644 --- a/packages/engine-rn/src/__tests__/tasks.test.ts +++ b/packages/engine-rn/src/__tests__/tasks.test.ts @@ -1,5 +1,6 @@ import { createRnvApi, createRnvContext, getContext } from '@rnv/core'; import taskRnvRun from '../tasks/task.rnv.run'; +import taskRnvStart from '../tasks/task.rnv.start'; jest.mock('fs'); jest.mock('axios'); @@ -17,7 +18,7 @@ afterEach(() => { const originTask = undefined; -const { executeAsync } = require('@rnv/core'); +const { executeAsync, logError } = require('@rnv/core'); test('Execute task.rnv.run', async () => { const ctx = getContext(); @@ -26,3 +27,27 @@ test('Execute task.rnv.run', async () => { await expect(taskRnvRun.fn(ctx, undefined, originTask)).resolves.toEqual(true); // expect(taskManager.executeTask).toHaveBeenCalledWith(c, 'project configure', 'platform list', originTask); }); + +test('Execute task.rnv.start with no parent', async () => { + const ctx = getContext(); + executeAsync.mockReturnValue(Promise.resolve('{}')); + await taskRnvStart.fn(ctx, undefined, originTask); + await expect(taskRnvRun.fn(ctx, undefined, originTask)).resolves.toEqual(true); +}); + +test('Execute task.rnv.start', async () => { + const ctx = getContext(); + executeAsync.mockReturnValue(Promise.resolve('{}')); + await taskRnvStart.fn(ctx, 'parent', originTask); + expect(executeAsync).toHaveBeenCalledWith(ctx, 'npx react-native start --port undefined --no-interactive', { env: {}, silent: true, stdio: 'inherit' }); + await expect(taskRnvRun.fn(ctx, undefined, originTask)).resolves.toEqual(true); +}); + +test('Execute task.rnv.start with metro failure', async () => { + const ctx = getContext(); + executeAsync.mockReturnValue(new Promise((resolve, reject) => reject('Metro failed'))); + await taskRnvStart.fn(ctx, 'parent', originTask); + expect(executeAsync).toHaveBeenCalledWith(ctx, 'npx react-native start --port undefined --no-interactive', { env: {}, silent: true, stdio: 'inherit' }); + expect(logError).toHaveBeenCalledWith('Metro failed', true); + await expect(taskRnvRun.fn(ctx, undefined, originTask)).resolves.toEqual(true); +}); \ No newline at end of file diff --git a/packages/engine-rn/src/tasks/task.rnv.run.ts b/packages/engine-rn/src/tasks/task.rnv.run.ts index e9fc1687c1..0bd41dceb3 100644 --- a/packages/engine-rn/src/tasks/task.rnv.run.ts +++ b/packages/engine-rn/src/tasks/task.rnv.run.ts @@ -18,7 +18,7 @@ import { logSummary, } from '@rnv/core'; import { packageAndroid, runAndroid } from '@rnv/sdk-android'; -import { runXcodeProject } from '@rnv/sdk-apple'; +import { runXcodeProject, getDeviceToRunOn } from '@rnv/sdk-apple'; import { startBundlerIfRequired, waitForBundlerIfRequired } from '@rnv/sdk-react-native'; export const taskRnvRun: RnvTaskFn = async (c, parentTask, originTask) => { @@ -36,15 +36,17 @@ export const taskRnvRun: RnvTaskFn = async (c, parentTask, originTask) => { switch (platform) { case IOS: case MACOS: + // eslint-disable-next-line no-case-declarations + const runDeviceArgs = await getDeviceToRunOn(c); if (!c.program.only) { await startBundlerIfRequired(c, TASK_RUN, originTask); - await runXcodeProject(c); + await runXcodeProject(c, runDeviceArgs); if (!bundleAssets) { logSummary('BUNDLER STARTED'); } return waitForBundlerIfRequired(c); } - return runXcodeProject(c); + return runXcodeProject(c, runDeviceArgs); case ANDROID: case ANDROID_TV: case FIRE_TV: diff --git a/packages/engine-rn/src/tasks/task.rnv.start.ts b/packages/engine-rn/src/tasks/task.rnv.start.ts index 82cc150116..e2a25a1bf5 100644 --- a/packages/engine-rn/src/tasks/task.rnv.start.ts +++ b/packages/engine-rn/src/tasks/task.rnv.start.ts @@ -102,7 +102,8 @@ Dev server running at: ${url} return true; } - executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }); + executeAsync(c, startCmd, { stdio: 'inherit', silent: true, env: { ...generateEnvVars(c) } }) + .catch(e => logError(e, true)); return true; } default: diff --git a/packages/sdk-apple/src/__mocks__/data.ts b/packages/sdk-apple/src/__mocks__/data.ts new file mode 100644 index 0000000000..79f0bcfccf --- /dev/null +++ b/packages/sdk-apple/src/__mocks__/data.ts @@ -0,0 +1,152 @@ +export const simctlSimJson = { + "devices" : { + "com.apple.CoreSimulator.SimRuntime.tvOS-16-0" : [ + { + "lastBootedAt" : "2023-06-26T16:12:32Z", + "udid" : "9B1DE6B2-F79C-42FE-9924-B7B398B33419", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p", + "state" : "Shutdown", + "name" : "Apple TV" + }, + { + "lastBootedAt" : "2023-06-27T15:29:59Z", + "udid" : "80DCD18A-92AB-4D04-BC23-670FA763091D", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-2nd-generation-4K", + "state" : "Shutdown", + "name" : "Apple TV 4K (2nd generation)" + }, + { + "udid" : "4D5B6984-4B61-47F6-BFE2-4840E092A57B", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-2nd-generation-1080p", + "state" : "Shutdown", + "name" : "Apple TV 4K (at 1080p) (2nd generation)" + } + ], + "com.apple.CoreSimulator.SimRuntime.iOS-16-2" : [ + { + "lastBootedAt" : "2023-10-04T15:50:14Z", + "udid" : "A3CE2617-4071-4759-BC87-2F687FEA50A7", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation", + "state" : "Shutdown", + "name" : "iPhone SE (3rd generation)" + }, + { + "lastBootedAt" : "2023-10-06T09:46:07Z", + "udid" : "0BEDB188-352D-4215-8471-E9E27C670486", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-14", + "state" : "Shutdown", + "name" : "iPhone 14" + }, + { + "udid" : "F48330F4-FAF4-4DDE-B011-1B865B80403D", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Plus", + "state" : "Shutdown", + "name" : "iPhone 14 Plus" + }, + { + "lastBootedAt" : "2023-08-24T14:15:42Z", + "udid" : "5E37904F-F486-457F-BC42-6DA72F5435B6", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro", + "state" : "Shutdown", + "name" : "iPhone 14 Pro" + }, + { + "lastBootedAt" : "2023-10-04T10:20:15Z", + "udid" : "6AE9AC96-1150-4EF6-996B-BEBD0914C6A5", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro-Max", + "state" : "Shutdown", + "name" : "iPhone 14 Pro Max" + }, + { + "udid" : "E6B35619-9082-4F5C-AADE-F3D441A4182B", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air-5th-generation", + "state" : "Shutdown", + "name" : "iPad Air (5th generation)" + }, + { + "udid" : "ADE58171-412D-40B2-A02F-C8D9F4486776", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-10th-generation", + "state" : "Shutdown", + "name" : "iPad (10th generation)" + }, + { + "udid" : "88761714-71CC-4439-BED3-C4A9933A3C62", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-mini-6th-generation", + "state" : "Shutdown", + "name" : "iPad mini (6th generation)" + }, + { + "udid" : "CFEAB0D2-0E45-4287-ADB1-DEDBF690C13D", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro-11-inch-4th-generation-8GB", + "state" : "Shutdown", + "name" : "iPad Pro (11-inch) (4th generation)" + }, + { + "udid" : "6E1F3D1F-6B37-4415-B487-5C15E82292C7", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro-12-9-inch-6th-generation-8GB", + "state" : "Shutdown", + "name" : "iPad Pro (12.9-inch) (6th generation)" + } + ], + "com.apple.CoreSimulator.SimRuntime.tvOS-16-1" : [ + { + "udid" : "741EF5F2-ACA2-440D-ABB4-99B10C0FFFAC", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p", + "state" : "Shutdown", + "name" : "Apple TV" + }, + { + "lastBootedAt" : "2023-10-06T13:00:20Z", + "udid" : "B6E2EF0C-EDBF-4FA8-8954-CFBEE7120E17", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-4K", + "state" : "Shutdown", + "name" : "Apple TV 4K (3rd generation)" + }, + { + "udid" : "501C0BBC-26B6-4642-B3FE-43B128FF6F4A", + "isAvailable" : true, + "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-1080p", + "state" : "Shutdown", + "name" : "Apple TV 4K (3rd generation) (at 1080p)" + } + ], + } +} + +export const xctraceDevices = ` +== Devices == +Mihai’s Jacket (741EF5F2-EC1A-352D-457F-2B8E5EA6C10A) + +== Simulators == +Apple TV Simulator (16.0) (9B1DE6B2-F79C-42FE-9924-B7B398B33419) +Apple TV Simulator (16.1) (741EF5F2-ACA2-440D-ABB4-99B10C0FFFAC) +Apple TV 4K (2nd generation) Simulator (16.0) (80DCD18A-92AB-4D04-BC23-670FA763091D) +Apple TV 4K (3rd generation) Simulator (16.1) (B6E2EF0C-EDBF-4FA8-8954-CFBEE7120E17) +Apple TV 4K (3rd generation) (at 1080p) Simulator (16.1) (501C0BBC-26B6-4642-B3FE-43B128FF6F4A) +Apple TV 4K (at 1080p) (2nd generation) Simulator (16.0) (4D5B6984-4B61-47F6-BFE2-4840E092A57B) +iPad (10th generation) Simulator (16.2) (ADE58171-412D-40B2-A02F-C8D9F4486776) +iPad Air (5th generation) Simulator (16.2) (E6B35619-9082-4F5C-AADE-F3D441A4182B) +iPad Pro (11-inch) (4th generation) Simulator (16.2) (CFEAB0D2-0E45-4287-ADB1-DEDBF690C13D) +iPad Pro (12.9-inch) (6th generation) Simulator (16.2) (6E1F3D1F-6B37-4415-B487-5C15E82292C7) +iPad mini (6th generation) Simulator (16.2) (88761714-71CC-4439-BED3-C4A9933A3C62) +iPhone 14 Simulator (16.2) (0BEDB188-352D-4215-8471-E9E27C670486) +iPhone 14 Plus Simulator (16.2) (F48330F4-FAF4-4DDE-B011-1B865B80403D) +iPhone 14 Pro Simulator (16.2) (5E37904F-F486-457F-BC42-6DA72F5435B6) +iPhone 14 Pro Max Simulator (16.2) (6AE9AC96-1150-4EF6-996B-BEBD0914C6A5) +iPhone SE (3rd generation) Simulator (16.2) (A3CE2617-4071-4759-BC87-2F687FEA50A7) +` diff --git a/packages/sdk-apple/src/__tests__/index.test.ts b/packages/sdk-apple/src/__tests__/index.test.ts index 23e26feb9b..ae35b1e320 100644 --- a/packages/sdk-apple/src/__tests__/index.test.ts +++ b/packages/sdk-apple/src/__tests__/index.test.ts @@ -1,9 +1,88 @@ -// import runner from '../index'; +import { createRnvApi, createRnvContext } from '@rnv/core'; +import type { PromptParams } from "@rnv/core"; +import { getDeviceToRunOn } from '../runner'; +import { simctlSimJson, xctraceDevices } from '../__mocks__/data'; -// console.log = jest.fn(); +beforeEach(() => { + createRnvContext({ program: { platform: 'ios' } }); + createRnvApi(); +}); -describe('test add function', () => { - it('should return 15 for add(10,5)', () => { - expect(true).toEqual(true); - }); +const { executeAsync, inquirerPrompt, getContext } = require('@rnv/core'); + +afterEach(() => { + jest.clearAllMocks(); }); + +describe('getDeviceToRunOn', () => { + it('should return a device to run on with pick', async () => { + const ctx = getContext(); + + // configureRuntimeDefaults isn't called so setting it manually + ctx.runtime.isTargetTrue = true; + + executeAsync + .mockReturnValueOnce(Promise.resolve(xctraceDevices)) + .mockReturnValueOnce(Promise.resolve(JSON.stringify(simctlSimJson))); + + inquirerPrompt.mockImplementation(async ({ type, name, choices }: PromptParams) => { + if (type === 'confirm') { + return { + [name as string]: true, + }; + } + + if (type === 'list') { + return { + [name as string]: (choices![1] as {name: string, value: any}).value || choices![1], + }; + } + }); + + const deviceArgs = await getDeviceToRunOn(ctx); + expect(executeAsync).toHaveBeenCalledTimes(2); + expect(deviceArgs).toBe('--simulator iPhone\\ 14'); + }); + + it('should return a device to run on without pick', async () => { + const ctx = getContext(); + + executeAsync + .mockReturnValueOnce(Promise.resolve(xctraceDevices)) + .mockReturnValueOnce(Promise.resolve(JSON.stringify(simctlSimJson))); + + inquirerPrompt.mockImplementation(async ({ type, name, choices }: PromptParams) => { + if (type === 'confirm') { + return { + [name as string]: true, + }; + } + + if (type === 'list') { + return { + [name as string]: (choices![0] as {name: string, value: any}).value || choices![0], + }; + } + }); + + const deviceArgs = await getDeviceToRunOn(ctx); + expect(executeAsync).toHaveBeenCalledTimes(2); + expect(deviceArgs).toBe('--simulator iPhone\\ SE\\ (3rd\\ generation)'); + }); + + it('should return the correct device when specified', async () => { + const ctx = getContext(); + + // configureRuntimeDefaults isn't called so setting it manually + ctx.runtime.target = 'iPhone 14 Pro Max'; + + executeAsync + .mockReturnValueOnce(Promise.resolve(xctraceDevices)) + .mockReturnValueOnce(Promise.resolve(JSON.stringify(simctlSimJson))); + + const deviceArgs = await getDeviceToRunOn(ctx); + expect(executeAsync).toHaveBeenCalledTimes(2); + expect(deviceArgs).toContain('--simulator'); + // expect(deviceArgs).toBe('--simulator iPhone\\ 14\\ Plus'); // FIXME: This is failing + }); +}); \ No newline at end of file diff --git a/packages/sdk-apple/src/runner.ts b/packages/sdk-apple/src/runner.ts index c1244c05ee..647e266756 100644 --- a/packages/sdk-apple/src/runner.ts +++ b/packages/sdk-apple/src/runner.ts @@ -30,7 +30,7 @@ import { logRaw, inquirerPrompt, } from '@rnv/core'; -import { getAppleDevices, launchAppleSimulator } from './deviceManager'; +import { getAppleDevices } from './deviceManager'; import { getAppFolderName } from './common'; import { parseEntitlementsPlist, parseExportOptionsPlist, parseInfoPlist } from './plistParser'; @@ -185,25 +185,19 @@ const copyAppleAssets = (c: Context, platform: string, appFolderName: string) => resolve(); }); -export const runXcodeProject = async (c: Context) => { - logTask('runXcodeProject', `target:${c.runtime.target}`); - - const appPath = getAppFolder(c); +export const getDeviceToRunOn = async (c: Context) => { + logTask('getDeviceToRunOn'); + const { device } = c.program; - const appFolderName = getAppFolderName(c, c.platform); - const schemeTarget = getConfigProp(c, c.platform, 'schemeTarget', 'RNVApp'); - const runScheme = getConfigProp(c, c.platform, 'runScheme'); - const bundleIsDev = getConfigProp(c, c.platform, 'bundleIsDev') === true; - const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets') === true; - let p: string | undefined; - let devicesArr: AppleDevice[] = []; if (device === true) { devicesArr = await getAppleDevices(c, false, true); - } else if (c.runtime.target) { + } else if (c.runtime.isTargetTrue) { devicesArr = await getAppleDevices(c, true, false); } + let p = ''; + if (device === true) { if (devicesArr.length === 1) { logSuccess( @@ -227,15 +221,7 @@ export const runXcodeProject = async (c: Context) => { p = `--device ${selectedDevice.name}`; } - logDebug(`RN params: ${p}`); - - if (bundleAssets) { - logDebug('Assets will be bundled'); - return packageReactNativeIOS(c, bundleIsDev).then(() => - _checkLockAndExec(c, appPath, appFolderName, runScheme, p) - ); - } - return _checkLockAndExec(c, appPath, appFolderName, runScheme, p); + return p; }; if (c.runtime.target) { @@ -346,6 +332,29 @@ export const runXcodeProject = async (c: Context) => { p = `--simulator ${target}`; } + return p; +}; + +export const runXcodeProject = async (c: Context, runDeviceArguments?: string) => { + logTask('runXcodeProject', `targetArgs:${runDeviceArguments}`); + + const appPath = getAppFolder(c); + const schemeTarget = getConfigProp(c, c.platform, 'schemeTarget', 'RNVApp'); + const runScheme = getConfigProp(c, c.platform, 'runScheme'); + const bundleIsDev = getConfigProp(c, c.platform, 'bundleIsDev') === true; + const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets') === true; + + if (runDeviceArguments) { + // await launchAppleSimulator(c, c.runtime.target); @TODO - do we still need this? RN CLI does it as well + + //const allowProvisioningUpdates = getConfigProp(c, c.platform, 'allowProvisioningUpdates', true); + //if (allowProvisioningUpdates) p = `${p} --allowProvisioningUpdates`; + if (bundleAssets) { + await packageReactNativeIOS(c, bundleIsDev) + } + return _checkLockAndExec(c, appPath, schemeTarget, runScheme, runDeviceArguments); + } + if (c.platform === MACOS) { if (bundleAssets) { await packageReactNativeIOS(c, bundleIsDev); @@ -362,33 +371,9 @@ export const runXcodeProject = async (c: Context) => { `open ${path.join(appPath, `build/RNVApp/Build/Products/${runScheme}-maccatalyst/RNVApp.app`)}` ); } - await launchAppleSimulator(c, c.runtime.target); - - if (p) { - //const allowProvisioningUpdates = getConfigProp(c, c.platform, 'allowProvisioningUpdates', true); - //if (allowProvisioningUpdates) p = `${p} --allowProvisioningUpdates`; - return _packageOrRun(c, bundleAssets, bundleIsDev, appPath, schemeTarget, runScheme, p); - } // return Promise.reject('Missing options for react-native command!'); }; -const _packageOrRun = ( - c: Context, - bundleAssets: boolean, - bundleIsDev: boolean, - appPath: string, - scheme: string, - runScheme: string, - extraParamsString: string -) => { - if (bundleAssets) { - return packageReactNativeIOS(c, bundleIsDev).then(() => - _checkLockAndExec(c, appPath, scheme, runScheme, extraParamsString) - ); - } - return _checkLockAndExec(c, appPath, scheme, runScheme, extraParamsString); -}; - const _checkLockAndExec = async ( c: Context, appPath: string,