SMJobBless sample code does not work on 10.11b6

Originator:rix.rob
Number:rdar://22269571 Date Originated:13-Aug-2015 12:28 PM
Status:Open Resolved:
Product:Sample Code Product Version:Xcode-beta (7A176x)
Classification:Serious Bug Reproducible:Always
 
Summary:
As part of investigating an issue in GitHub Desktop on El Cap, I ran the SMJobBless sample code:

https://developer.apple.com/library/prerelease/mac/samplecode/SMJobBless/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010071

Unfortunately, it doesn’t actually work. After authorizing with the correct credentials, it simply errors out:

2015-08-13 12:20:36.557 SMJobBlessApp[1102:440592] Something went wrong! CFErrorDomainLaunchd / 4


Steps to Reproduce:
1. Download the SMJobBless sample code at the above URL.
2. Open SMJobBless.xcodeproj in Xcode 7.
3. Build and run. (No code changes are required at time of writing.)
4. When prompted by the running app, enter administrator credentials to allow the app to install a helper tool.


Expected Results:
I expected it to bless & launch the app correctly.


Actual Results:
It failed:

2015-08-13 12:20:36.557 SMJobBlessApp[1102:440592] Something went wrong! CFErrorDomainLaunchd / 4


Regression:
This worked correctly on 10.10 AFAIK.


Notes:
SMJobBless appears to be going away, going by the removal of the Swift bridging of ServiceManagement:

https://developer.apple.com/library/prerelease/mac/releasenotes/General/APIDiffsMacOSX10_11/Swift/ServiceManagement.html

We use Objective-C to call SMJobBless, but it’s unclear what this means for us given that we need to support 10.9+ right now, and our current use of SMJobBless is crashing under 10.11b6.

We think we have a workaround, further details to follow.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!