“未找到中央目录结尾签名。” 安装 Xcode 8 beta xip 文件时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37812664/
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-08 18:18:46  来源:igfitidea点击:

"End-of-central-directory signature not found." when installing Xcode 8 beta xip file

xcodexcode8

提问by chris P

I've download the Xcode 8 beta .xip file. I cannot unzip. Opening the file just sits there for hours saying "Verifying..."

我已经下载了 Xcode 8 beta .xip 文件。我无法解压缩。打开文件只是坐在那里说“验证...”几个小时

If I try from command line I get the following...

如果我从命令行尝试,我会得到以下...

Downloads unzip Xcode_8_beta.xip 
Archive:  Xcode_8_beta.xip
  End-of-central-directory signature not found.  Either this file 
  is not a zipfile, or it constitutes one disk of a multi-part archive.        

  In the latter case the central directory and zipfile comment will be
  found on the last disk(s) of this archive. unzip:  cannot find 
  zipfile directory in one of Xcode_8_beta.xip or Xcode_8_beta.xip.zip, 
  and cannot find Xcode_8_beta.xip.ZIP, period.

采纳答案by JAL

The XIP file (extract in place) is just a special archive that verifies the unarchive with Apple. On a 2014 MacBook Pro i7 the Xcode 8 binary took over 30 minutes to extract. If the file is not making much progress after close to an hour, re-download the archive and try extracting again.

XIP 文件(就地提取)只是一个特殊的存档,用于验证 Apple 的取消存档。在 2014 款 MacBook Pro i7 上,Xcode 8 二进制文件的提取时间超过 30 分钟。如果文件在接近一个小时后没有取得太大进展,请重新下载存档并再次尝试解压缩。

Additionally, Xcode 8.0 beta requires a Mac running macOS 10.11.4 or later. Make sure your system version is supported.

此外,Xcode 8.0 beta 需要运行 macOS 10.11.4 或更高版本的 Mac。确保您的系统版本受支持。

Xcode 8 Beta 2 note: macOS 10.11.5 or later is required to install Beta 2.

Xcode 8 Beta 2 注意:安装 Beta 2 需要 macOS 10.11.5 或更高版本。

回答by FredericJacobs

The .xipfile format contains an archive (xar containing a gzip archive and metadata) and a signature of the archive. The signature is important, since previously Xcode downloads have been altered (eg. XcodeGhost) to inject malicious code into apps. Therefore, approaches like skipping the verification (xattr -d com.apple.quarantine Xcode_8_beta.xip) seems irresponsible.

.xip文件格式包含一个归档(XAR含有一个gzip归档和元数据)和存档的签名。该签名是很重要的,因为以前的Xcode下载已经改变(如XcodeGhost)注入恶意代码到应用中。因此,诸如跳过验证 ( xattr -d com.apple.quarantine Xcode_8_beta.xip) 之类的方法似乎是不负责任的。

I stronglyencourage you to try to open it with Archive Utility.appin your finder. If the signature check doesn't work, try re-downloading.

强烈建议您尝试Archive Utility.app在查找器中打开它。如果签名检查不起作用,请尝试重新下载。

If you want to investigate whether the .xipis validly signed or for whatever reason want to expand it without Archive Utility, you can use pkgutil:

如果您想调查是否经过.xip有效签名或出于任何原因想要在没有存档实用程序的情况下扩展它,您可以使用pkgutil

pkgutil --check-signature Xcode_8_beta.xip

The output should be something like this:

输出应该是这样的:

    Package "Xcode_8_beta.xip":
       Status: signed Apple Software
       Certificate Chain:
        1. Software Update
           SHA1 fingerprint: 1E 34 E3 91 C6 44 37 DD 24 BE 57 B1 66 7B 2F DA 09 76 E1 FD
           -----------------------------------------------------------------------------
        2. Apple Software Update Certification Authority
           SHA1 fingerprint: FA 02 79 0F CE 9D 93 00 89 C8 C2 51 0B BC 50 B4 85 8E 6F BF
           -----------------------------------------------------------------------------
        3. Apple Root CA
           SHA1 fingerprint: 61 1E 5B 66 2C 59 3A 08 FF 58 D1 4A E2 24 52 D1 98 DF 6C 60

If that signature isn't signed by an Apple Root CA that is in your Keychain, you should probably stop right there. If all is good so far, you can then run the following commands:

如果该签名不是由您钥匙串中的 Apple 根 CA 签名的,您可能应该就此停止。如果到目前为止一切正常,您可以运行以下命令:

xar -xf Xcode_8_beta.xip
sudo tar zxvf Content

回答by Evan Kinney

I'm not sure why Archive Utility is having so much trouble with these archives, but as long as your download itself isn't corrupt, extracting the app bundle out manually works consistently for me. I'm on the 10.12 GM seed (16A320), by the way.

我不确定为什么 Archive Utility 对这些档案有这么多麻烦,但只要您的下载本身没有损坏,手动提取应用程序包对我来说始终有效。顺便说一下,我使用的是 10.12 GM 种子 (16A320)。

The Xcode.appbundle is inside of a CPIO archive, which is xz'd and then packed into a v2 (i.e., Yosemite) PBZX stream (like the payloads in the Yosemite/Sierra install packages). That resulting stream is what's bundled with some metadata and then signed for distribution. Getting it out of all that mess isn't hard, but it takes a little bit of effort.

Xcode.app捆绑包位于 CPIO 存档内,该存档被xz打包并打包到 v2(即 Yosemite)PBZX 流中(如 Yosemite/Sierra 安装包中的有效负载)。结果流与一些元数据捆绑在一起,然后签名分发。摆脱所有这些混乱并不难,但需要一点努力。

(If you'd like to see what this looks like, here's a recordingof me doing it just now, complete with file sizes and certificate SHA1 hashes.)

(如果您想看看这是什么样子,是我刚才做的记录,包括文件大小和证书 SHA1 哈希值。)

  1. Verify the signature and certificate chain that signed the archive.

    pkgutil --verbose --check-signature ./Xcode_8_GM_seed.xip
    
  2. Extract the PBZX stream from the archive.

    xar -xf ./Xcode_8_GM_seed.xip
    
  3. Obtain a PBZX v2 unpacker and... unpack the packed stuff.

    curl -O https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py
    python parse_pbzx2.py Content
    
  4. Decompress the archive (there should only be one chunk, "part00").

    xz -d Content.part00.cpio.xz
    
  5. Unpack the CPIO archive as a privileged user (since the device frameworks have weird symlinks that make cpiocomplain otherwise, and it needs to be owned by root anyway) and move the resulting Xcode app bundle into /Applications.

    sudo cpio -idm < ./Content.part00.cpio
    sudo mv ./Xcode.app /Applications/
    
  1. 验证对存档进行签名的签名和证书链。

    pkgutil --verbose --check-signature ./Xcode_8_GM_seed.xip
    
  2. 从存档中提取 PBZX 流。

    xar -xf ./Xcode_8_GM_seed.xip
    
  3. 获取 PBZX v2 解包器并...解压打包好的东西。

    curl -O https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py
    python parse_pbzx2.py Content
    
  4. 解压缩存档(应该只有一个块,“part00”)。

    xz -d Content.part00.cpio.xz
    
  5. 以特权用户身份解压缩 CPIO 存档(因为设备框架具有奇怪的符号链接,cpio否则会引起抱怨,并且无论如何它都需要由 root 拥有)并将生成的 Xcode 应用程序包移动到/Applications.

    sudo cpio -idm < ./Content.part00.cpio
    sudo mv ./Xcode.app /Applications/
    

It should prompt you to do the post-install setup steps upon first launch.

它应该会提示您在首次启动时执行安装后设置步骤。

回答by Scott

I was consistently getting error messages about the archive being corrupt because I use The Unarchiveras my unpacker program. For whatever reason, it's unable to process the digital signature checking so manually choosing to open the .xip file with Archive Utility sorted the issue for me.

我一直收到有关存档损坏的错误消息,因为我使用The Unarchiver作为我的解包程序。无论出于何种原因,它无法处理数字签名检查,因此手动选择使用存档实用程序打开 .xip 文件为我解决了问题。

enter image description here

在此处输入图片说明

回答by Shreyank

Open Terminal

打开终端

1.cd drag drop your xcode (for path) then enter

1.cd 拖放您的 xcode(用于路径)然后输入

2.xattr -d com.apple.quarantine Xcode-beta.xip enter

2.xattr -d com.apple.quarantine Xcode-beta.xip 输入

回答by mSabu

Restarting my system was what worked for me.

重新启动我的系统对我有用。

回答by Ourang-Zeb Khan

I was also getting this error

我也收到这个错误

  1. i update my mac OS x version to 10.11.6. i think 10.11.4 is the minimum OS x version on which Xcode 8 will run.

  2. Make sure you have 40 gb minimum space to unzip the Xcode_8_beta_5.xip or Xcode_8_beta_2.xip

  1. 我将我的 mac OS x 版本更新为 10.11.6。我认为 10.11.4 是运行 Xcode 8 的最低 OS x 版本。

  2. 确保您有 40 GB 的最小空间来解压缩 Xcode_8_beta_5.xip 或 Xcode_8_beta_2.xip

then uncompress it. This Xcode version will take more space then the others.

然后解压。这个 Xcode 版本将比其他版本占用更多空间。

回答by Kamleshwar

Check your Xcode version it should be latest or as per Xcode Version. Hope this will resolve your problem.

检查您的 Xcode 版本,它应该是最新的或按照 Xcode 版本。希望这能解决您的问题。

回答by Dharmesh Siddhpura

I was getting this error and I did the following:

我收到此错误并执行以下操作:

The simple way is to upgrade your Mac OS x version 10.11.5 and try to unzip file using Archive Utility and it will extract the "XIP" file.

简单的方法是升级您的 Mac OS x 版本 10.11.5 并尝试使用 Archive Utility 解压缩文件,它将提取“XIP”文件。

I upgraded my mac os and this helped me. I was able to get rid of unzipping error.

我升级了我的 mac os,这对我有帮助。我能够摆脱解压缩错误。

Hope this helps!

希望这可以帮助!

回答by Stephen Strom

I was having the same problem even though I was running the latest el capitan (10.11.5). Based on Chris P's comment, I reinstalled OS X from Recovery (https://support.apple.com/en-us/HT204904), and then everything worked. Evidently something hadn't installed correctly in one of my previous updates from the App Store.

即使我运行的是最新的 el capan (10.11.5),我也遇到了同样的问题。根据 Chris P 的评论,我从 Recovery ( https://support.apple.com/en-us/HT204904)重新安装了 OS X ,然后一切正常。显然,在我之前从 App Store 获得的更新之一中,某些东西没有正确安装。