swift - 当我尝试在沙盒环境中启动另一个应用程序时,MacOS 进程使我的应用程序崩溃
问题描述
我正在开发一个 MacOS 应用程序,我可以在其中打开特定 chrome 配置文件中的某些 url。
我在下面有这段代码,当我将 AppSandbox 设置为 false 但 App Store 会拒绝我的应用程序,因为应用程序沙盒已关闭。
当沙盒打开时,应用程序崩溃并出现“操作不允许”和“权限被拒绝”错误。
let commandPath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
let arguments = ["--args", "--profile-directory=Profile 1", "https://www.google.com"]
let processUrl = URL(fileURLWithPath: commandPath)
try! Process.run(processUrl, arguments: arguments, terminationHandler: nil)
我试图用它打开 chrome,open -na "Google Chrome" ....
但这也不起作用。
任何有关如何克服此问题的指导表示赞赏。
解决方案
推荐阅读
- javascript - 动态创建的表上的弹出框问题
- javascript - 如何在Javascript中将列表转换为有序列表?
- c++ - 如何在 Visual Studio for C++ 中更改工作目录
- nuxt.js - 在 Nuxt.js 中实现 google API
- unity3d - 当我在 Unity 中构建时。我收到一个名为“错误 CS0246:找不到类型或命名空间名称‘WebSocketSharp’”的错误
- javascript - 从同一页面上的不同表单中提取输入项
- spring - Spring Cloud Gateway 设置多个虚拟主机
- javascript - 使用 cron 和 node.js 发送预定消息
- android - Android更改所选NumberPicker的TextColor
- stm32 - STM32F4 ADC多模式,主控由定时器触发