How to fix "Could not launch: xxxx Executable does not exist" error"

Hi i am currently using XCode 15 to build a Swift command line application.

But when I try to build & debug my project, it throws an error saying that it could not launch the executable.

It does build but as the error suggests, the Build dir does not have a executable in it. I have messed around with DerivedData & Build location settings for quite a bit with no luck.

Currently both of them are at default settings as I cleared XCode caches from ~/Library/Caches & created a new project. I tried compiling the basic Hello World but that seems to "build" but with no executable.

I have attached the report for the Could not launch error

Could not launch “CryptoTest”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: Executable doesn't exist: '/Users/vishwa-21387/Developer/CryptoTest/build/Debug/CryptoTest'
User Info: {
    DVTErrorCreationDateKey = "2024-09-04 12:27:31 +0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "Executable doesn't exist: '/Users/vishwa-21387/Developer/CryptoTest/build/Debug/CryptoTest'";
}
--
Could not launch “CryptoTest”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: Executable doesn't exist: '/Users/vishwa-21387/Developer/CryptoTest/build/Debug/CryptoTest'
User Info: {
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "Executable doesn't exist: '/Users/vishwa-21387/Developer/CryptoTest/build/Debug/CryptoTest'";
}
--

Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "MacBookPro18,3";
    "device_osBuild" = "14.6.1 (23G93)";
    "device_platform" = "com.apple.platform.macosx";
    "dvt_coredevice_version" = "355.28";
    "dvt_mobiledevice_version" = "1643.120.2";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 1206;
    "operation_errorCode" = 3;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "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" = 0;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 3;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.tool";
    "param_structuredConsoleMode" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "macosx14.5";
    "sdk_osVersion" = "14.5";
    "sdk_variant" = macos;
}
--


System Information

macOS Version 14.6.1 (Build 23G93)
Xcode 15.4 (22622) (Build 15F31d)

Am i missing something with respect to build location / configuration?

Thanks for any assistance.

If you create a new project from the macOS > Command Line Tool template, does it have the same problem?

Share and Enjoy

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

Please reply as a reply. I’m not notified when you reply in the comments. For this and other titbits, see Quinn’s Top Ten DevForums Tips.

Yes same problem with a brand new project as well.

Hmmm, that’s weird. I’ve seen problems like this before and they’re usually related to build settings, but that’s not a possibility if you start with a new project.

If you create a new local user on your Mac — using Settings > Users & Groups — does the problem reproduce there?

Share and Enjoy

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

How to fix "Could not launch: xxxx Executable does not exist" error"
 
 
Q