OSX 10.11 (El Capitan) beta 2 / beta 3 上的 Xcode 6.4

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31220697/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:25:24  来源:igfitidea点击:

Xcode 6.4 on OSX 10.11 (El Capitan) beta 2 / beta 3

xcodeosx-elcapitan

提问by CrApHeR

I am trying to run Xcode 6.4 on El Capitan and I can run with the instructions on thispost.

我正在尝试在 El Capitan 上运行 Xcode 6.4,我可以按照这篇文章中的说明运行。

But I am looking for a way to run it without any external program as I ran before with OSX 10.10 (Yosemite).

但是我正在寻找一种无需任何外部程序即可运行它的方法,就像我之前使用 OSX 10.10 (Yosemite) 运行的那样。

I found thispost that point to thisinstructions but it does not work. These are the instructions

我发现这篇文章指向说明,但它不起作用。这些是说明

  1. Open this file /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exception.plist
  2. Find lines with name xcode in them (http://i.imgur.com/tcKWLhz.png)
  3. Edit value HardDisabled from YES to NO
  4. Save and reboot

    1.a) If you can't save because file says it's locked then enable rootless mode (sudo nvram boot-args="kext-dev-mode=1 rootless 0" or sudo nvram boot-args="kext-dev-mode=1 rootless=0") and reboot.

    1.b) If you still have problem, copy Exceptions.plist to Desktop (or wherever else) and edit it them.

    1.c) Save it and them remove Exceptions.plist in System (sudo rm -rf /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exceptions.plist)

    1.d) Copy file from Desktop (or wherever else) to /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources and reboot.

  1. 打开这个文件 /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exception.plist
  2. 在其中查找名称为 xcode 的行(http://i.imgur.com/tcKWLhz.png
  3. 将 HardDisabled 值从 YES 编辑为 NO
  4. 保存并重启

    1.a) 如果您因为文件说它已锁定而无法保存,则启用无根模式(sudo nvram boot-args="kext-dev-mode=1 rootless 0" 或 sudo nvram boot-args="kext-dev-mode =1 rootless=0") 并重新启动。

    1.b) 如果您仍然有问题,请将 Exceptions.plist 复制到桌面(或其他任何地方)并对其进行编辑。

    1.c)保存并删除系统中的Exceptions.plist(sudo rm -rf /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exceptions.plist)

    1.d) 将文件从桌面(或其他任何地方)复制到 /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources 并重新启动。

I couldn't edit the Exceptions.plist file with the instructions above, but after a lot of tries I found the way to edit it.
Hereyou can find the instructions to edit it.

我无法使用上述说明编辑 Exceptions.plist 文件,但经过多次尝试后,我找到了编辑它的方法。
在这里您可以找到编辑它的说明。

After all of this, I still receiving the message

这一切之后,我仍然收到消息

You can't open the application "XCode.app" because it is not supported on this type of Mac

您无法打开应用程序“XCode.app”,因为此类 Mac 不支持它

when I try to run Xcode 6.4 from Finder

当我尝试从 Finder 运行 Xcode 6.4 时

SOLUTION 1
The only thing I didn't do was to reinstall XCode 6.4 after the changes. I reinstalled it and it works!

解决方案 1
我唯一没有做的就是在更改后重新安装 XCode 6.4。我重新安装了它,它可以工作!

SOLUTION 2
Dave Woodprovided another solution to avoid to reinstall XCode. Thisis is post and as he posted in his answer the script is here

解决方案 2
Dave Wood提供了另一种避免重新安装 XCode 的解决方案。 是帖子,正如他在回答中发布的那样,脚本在这里

采纳答案by Dave Wood

Here's a shell script that tweaks Xcode 6 and resigns so you can just run it normally. No need to mess with the system exception list, reinstall or anything. Just takes a minute or so to run.

这是一个调整 Xcode 6 并退出的 shell 脚本,以便您可以正常运行它。无需弄乱系统异常列表,重新安装或任何事情。只需一分钟左右即可运行。

Script is here: http://bit.ly/Xcode6OnElCapitan

脚本在这里:http: //bit.ly/Xcode6OnElCapitan

Note: you can not submit apps built on El Capitan while it's still in Beta.

注意:在 El Capitan 仍处于 Beta 阶段时,您无法提交在 El Capitan 上构建的应用程序。

回答by Ciprian

Xcode 6.4 runs out-of-the-box on:

Xcode 6.4 开箱即用:

  • El Capitan Beta 4 (build 15A226f)
  • El Capitan Beta 5 (build 15A235d)
  • El Capitan Beta 7 (build 15A263e)
  • El Capitan Beta 4(构建 15A226f)
  • El Capitan Beta 5(构建 15A235d)
  • El Capitan Beta 7(版本 15A263e)

Xcode 6.4 fails to open on:

Xcode 6.4 无法打开:

  • El Capitan Beta 6 (build 15A244d) - Workaround here

    cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
    sudo mv dyld_sim dyld_sim.orig
    
  • El Capitan Beta 6 (build 15A244d) - 解决方法在这里

    cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
    sudo mv dyld_sim dyld_sim.orig
    

回答by empedocle

There are two places in Exceptions.plist which list Xcode. The one you don't have listed is:

Exceptions.plist 中有两个地方列出了 Xcode。你没有列出的是:

<key>com.apple.Xcode</key>
    <array>
        <dict>
            <key>AppStoreIdentifier</key>
            <string>497799835</string>
            <key>AppStoreUpdateIsFree</key>
            <true/>
            <key>HardDisabled</key>
            <false/>
            <key>HighVersion</key>
            <string>5085.0</string>
        </dict>
    </array>

It is necessary to re-install Xcode afterwards.

之后需要重新安装Xcode。

回答by Terence

In addition to the original first answer if you dont want to reinstall xcode again because of slow internet connection you can just copy xcode to desktop delete the one in application folder (Assuming you did all the required steps above except reinstalling). And move back xcode to application folder(while copying to desktop itself if you did above step right you will notice the cut icon will dissapear after copying)

除了最初的第一个答案之外,如果您因为互联网连接速度慢而不想再次重新安装 xcode,您可以将 xcode 复制到桌面,删除应用程序文件夹中的一个(假设您执行了上述所有必需的步骤,除了重新安装)。并将 xcode 移回应用程序文件夹(在复制到桌面本身时,如果您正确执行上述步骤,您会注意到复制后剪切图标将消失)

回答by mixel

User lembacon herefound the solution:

用户 lembacon在这里找到了解决方案:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
cd Developer/SDKs/iPhoneSimulator.sdk/usr/lib
sudo mv dyld_sim dyld_sim.orig

The reason is that the internal implementation of _NSGetExecutablePathhas been updated (where the Kernel is involved), and the host dyldhas also been updated to track this change. The dyld_sim, however, has not yet been updated. So the problem is that _NSGetExecutablePathwill return a path that contains a executable_path=part which causes that the CFBundleGetMainBundle()always returns NULL. This workaround simply forces the simulator to use the host dyld.

原因是内部实现 _NSGetExecutablePath已经更新了(涉及到Kernel的地方),宿主dyld也更新了跟踪这个变化。的dyld_sim,但是,还没有更新。所以问题是_NSGetExecutablePath将返回一个包含executable_path=导致CFBundleGetMainBundle()总是返回的部分 的路径NULL。此解决方法只是强制模拟器使用主机dyld

I confirm that this solution is working with Xcode 6.4.

我确认此解决方案适用于 Xcode 6.4。