我正在尝试删除"com.apple. com. "
中文件中的"隔离"属性~/图书馆/集装箱/……/图书馆/应用支持。
在控制台中使用NSTask和xattr会导致"Operation not allowed "消息。作为第二个选项,我使用removexattr()尝试了标题xattr.h。
我还尝试将LSFileQuarantineEnabled添加到Info.plist。在终端中手动调用xattr可以工作。
似乎沙箱阻止xattr使用Objective-C删除属性
在沙盒应用程序中运行helper二进制文件…
第一次测试:
- 使用"Keychain Access"创建证书
- "证书助手">"创建证书…"
- 命名它…
- 覆盖默认设置
- …
使用 - 签名您的助手二进制文件(更新程序)
codesign -s <certificate A> <binary>
- 复制二进制文件到你的项目
- 检查它是否链接在"Build Phases">"Copy Bundle Resources"
- 转到产品>存档
- 分发…
- 导出为应用
- 使用您的签名身份
如果你想发送到Mac App Store,请使用正确的证书。
我用来启动/调用helper二进制文件的代码如下:NSString * resourcePath = [[NSBundle mainBundle] resourcePath];
NSTask *testbin = [[NSTask alloc] init];
NSString * path = [resourcePath stringByAppendingString:@"/testbin"];
[testbin setLaunchPath:path];
[testbin launch];
[testbin waitUntilExit];
无需复制或移动文件;-)