简体   繁体   English

OSX沙箱:根据操作系统版本启动其他可执行文件

[英]OSX Sandbox: Launch a different executable based on OS version

I have an application in the Mac App Store. 我在Mac App Store中有一个应用程序。 I'm trying to support users going back to Snow Leopard but this is becoming increasingly difficult. 我正在尝试支持回溯到Snow Leopard的用户,但这变得越来越困难。

Recently I've hit a roadblock due to the iTunesLibrary.framework, this framework must be linked to the main executable and yet doing so will always trigger a crash on load when running in Snow Leopard. 最近,由于iTunesLibrary.framework,我遇到了一个障碍,这个框架必须链接到主要可执行文件,但是这样做在雪豹中运行时总是会导致加载崩溃。

To workaround this problem, I want to compile a version of my app that doesn't use features and frameworks from newer versions of OSX. 要解决此问题,我想编译一个不使用OSX较新版本功能和框架的应用程序版本。 The problem is, how can I launch the compatibility build automatically? 问题是,如何才能自动启动兼容性构建?

I'm considering trying to make the main executable point to a shell script, but I don't really like that idea. 我正在考虑尝试使主要的可执行文件指向shell脚本,但是我真的不喜欢这个想法。 I've also thought of the main executable being a helper that simply launches the full app and then exits. 我还认为主要的可执行文件是一个帮助程序,只需启动完整的应用程序然后退出即可。 I expect this would work, but I worry about it getting approved by Apple. 我希望这会奏效,但我担心它会被Apple批准。 Finally, I'm wondering if the app bundle format itself can support this kind of setup, maybe via an advanced used of CFBundleExecutable that I'm unaware of. 最后,我想知道应用程序捆绑包格式本身是否可以支持这种设置,也许是通过我不知道的CFBundleExecutable高级用法。

Has anyone been down this road, what would you suggest? 有没有人走这条路,你会建议什么?

Try weak linking the frameworks, more information about Weak Linking and Apple Frameworks here . 尝试弱链接框架,有关弱链接和Apple框架的更多信息,请参见此处 Then also check in your code for the OS version or - (BOOL)respondsToSelector:(SEL)aSelector of any NSObject to determine what you can call and what not. 然后,还检查操作系统版本的代码或任何NSObject - (BOOL)respondsToSelector:(SEL)aSelector ,以确定您可以调用什么,不能调用什么。

To have Snow Leopard as Base SDK you'll need an old Xcode and will have troubles submitting to Mac App Store. 要将Snow Leopard作为基本SDK,您需要使用旧的Xcode,并且在提交到Mac App Store时会遇到麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 QProcess Mac OS,无法启动带有参数的可执行文件 - QProcess Mac OS , Cant launch executable with arguments 在OSX中执行脚本时有什么不同? - Whats different when you executable a scripts in OSX? OSX / Clang版本的__progname获得可执行文件的绝对路径? - OSX/Clang version of __progname to get absolute path of executable? Unix:相同的可执行文件,不同的用户:不同的可执行文件版本? - Unix: Same executable, different user: different executable version? 沙盒Mac OSX应用程序 - Sandbox mac osx application OSX 修复 Selenium Chromedriver 启动错误产生未知系统错误 -86 可执行文件中的 CPU 类型错误? - OSX fix Selenium Chromedriver launch error spawn Unknown system error -86 Bad CPU type in executable? 通过在OSX中键入`dotnet`和`dotnet --version`发现.net核心版本不同 - Found .net core version different by typing `dotnet` and `dotnet --version` in OSX NSToolbarItem 可用性基于 OS X 版本 - NSToolbarItem availability based on OS X version 如何在Mac OSX上创建沙箱环境以运行不同的程序/项目? - How do I create sandbox environments on Mac OSX for running different program / projects? OSX gobjdump破坏可执行文件 - OSX gobjdump corrupts executable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM