@@ -265,26 +265,41 @@ async function runOnDevice(
265
265
args ,
266
266
) ;
267
267
268
- const iosDeployInstallArgs = [
269
- '--bundle' ,
270
- getBuildPath ( xcodeProject , args . configuration , buildOutput , scheme ) ,
271
- '--id' ,
272
- selectedDevice . udid ,
273
- '--justlaunch' ,
274
- ] ;
275
-
276
- logger . info ( `Installing and launching your app on ${ selectedDevice . name } ` ) ;
268
+ if ( selectedDevice . type === 'catalyst' ) {
269
+ const appPath = getBuildPath (
270
+ xcodeProject ,
271
+ args . configuration ,
272
+ buildOutput ,
273
+ scheme ,
274
+ true ,
275
+ ) ;
276
+ const appProcess = child_process . spawn ( `${ appPath } /${ scheme } ` , [ ] , {
277
+ detached : true ,
278
+ stdio : 'ignore' ,
279
+ } ) ;
280
+ appProcess . unref ( ) ;
281
+ } else {
282
+ const iosDeployInstallArgs = [
283
+ '--bundle' ,
284
+ getBuildPath ( xcodeProject , args . configuration , buildOutput , scheme ) ,
285
+ '--id' ,
286
+ selectedDevice . udid ,
287
+ '--justlaunch' ,
288
+ ] ;
277
289
278
- const iosDeployOutput = child_process . spawnSync (
279
- 'ios-deploy' ,
280
- iosDeployInstallArgs ,
281
- { encoding : 'utf8' } ,
282
- ) ;
290
+ logger . info ( `Installing and launching your app on ${ selectedDevice . name } ` ) ;
283
291
284
- if ( iosDeployOutput . error ) {
285
- throw new CLIError (
286
- `Failed to install the app on the device. We've encountered an error in "ios-deploy" command: ${ iosDeployOutput . error . message } ` ,
292
+ const iosDeployOutput = child_process . spawnSync (
293
+ 'ios-deploy' ,
294
+ iosDeployInstallArgs ,
295
+ { encoding : 'utf8' } ,
287
296
) ;
297
+
298
+ if ( iosDeployOutput . error ) {
299
+ throw new CLIError (
300
+ `Failed to install the app on the device. We've encountered an error in "ios-deploy" command: ${ iosDeployOutput . error . message } ` ,
301
+ ) ;
302
+ }
288
303
}
289
304
290
305
return logger . success ( 'Installed the app on the device.' ) ;
@@ -415,6 +430,7 @@ function getBuildPath(
415
430
configuration : string ,
416
431
buildOutput : string ,
417
432
scheme : string ,
433
+ isCatalyst : boolean = false ,
418
434
) {
419
435
const buildSettings = child_process . execFileSync (
420
436
'xcodebuild' ,
@@ -442,7 +458,9 @@ function getBuildPath(
442
458
throw new CLIError ( 'Failed to get the app name.' ) ;
443
459
}
444
460
445
- return `${ targetBuildDir } /${ executableFolderPath } ` ;
461
+ return `${ targetBuildDir } ${
462
+ isCatalyst ? '-maccatalyst' : ''
463
+ } /${ executableFolderPath } `;
446
464
}
447
465
448
466
function getPlatformName ( buildOutput : string ) {
0 commit comments