Mac App Store 上的 Xcode 无法安装,显示磁盘空间不足

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

Xcode on Mac App Store can't install , show disk space not enough

xcodemacosinstall

提问by dickfala

I'm using the Mac OS to install the XCode10.1.

我正在使用 Mac OS 安装 XCode10.1。

I have 18.43GB free disk space in the mac,

我在 Mac 中有 18.43GB 的可用磁盘空间,

but when I click the install button on the Xcode from the app store,

但是当我从应用商店点击 Xcode 上的安装按钮时,

it's always show the "Not enough storage disk space, you can't install the product" alert message.

它总是显示“没有足够的存储磁盘空间,您无法安装产品”警报消息。

How to fix the problem in the MacOS Mojave(10.14.1)?

如何解决 MacOS Mojave(10.14.1) 中的问题?

Thank you very much.

非常感谢。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Biba

What you can also do is manually download Xcode and install it. (Without using the app store update) Therefor do the following steps:

您还可以做的是手动下载 Xcode 并安装它。(不使用应用商店更新)因此执行以下步骤:

  1. go to https://developer.apple.com/download/more/
  2. search for Xcode (or latest version e.g Xcode 10.2) and manually download and install it.
  1. https://developer.apple.com/download/more/
  2. 搜索 Xcode(或最新版本,例如 Xcode 10.2)并手动下载并安装它。

See also this post here: https://discussions.apple.com/thread/8622103?answerId=250008933022#250008933022

另请参阅此处的帖子:https: //discussions.apple.com/thread/8622103?answerId=250008933022#250008933022

回答by Le Hibou

Check the "purgeable" space of your APFS disk with Disk Utilities.. It seems Finder count this space in free space, but not App Store..

使用磁盘实用程序检查您的 APFS 磁盘的“可清除”空间.. 似乎 Finder 在可用空间中计算这个空间,而不是 App Store ..

But you can trick macOS to clean up APFS by creating a huge garbage file, then deleting it.

但是你可以通过创建一个巨大的垃圾文件然后删除它来欺骗 macOS 清理 APFS。

To create the file I used the command:

要创建文件,我使用了以下命令:

dd if=/dev/zero of=~/hugefile bs=100m

letting dd run for about 30 seconds, then killing it with ctrl+c, and deleting the file:

让 dd 运行大约 30 秒,然后用 ctrl+c 杀死它,并删除文件:

rm ~/hugefile

Then App Store happily installed update..

然后App Store愉快地安装了更新..

回答by Jerry Krinock

I had 52 GB available (39 GB purgeable), but the stupid Mac App Store in macOS 10.14.4 stillsaid it had not enough free space to complete my purchaseof Xcode 10.2, even after a restart. Solution:

我有 52 GB 可用空间(39 GB 可清除),但 macOS 10.14.4 中愚蠢的 Mac App Store仍然说它没有足够的可用空间来完成我对 Xcode 10.2 的购买,即使在重新启动后也是如此。解决方案:

  • Quit the Mac App Store.
  • Delete directory ~/Library/Caches/storedownloadd
  • Relaunch Mac App Store.
  • 退出 Mac App Store。
  • 删除目录 ~/Library/Caches/storedownloadd
  • 重新启动 Mac App Store。

My Xcode "purchase" then worked on the first try.

我的 Xcode“购买”然后进行了第一次尝试。

For the curious: At the time I deleted that directory, it did not contain any app downloads. It only contained a tiny (85 KB) SQLite database (.db, -shmand -walfiles), which in turn contained four SQLite tables, three of which had zero rows and one of which had only one row and one column containing the schema version number! So this is apparently some weird bug in Mac App Store.

好奇:当我删除该目录时,它不包含任何应用程序下载。它只包含一个很小的(85 KB)SQLite 数据库(.db,-shm-wal文件),该数据库又包含四个 SQLite 表,其中三个具有零行,其中一个只有一行和一列包含模式版本号!所以这显然是 Mac App Store 中的一些奇怪的错误。

回答by Helton Malambane

  1. Delete old simulator files on: ~/Library/Developer/Xcode/iOS DeviceSupport/

  2. Delete all files derived data on: ~/Library/Developer/Xcode/DerivedData

  1. 删除旧的模拟器文件:~/Library/Developer/Xcode/iOS DeviceSupport/

  2. 删除所有文件派生数据:~/Library/Developer/Xcode/DerivedData

An easy way to accomplish these is using DevCleaner for Xcode: https://apps.apple.com/us/app/devcleaner/id1388020431?mt=12

完成这些的一个简单方法是使用 DevCleaner for Xcode:https://apps.apple.com/us/app/devcleaner/id1388020431?mt =12

回答by Nikita Pushkar

the problem with time machine! please remove old snapshoots

时光机的问题!请删除旧的快照

sudo tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-09-25-135035
com.apple.TimeMachine.2019-09-28-232824
com.apple.TimeMachine.2019-09-29-012547
com.apple.TimeMachine.2019-09-29-022054
com.apple.TimeMachine.2019-09-29-031621
com.apple.TimeMachine.2019-09-29-052318
com.apple.TimeMachine.2019-09-29-070831
com.apple.TimeMachine.2019-09-29-092229
com.apple.TimeMachine.2019-09-29-101756
com.apple.TimeMachine.2019-09-29-114952

tmutil deletelocalsnapshots 2019-09-25-135035
tmutil deletelocalsnapshots 2019-09-28-232824

etc

等等

回答by AchidF

I had the same problem (also a 120gb ssd), but 18gb is still not enough to install Xcode.

我遇到了同样的问题(也是 120gb ssd),但 18gb 仍然不足以安装 Xcode。

See this post: https://forums.developer.apple.com/thread/30235

看到这个帖子:https: //forums.developer.apple.com/thread/30235

回答by devwebcl

The same here for Xcode 11.2. It is mandatory to have at least 28GB free.

Xcode 11.2 也是如此。必须有至少 28GB 的​​可用空间。

removing different directories such us, caches, .eclipse, .julia directories to free up.

删除不同的目录,例如 us、caches、.eclipse、.julia 目录以释放。

UPDATE:24GB with lastest version: 11.2.1

更新:24GB 最新版本:11.2.1

回答by np2314

Trying to update to xcode 11.3.1 today, was in the problem like this. However, I can confirm that the download starts right after free space reaches 24GB as per some of the comments above.

今天尝试更新到 xcode 11.3.1,遇到了这样的问题。但是,根据上面的一些评论,我可以确认在可用空间达到 24GB 后立即开始下载。

I did the following:
- remove ~/Library/Caches/storedownloadd
- remove ~/Library/Developer/Xcode/iOS DeviceSupport/
- remove some files inside ~/Library/Developer/Xcode/DerivedData
- remove other unused files

我做了以下操作:
- 删除~/Library/Caches/storedownloadd
- 删除~/Library/Developer/Xcode/iOS DeviceSupport/
- 删除里面的一些文件~/Library/Developer/Xcode/DerivedData
- 删除其他未使用的文件

回答by Alok

this command works perfectly, it removed AFPS snapshots

此命令完美运行,它删除了 AFPS 快照

tmutil thinlocalsnapshots / 21474836480 4

Got the reference from this forum

从这个论坛得到了参考

https://forums.developer.apple.com/thread/110533

https://forums.developer.apple.com/thread/110533

回答by Iyvin Jose

  1. Quit App Store
  2. Delete both storedownloaddand storeassetdfrom ~/Library/Caches/
  3. Relaunch App Store
  4. Try again
  1. 退出应用商店
  2. ~/Library/Caches/ 中删除storedownloaddstoreassetd
  3. 重新启动应用商店
  4. 再试一次

The above steps resolved the issue for me.

以上步骤为我解决了这个问题。

MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)

MacBook Pro(13 英寸,2017,两个 Thunderbolt 3 端口)

macOS Mojave Version 10.14.6 (18G87)

macOS Mojave 版本 10.14.6 (18G87)