File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
packages/cli-platform-apple/src/commands/runCommand Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -272,12 +272,22 @@ const createRun =
272272 }
273273
274274 if ( args . udid ) {
275- const device = devices . find ( ( d ) => d . udid === args . udid ) ;
275+ let device = devices . find ( ( d ) => d . udid === args . udid ) ;
276276 if ( ! device ) {
277- return logger . error (
278- `Could not find a device with udid: "${ chalk . bold (
279- args . udid ,
280- ) } ". ${ printFoundDevices ( devices ) } `,
277+ // On arm64 machines, the catalyst UDID returned by 'xcrun xctrace list devices' is not correct
278+ // xcodebuild will return an error indicating the UDID is unknown and offering a different one
279+ // you may obtain it by running xcodebuild with the UDID you think works then parse out the other one from the returned error:
280+ // 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)
281+ //
282+ // How to handle the incorrect catalyst UDID?
283+ // Assume if a UDID is specified, the user knows what they are doing.
284+ // Use the given UDID and force the type, so "catalyst" will launch the app correctly
285+ device = { name : 'unknown' , udid : args . udid , type : 'catalyst' } ;
286+ logger . warn (
287+ `Could not find a device with udid: "${ chalk . bold ( args . udid ) } ".` ,
288+ ) ;
289+ logger . warn (
290+ 'Running with provided udid anyway, and type "catalyst". \'xcodebuild\' command may return error.' ,
281291 ) ;
282292 }
283293 if ( device . type === 'simulator' ) {
You can’t perform that action at this time.
0 commit comments