ios 直接下载Xcode模拟器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29058229/
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
Download Xcode simulator directly
提问by HardikDG
I have downloaded Xcode 6.2 today which replaced previous Xcode 6.1 now to use simulator 7.1 & 8.1 it asks to download both simulators , but for some reason after trying 4-5 times it shows network issues in downloading or request time out (note: in n/w diagnostic after it shows net is working properly)
我今天下载了 Xcode 6.2,它现在取代了以前的 Xcode 6.1 以使用模拟器 7.1 和 8.1 它要求下载两个模拟器,但由于某种原因,在尝试了 4-5 次后,它显示了下载或请求超时时的网络问题(注意:在 n /w 诊断后显示网络正常工作)
so is there any direct link from where i can download the simulator package directly or somewhere at least it shows progress in percentage/size instead just a bar
那么是否有任何直接链接我可以直接下载模拟器包或至少在某个地方至少它显示百分比/大小的进度而不是一个条形
if it's not possible i have read about copying the older simulator to new Xcode so how can i place the old simulator(7.1 & 8.1) in Xcode 6.2 that it works directly without downloading again
如果不可能,我已经阅读了有关将旧模拟器复制到新 Xcode 的内容,那么我如何将旧模拟器(7.1 和 8.1)放置在 Xcode 6.2 中使其直接工作而无需再次下载
回答by emp
Clicking on Download in Xcode didn't do anything - the progress bar did not progress (does that make it a regress bar?).
单击 Xcode 中的“下载”没有做任何事情 - 进度条没有进展(这是否使它成为回归条?)。
This is what worked for me:
这对我有用:
- Open Xcode, open preferences, go to the Downloads section.
- Open the Console App, clear the console.
- Go back to the Xcode preferences. Start the simulator download, then cancel it.
- Now in the Console, you will see something about the cancellation with the download URL.
Copy the URL from the Console. Then in Terminal in some suitable scratch folder, download it:
curl [the url you copied] -O
(the letter O, not a zero)Finally, copy this file to ~/Library/Caches/com.apple.dt.Xcode/Downloads
Remove all *.dvtdownloadableindex files (maybe it doesn't matter, but I removed them).In Xcode, in the Downloads section, start the Simulator download again, it should find the file you downloaded and install it.
- 打开 Xcode,打开首选项,转到下载部分。
- 打开控制台应用程序,清除控制台。
- 返回 Xcode 首选项。开始模拟器下载,然后取消它。
- 现在在控制台中,您将通过下载 URL 看到有关取消的信息。
从控制台复制 URL。然后在终端中一些合适的临时文件夹中,下载它:
curl [the url you copied] -O
(字母 O,不是零)最后,将此文件复制到 ~/Library/Caches/com.apple.dt.Xcode/Downloads
删除所有 *.dvtdownloadableindex 文件(也许没关系,但我删除了它们)。在 Xcode 中,在 Downloads 部分,再次启动 Simulator 下载,它应该会找到您下载的文件并安装它。
How easy was that! Only 7 steps, hah!
那是多么容易啊!只需7步,哈哈!
回答by Krunal
Follow these steps to add a (new) simulator (Xcode 9 onwards)
按照以下步骤添加(新)模拟器(Xcode 9 起)
- Click on Simulatoricon and open simulator list.
- At the end of list, there is an option to add new simulator "Add Additional Simulator". That will open 'Device & Simulator'window.
- Switch to 'Simulator'tab.
- There are three field in simulator tab.
- Click on '+'icon, on left bottom corner of window.
- Simulator Name: Enter simulator name here
- Device Type: Select iPadfrom this dropdown list
- OS Version: Select OS version from this dropdown list
- Click on 'Create'
- 单击模拟器图标并打开模拟器列表。
- 在列表的末尾,有一个添加新模拟器的选项“添加附加模拟器”。这将打开“设备和模拟器”窗口。
- 切换到“模拟器”选项卡。
- 模拟器选项卡中有三个字段。
- 单击窗口左下角的“+”图标。
- 模拟器名称:在此处输入模拟器名称
- 设备类型:从此下拉列表中选择iPad
- 操作系统版本:从此下拉列表中选择操作系统版本
- 点击“创建”
A new simulator will be added in your Simulator option list.
一个新的模拟器将添加到您的模拟器选项列表中。
Look at this snapshot to understand flow of above steps:
And if there is no simulator/OS version in simulator list, you're looking for,
如果模拟器列表中没有模拟器/操作系统版本,您正在寻找,
- Click on Simulatoricon and open simulator list.
- At the end of list, there is an option to add new simulator "Download Simulator". That will open 'Component'window (from Xcode >> Preferences).
- Select/click simulator from list, which you need to download.
- 单击模拟器图标并打开模拟器列表。
- 在列表的末尾,有一个选项可以添加新的模拟器“下载模拟器”。这将打开“组件”窗口(来自 Xcode >> Preferences)。
- 从列表中选择/单击模拟器,您需要下载该模拟器。
回答by 2xSamurai
So a quick tip for the people who use a download manager to download the .dmg file and didn't manage to get it work.
因此,对于使用下载管理器下载 .dmg 文件但未能使其正常工作的人来说,这是一个快速提示。
Once you place the file inside the 'Downloads' folder, Copy and paste the url somewhere and copy the file name alone.
将文件放入“下载”文件夹后,将 url 复制并粘贴到某处,然后单独复制文件名。
( for me I was downloading iOS 9.3 so the url was - https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
(对我来说,我下载的iOS 9.3这样的URL是- https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/ com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
and rename the file you just copied to the 'Downloads' folder, even if it looks exactly the same.
并将刚刚复制到“下载”文件夹中的文件重命名,即使它看起来完全一样。
I wasted 2 to 3 hours trying to figure this out. The problem is that the filename looks exactly the same. But there was an extra space somewhere.
我浪费了 2 到 3 个小时试图弄清楚这一点。问题是文件名看起来完全一样。但在某处有一个额外的空间。
Another Tip:Also to get the download url - open systemconsole. Make sure all messagesare selected and search for xcode inside the Search box. Go to xcode simulator download screen, start and stop the download for the simulator you want and check inside console log. You should find the url there.
另一个提示:还要获取下载 url - 打开系统控制台。确保选择了所有消息并在搜索框中搜索 xcode。转到 xcode 模拟器下载屏幕,开始和停止您想要的模拟器的下载并检查控制台日志。你应该在那里找到网址。
回答by Suraj Sonawane
To add iOS Simulator in XCode perform below steps:
要在 XCode 中添加 iOS 模拟器,请执行以下步骤:
Download iOS Simulator from Below Link:
After download completes, copy this file to ~/Library/Caches/com.apple.dt.Xcode/Downloads In some cases, we have to remove all *.dvtdownloadableindex files (maybe it doesn't matter, I didn't remove them).
- In case directory ~/Library/Caches/com.apple.dt.Xcode don't have download folder then, just click
Show package content
create Downloads folder, before moving the dmg file.
- In case directory ~/Library/Caches/com.apple.dt.Xcode don't have download folder then, just click
In Xcode, in the Downloads section, start the Simulator download again, it should find the file you downloaded and install it.
从以下链接下载 iOS 模拟器:
下载完成后,把这个文件复制到~/Library/Caches/com.apple.dt.Xcode/Downloads 在某些情况下,我们必须删除所有*.dvtdownloadableindex文件(也许没关系,我没有删除它们)。
- 如果目录 ~/Library/Caches/com.apple.dt.Xcode 没有下载文件夹,则只需
Show package content
在移动 dmg 文件之前单击创建下载文件夹。
- 如果目录 ~/Library/Caches/com.apple.dt.Xcode 没有下载文件夹,则只需
在 Xcode 中,在 Downloads 部分,再次启动 Simulator 下载,它应该会找到您下载的文件并安装它。
(Newest on top. only the latest revision is kept in the list.)
(最新的在上面。列表中只保留最新的修订版。)
- Simulator Link:
- 模拟器链接:
iOS 13.2
iOS 13.2
iOS 13.1
iOS 13.1
iOS 13.0
iOS 13.0
iOS 12.4
iOS 12.4
iOS 12.2
iOS 12.2
iOS 12.1
iOS 12.1
iOS 12.0
iOS 12.0
iOS 11.4
iOS 11.4
iOS 11.3
iOS 11.3
iOS 11.2
iOS 11.2
iOS 11.1
iOS 11.1
iOS 11.0
iOS 11.0
iOS 10.3.1
iOS 10.3.1
回答by superquanganh
If someone is searching in 2019, I have a better solution than looking at messy Console app.
如果有人在 2019 年搜索,我有一个比查看凌乱的控制台应用程序更好的解决方案。
1/ Open Terminal and run sudo /Applications/Xcode.app/Contents/MacOS/Xcode
to open Xcode in sudo mode.
1/打开终端并运行sudo /Applications/Xcode.app/Contents/MacOS/Xcode
以sudo模式打开Xcode。
2/ Xcode > Preferences > Components > Download then cancel the simulator you want to download.
2/ Xcode > Preferences > Components > Download 然后取消你要下载的模拟器。
3/ Go back to Terminal, it will log the Downloadable with the Simulator link, copy that to Safari to download it.
3/ 返回终端,它会记录带有模拟器链接的可下载内容,将其复制到 Safari 以进行下载。
回答by Shamsudheen TK
so is there any direct link from where i can download the simulator package directly or somewhere at least it shows progress in percentage/size instead just a bar
那么是否有任何直接链接我可以直接下载模拟器包或至少在某个地方至少它显示百分比/大小的进度而不是一个条形
You can't download the simulators package directly. Instead, you can download the xcodes from developer.apple using this link, which provides you the required simulators.
你不能直接下载模拟器包。相反,您可以使用此链接从 developer.apple 下载 xcode,该链接为您提供所需的模拟器。
If you want the old simulators in new Xcode, download the desired Xcode using the above link,after downloading it, Open the DMG or open your existing older Xcode, right click on the Xcode application and click 'Show Package Contents', navigate to:Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
, copy the found simulator folder (eg. iPhoneSimulator7.1.sdk folder), repeat steps 2 & 3 for your current Xcode application, paste the simulator folder,restarting the Xcode will show you the new added simulators.
如果您想要新 Xcode 中的旧模拟器,请使用上面的链接下载所需的 Xcode,下载后,打开 DMG 或打开您现有的旧 Xcode,右键单击 Xcode 应用程序并单击“显示包内容”,导航到:Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
, 复制找到的模拟器文件夹(例如 iPhoneSimulator7.1.sdk 文件夹),为您当前的 Xcode 应用程序重复步骤 2 和 3,粘贴模拟器文件夹,重新启动 Xcode 将显示新添加的模拟器。
回答by Jeremy Eaton
Often, what it takes with Xcode is a good 'ol fashioned restart. This didn't work for me, so I restarted my MacBook Pro. Now it works :)
通常,Xcode 需要一个很好的“老式重启”。这对我不起作用,所以我重新启动了我的 MacBook Pro。现在它起作用了:)
It's a quick thing to do when you're stuck.
当你被卡住时,这是一件很快的事情。