Mac App中的CoreBluetooth权利

时间:2014-10-29 00:32:17

标签: xcode macos cocoa core-bluetooth entitlements

我正在尝试在这里构建我的第一个mac应用程序。它是一个简单的应用程序,没有任何UI,但很大程度上依赖于CoreBluetooth。这可能是我第一次为OS X开发,但我的日常工作是为iOS开发,所以我对开发问题并不陌生。

到某一点,我的应用程序没有沙盒,因为我想测试它没有任何问题。现在我试图释放它,我显然必须启用沙盒。由于我依赖CoreBluetooth,我显然启用了蓝牙权利,但是当我存档应用程序并保存为Mac App Store时,蓝牙功能无法正常工作(如果我直接从Xcode运行,它确实有效。)。

控制台显示以下日志:

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

因此,我尝试在com.apple.security.temporary-exception.apple-eventscom.apple.blued的密钥com.apple.systemevents下输入权利,但这也没有帮助。蓝牙权利是否在Xcode 6.1中被破坏了?或者我在这里监督一些大事?

1 个答案:

答案 0 :(得分:0)

这似乎已经通过将我的代码签名权利更改为正确来解决:我习惯于代码签署iOS应用程序,而OS X似乎是另一个问题。我不得不将我的代码签名更改为自动和开发人员。点击“Mac App Store”切换然后它工作正常:)