I am trying to build my first mac app here. It's a simple app which doesn't have any UI, but relies heavily on CoreBluetooth. This may be my first time developing for OS X but my day job is developing for iOS so I'm not a stranger with the issues of development.
Up to a certain point, my app was not sandboxed, as I wanted to test it without any issues. Now I am trying to release it and I have obviously had to enable sandboxing. As I rely on CoreBluetooth I have obviously enabled the bluetooth entitlement, however when I archive the app and save for Mac App Store the bluetooth functionality doesn't work (It does work if I run directly from Xcode.).
Console shows the following logs:
29/10/2014 00:23:10.782 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1000 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:10.819 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:10.856 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:10.889 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:11.004 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:11.021 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:11.281 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:11.304 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:11.738 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:11.760 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:12.659 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:12.681 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:14.565 appleeventsd[25]: Sandboxed application with pid 7652 attempted to lookup App:"System Events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1010 sess=100005 bundleID= but was denied due to sandboxing. (___ZL13handleMessageP17_xpc_connection_sPv_block_invoke272()/appleEventsD.cp #2463) com.apple.root.default-qos
29/10/2014 00:23:14.601 sandboxd[118]: ([7652]) My App(7652) deny appleevent-send com.apple.systemevents
29/10/2014 00:23:14.630 sandboxd[118]: ([7652]) My App(7652) deny mach-lookup com.apple.blued
So I tried entering entitlements under the key: com.apple.security.temporary-exception.apple-events
for com.apple.blued
and com.apple.systemevents
however that has also not helped. Is the bluetooth entitlement just broken in Xcode 6.1? Or am I overseeing something massive here?
This seems to have been resolved by changing my code signing entitlements to be correct: I am used to code signing iOS apps and it seems OS X is a whole other question. I had to change my code signing to automatic and developer. And hit the 'Mac App Store' toggle then it worked just fine :)