Mac Catalyst app won't launch in Xcode

I'm building an app for deployment on iPhone, iPad and Mac Catalyst. I am using Automatic Code Signing. Project build without a single warning of any kind... Debugging and running the app on both iPhone and iPad is working fine both in the simulators as well as on various test devices.

I have now turned to debugging on my Mac (M1Pro-MBP). I have run Clean many times....When I set the run destination to My Mac Catalyst and run I immediately see a dialog stating:

"The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error."

There is button to reveal details. Those details are shown below.

At the moment I am under the impression that this must be a relatively straightforward configuration issue which I have overlooked....

The app does contain an action and if I build and run only the action with Mac Catalyst as the destination it runs fine.. I only hit the error when I try to run the container app with embedded action with my Mac as the run destination....

Can anyone shed any light on this matter? All thoughts appreciated!

Steve

Domain: IDELaunchErrorDomain
Code: 20
Recovery Suggestion: The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error.
User Info: {
    DVTErrorCreationDateKey = "2023-07-19 14:36:14 +0000";
    DVTRadarComponentKey = 968756;
    IDERunOperationFailingWorker = IDELaunchServicesLauncher;
}
--
The operation couldn’t be completed. Launch failed.
Domain: RBSRequestErrorDomain
Code: 5
Failure Reason: Launch failed.
--
Launchd job spawn failed
Domain: NSPOSIXErrorDomain
Code: 153
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "MacBookPro18,3";
    "device_osBuild" = "13.4.1 (22F82)";
    "device_platform" = "com.apple.platform.macosx";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 172;
    "operation_errorCode" = 20;
    "operation_errorDomain" = IDELaunchErrorDomain;
    "operation_errorWorker" = IDELaunchServicesLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.macosx";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 99;
    "param_launcher_substyle" = 8192;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "macosx13.3";
    "sdk_osVersion" = "13.3";
    "sdk_variant" = iosmac;
}
--


System Information

macOS Version 13.4.1 (c) (Build 22F770820d)
Xcode 14.3.1 (21815) (Build 14E300c)
Timestamp: 2023-07-19T08:36:14-06:00

Accepted Reply

Quinn;

In reviewing the differences between new test app created in step above I noticed that in my app my Mac target had the macOS SDK assigned whereas the new app had the iOS SDK assigned.

So I created a new target similar to the test app and removed the earlier MacCatalyst target (macOS SDK).

My app now works fine on Mac device - YES!!!

Thanks for the head bump! Steve

Replies

If you create a new project from one of the built-in templates, are you able to run it as a Mac Catalyst app?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes! I created an app in iOS which provides a MacCatalyst target. Added a simple label to the base viewController. Works fine on an iOS device AND on Mac as a destination...

So what is that telling you?

Quinn;

In reviewing the differences between new test app created in step above I noticed that in my app my Mac target had the macOS SDK assigned whereas the new app had the iOS SDK assigned.

So I created a new target similar to the test app and removed the earlier MacCatalyst target (macOS SDK).

My app now works fine on Mac device - YES!!!

Thanks for the head bump! Steve

My app now works fine on Mac device

Yay!

So what is that telling you?

What you’ve worked out for yourself already, but I’m going to reply here for the benefit of others…

When debugging problems like this my first step is to try it in a test project. That’ll either work or fail:

  • If the test project works, it’s likely that the issue is tied to the setup of the main project.

  • If the test project fails, it’s likely that this is an environmental issue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"