在沙盒中执行qlmanage(电子)应用程序不起作用

问题描述 投票:1回答:1

我的设置是macOs上的电子应用程序。我正在使用exec-sh来运行$ qlmanage ...来生成缩略图。一切正常,除非我签署应用程序并将沙盒权利设置为true。我尝试了一切,但没有任何作用:

  • 将com.apple.security.files.user-selected.executable添加到我的plist中
  • 将Image.qlgenerator插件复制到我的应用程序中(在构建过程中)并强制命令使用此生成器
  • 设置文件夹权限(但其他命令,如mkdir或创建/写入文件正在工作)
  • qlmanage选项的所有组合

如果我将com.apple.security.app-sandbox设置为false就行了。错误日志对我来说没用:

Error: Shell command exit with non zero code: 255

我很不确定是否有可能在沙盒应用程序中运行$ qlmanage ...

macos shell electron appstore-sandbox quicklook
1个回答
0
投票

要从文件中获取Quicklook图像,您宁愿使用

CGImageRef QLThumbnailImageCreate(CFAllocatorRef allocator, CFURLRef url, CGSize maxThumbnailSize, CFDictionaryRef options);

这将返回一个CGImage,您可以将其用作缩略图。请参阅此处的文档:https://developer.apple.com/documentation/quicklook/1402623-qlthumbnailimagecreate

© www.soinside.com 2019 - 2024. All rights reserved.