Skip to content

Commit

Permalink
Add helper script to sign Rust binaries for Instruments.app
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed Jun 30, 2024
1 parent 46bc5fe commit 2acd939
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/codesign-for-instruments
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env zsh
# Re-sign a (Rust) binary to allow debuggers like Instruments to attach to it.
# Source: https://cocoaphony.micro.blog/2022/10/29/solving-required-kernel.html

BIN=$1

exec codesign -s - -v -f --entitlements =(echo -n '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>') "$BIN"

0 comments on commit 2acd939

Please sign in to comment.