V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
vista980622
V2EX  ›  macOS

在 Mavericks 下运行 Yosemite-only 的应用程序

  •  
  •   vista980622 · 2015-04-27 09:38:04 +08:00 · 2987 次点击
    这是一个创建于 3505 天前的主题,其中的信息可能已经有所发展或是发生改变。

    从 Xcode 6.3 开始,Xcode 不再支持 Mavericks。强制修改版本号加载 app binary 无效,因为新版 Xcode 调用大量 10.10-only 的 API。

    前段时间在 Github 上看到了 https://github.com/landonf/XcodePostFacto/,看到作者那句 "while the the Yosemite upgrade is free, it has its own inherent costs -- especially in terms of privacy and quality issues. Plus, I don't like being told what to do :-)" 有点小感动。问了作者能不能把类似的方式用在其他 10.10-only 的 app 上。作者说可能实现,但需要不少时间和精力来开发维护。

    留在 10.9 的 V 友们有没有感兴趣的?可以去 Github 上看看实现方式。要是能有更通用的实现方法,就不用接受 Apple 的强制升级了。Office 2016、iWork'14、Davinqi Resolve 12、FCPX 10.2 之类的 app 也就都能用了啊!

    附上作者实现方法的说明和概括:
    "There are a number of hurdles to getting Xcode 6.3 running on an earlier release:

    Xcode declares a minimum system version of 10.10, preventing launch via LaunchServices and triggering an abort() in HIServices if you bypass the initial LaunchServices check.

    Xcode continues to ship with no-longer functional 10.9 compatibity code, and enables that code if it detects it's running on Mavericks. This results in crashes -- and even if you got past those, the result wouldn't actually be Xcode 6.3.

    Xcode links against 10.10-only APIs, which trigger both link-time and runtime crashes.
    To resolve these issues, we must patch Xcode and system libraries: disabling the legacy compatibility code, all version checks, and performing runtime rebinding of missing symbols.

    XcodePostFacto leverages the following mechanisms to achieve this:

    Prior to Xcode's main(), the private dyld_register_image_state_change_handler API is used to hook dyld and modify library symbol references that are critical to bootstrapping the process:

    After the library has been rebased, but before it has been linked, we use a custom single-stepping implementation of dyld symbol rebinding to find strong references to Yosemite-only symbols and rewrite them as weak references.

    Once the library has been linked, but before it has been initialized, we use the same BINDOPCODE* evaluator to rebind symbols to our custom replacements.

    Before handing control back to Xcode, the bootstrap code uses my PLPatchMaster library to register a future patch on Xcode's DVTPlugInManager class. This patch adds xpf_bootstrap.framework/Contents/Resources/Xcode to DVTPlugInManager's plugin search path.

    A custom plugin in xpf_bootstrap.framework/Contents/Resources/Xcode uses Xcode's standard plugin mechanisms to hook the IDEInitialize step, performing a final set of bootstrap operations within the now-initialized Xcode process."

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2850 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 18ms · UTC 06:13 · PVG 14:13 · LAX 22:13 · JFK 01:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.