Re-codesign of Xcode.app breaks network device pairing
### Xcode:87790 lacks 'com.apple.PairingManager.Read' entitlement to use GetPairingIdentity
### GetPairingIdentity failed: -71168/0xFFFEEA00 kMissingEntitlementErr
This should be noted in the documentation. If there is a way to self-codesign with extra entitlements, then that would be ideal.
It seems like maybe codesign --preserve-metadata=entitlements would work.
Re-signing with the entitlements preserved results in a binary which crashes on boot.
$ open /Applications/Xcode.app
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Xcode.app.
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x1
No one else has this problem?
Interesting. I build for network connected device pretty frequently (usually just build, not run since the app I work on most is large). I’ve never run into issues with my self-signed Xcode. What Xcode version are you using? Has worked for me on 11.x (Haven’t tried 11.6 or 12 beta yet)
Thanks that's useful to know. I work primarily with tvOS so maybe there's something different there. You can pair with the Apple TV 4K over the network only, and that initial with is what fails. In Console.app I saw entitlement errors from some helper process.
I haven't tried recently so I will give it another go with XCode 11.6 and 12b2
Ah I hadn’t even considered Apple TV. I just assumed you meant iPhone/iPad!
@tmm1 My workaround for ATV4k is pairing before re-sign, the device already paired before will keep working even after re-sign. Upgrade Xcode will not lose it..
Sometimes I need to reset tvOS for testing which requires me to re-pair, and there's no way after re-codesign without having to redownload Xcode. I wish there was a better solution.