Unable to debug Memory Graph in Xcode: "an unknown error occurred launching the helper task"

I am not able to use the Debug Memory Graph tool as well as Leaks instrument inside Xcode to debug my project. I'm running my project on physical iOS device on running 18.3 version and I tested the project on two different MacBooks running Xcode 16.3 and 16.1. On both the same problem persists. I have also reinstalled the project on the device and tried restarting all devices and cleared DerivedData. Nothing helped.

Clicking "Show details" shows such output:

Domain: DTLeaksService
Code: -1
User Info: {
    DVTErrorCreationDateKey = "2025-05-07 06:30:53 +0000";
    DVTRadarComponentKey = 637311;
}
--

Event Metadata: com.apple.dt.memory_graph_capture : {
    "debugSession_coalescedState" = 2;
    "debugSession_isSynthetic" = 0;
    "debugSession_state" = 2;
    "device_identifier" = "00008110-0009448221A3801E";
    "device_isCoreDevice" = 1;
    "device_model" = "iPhone14,4";
    "device_osBuild" = "18.4 (22E240)";
    "device_platform" = "com.apple.platform.iphoneos";
    "device_thinningType" = "iPhone14,4";
    "dvt_coredevice_version" = "397.24";
    "dvt_coresimulator_version" = "987.2";
    "dvt_mobiledevice_version" = "1784.102.1";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 2;
    "launchSession_targetArch" = arm64;
    "memgraphDebugger_duration_ms" = 3050;
    "memgraphDebugger_precedingCount" = 1;
    "memgraphDebugger_status" = "-1";
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_113575882_enable" = 0;
    "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" = 3;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_guardMalloc_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_mtc_enable" = 1;
    "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_enable" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 2;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 99;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_structuredConsoleMode" = 1;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos18.1";
    "sdk_osVersion" = "18.1";
    "sdk_variant" = iphoneos;
}
--


System Information

macOS Version 14.5 (Build 23F79)
Xcode 16.1 (23503) (Build 16B40)
Timestamp: 2025-05-07T08:30:53+02:00

Here are my active scheme settings:

I also face this issue on my project on XCode 16.3 when running on physical device iOS 18.4.1

facing same issue on iPhone 15 pro bot memory graph working fine on iPhone 12 and iPhone 7

Unable to debug Memory Graph in Xcode: "an unknown error occurred launching the helper task"
 
 
Q