Can't profile app built with SwiftPM

Hello,

I’m trying to debug allocations of my swift cli app in instruments. I’m already resigning the app to add the com.apple.security.get-task-allow entitlement. But instruments logs the following error immediately after launching the app

Failed to load library /Applications/Xcode-26.1.1.app/Contents/SharedFrameworks/DVTInstrumentsFoundation.framework/Resources/liboainject.dylib because target process 71062 appears to have exited

Has anyone run into this issue? Is there a workaround?

-mike

it’s definitely an entitlement or sandboxing issue because disabling SIP fixes it.

I’m unable to use the profile test command at all. My macOS application is built from many SPM packages and I’m trying to profile a test from one of them - i’m unclear what the reason is, but nothing I’ve tried (get-task-allow entitlement etc) will change it from crashing on launching. All I can do is attach to process (to xctest) in Instruments, which means that short tests won’t work with it. It’s beyond a poor experience.

Hi! Instruments engineer here. Can you report this using Feedback Assistant, attach a sysdiagnose taken after attempting to profile the app, and also a dump of the entitlements (codesign -d --entitlements - /path/to/binary) and share the feedback ID here? I’d be happy to investigate it with my team.

2 Likes

just to confirm, you need me to reenable SIP correct?

Please do, since it seems like you’re not seeing the issue with SIP disabled.

Submitted FB21269258 - Unsure if it’s related to the original thread here or not, but seems valid. Thanks! Ryan

1 Like