XVim2 icon indicating copy to clipboard operation
XVim2 copied to clipboard

Re-codesign of Xcode.app breaks network device pairing

Open tmm1 opened this issue 6 years ago • 8 comments

### 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.

tmm1 avatar Jan 16 '19 21:01 tmm1

It seems like maybe codesign --preserve-metadata=entitlements would work.

tmm1 avatar Jan 16 '19 21:01 tmm1

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

tmm1 avatar Jan 16 '19 22:01 tmm1

No one else has this problem?

tmm1 avatar Jul 28 '20 21:07 tmm1

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)

ryanmeisters avatar Jul 29 '20 18:07 ryanmeisters

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

tmm1 avatar Jul 29 '20 18:07 tmm1

Ah I hadn’t even considered Apple TV. I just assumed you meant iPhone/iPad!

ryanmeisters avatar Jul 29 '20 19:07 ryanmeisters

@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..

qiudaomao avatar Jul 30 '20 01:07 qiudaomao

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.

tmm1 avatar Jul 30 '20 05:07 tmm1