Enabling start at login with App Sandbox enabled

感情迁移 提交于 2019-11-27 13:58:27

问题


I have an application that must be sandboxed.

It's not a difficult task, but I see that I cannot enable automatic start at login with LSSharedFileList editing the Session Login Items list.

Is there another way to enable start at login with App Sandbox enabled?


回答1:


An updated project/tutorial is available here, with addendums for some misleading Console messages you'll see under 10.8.2:

http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/

I'm not the author, but the tutorial was very helpful in getting a start-at-login app configured under 10.8.2 w/ Sandboxing enabled.




回答2:


Apple says:

Creating a Login Item for Your App To create a login item for your sandboxed app, use the SMLoginItemSetEnabled function (declared in ServiceManagement/SMLoginItem.h) as described in “Adding Login Items Using the Service Management Framework” in Daemons and Services Programming Guide.

(With App Sandbox, you cannot create a login item using functions in the LSSharedFileList.h header file. For example, you cannot use the function LSSharedFileListInsertItemURL. Nor can you manipulate the state of launch services, such as by using the function LSRegisterURL.)



来源:https://stackoverflow.com/questions/7837152/enabling-start-at-login-with-app-sandbox-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!