如何sandbox命令行工具? [英] How to sandbox a command line tool?

查看:835
本文介绍了如何sandbox命令行工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的unix工具,我从shell启动主要的可可应用程序。

I've a simple unix tool made by me that launches the main cocoa app from a shell.

我需要沙箱,但当我运行它,它崩溃与错误非法指令:4,在console.app我可以看到以下错误消息

I need to sandbox it but when I run it, it crashes with error "Illegal instruction: 4", on console.app I can see the following error message


沙箱创建失败:容器对象初始化失败:NIL
没有visdiff的错误描述的容器信息对象

Sandbox creation failed: Container object initialization failed: NIL container info object with no error description for visdiff

文件使用codesign进行了正确的签名。

The file is correctly signed with codesign.

我已阅读帖子 Mac OS应用程序,沙箱与命令行工具?但它不帮助

I've read the post Mac OS app, sandbox with command line tool? but it doesn't help

推荐答案

尝试这些clang标志(假设你有 info.plist 在构建目录中):

Try these clang flags (assuming you have info.plist in the build directory):

-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __info_plist -Xlinker info.plist

-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __info_plist -Xlinker info.plist

这篇关于如何sandbox命令行工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆