简体   繁体   English

如何从 Xcode 中删除多余的 iOS 模拟器条目?

[英]How do I remove redundant iOS simulator entries from Xcode?

How do I remove all these extra simulators from my Xcode menu?如何从我的 Xcode 菜单中删除所有这些额外的模拟器?

Xcode 中的冗余 iOS 模拟器

If you want to do this quickly I'd recommend fastlane tools you can reset simulators with one line 如果你想快速做到这一点,我建议使用fastlane工具,你可以用一行重置模拟器

fastlane snapshot reset_simulators

install fastlane tools 安装fastlane工具

sudo gem install fastlane

Make sure, you have the latest version of the Xcode command line tools installed: 确保安装了最新版本的Xcode命令行工具:

xcode-select --install

( https://docs.fastlane.tools/actions/capture_ios_screenshots#completely-reset-all-simulators ) https://docs.fastlane.tools/actions/capture_ios_screenshots#completely-reset-all-simulators

And the command is 命令是

fastlane snapshot reset_simulators

XCode > Window > Devices : XCode > Window > Devices

Then use the delete key or click the gear icon to remove simulators. 然后使用删除键或单击齿轮图标以删除模拟器。

You don't need to delete the Simulators you don't want to see on the run destinations drop-down menu. 您无需在运行目标下拉菜单中删除不希望看到的模拟器。 On Xcode 9 you can just hide the ones that you don't need. 在Xcode 9上,你可以隐藏那些你不需要的东西。

  1. Go to Window > Devices and Simulators ( Shift Cmd 2 ) 转到窗口>设备和模拟器Shift Cmd 2

  2. Pick the Simulator from the left and untick 'Show as run destination' as seen below: 从左侧选择模拟器并取消选中“显示为运行目标”,如下所示:

Untick'显示为运行目的地'

You can remove devices easily now in XCode 9, but use the Simulator toolbar. 您现在可以在XCode 9中轻松删除设备,但使用模拟器工具栏。 With a Simulator running, go to the top bar and go to Hardware -> Device -> Manage Devices then select Simulators. 运行模拟器后,转到顶部栏并转到硬件 - >设备 - >管理设备,然后选择模拟器。 You are presented with the option [Devices | 您将看到[Devices |。]选项 Simulators] So select simulators. 模拟器]所以选择模拟器。 Then work your way down the list, and untick the Simulators, and OS versions you don't want. 然后沿着列表工作,取消模拟器和您不想要的操作系统版本。 Too easy. 太容易了。 When you look in XCode for a Simulator to use, the list will now be much shorter. 当您在XCode中查找要使用的模拟器时,列表现在将更短。 Removing unwanted Simulators 删除不需要的模拟器

There is a nice shell script that deletes all simulators and creates a list of new ones for you on GitHub without the need of Fastlane (even though Fastlane is worth to have anyway): 有一个很好的shell脚本可以删除所有模拟器并在GitHub上为你创建一个新的模拟器列表,而不需要Fastlane(尽管Fastlane值得拥有):

https://github.com/jerolimov/reset_simulators https://github.com/jerolimov/reset_simulators

Fortunately, in more recent versions of Xcode (eg, Version 13.4.1) it is easy to delete multiple simulators at once.幸运的是,在 Xcode 的更新版本(例如,版本 13.4.1)中,一次删除多个模拟器很容易。

In Xcode go to Windows -> Device and Simulators, the choose the Simulators tab.在 Xcode go 到 Windows -> 设备和模拟器中,选择模拟器选项卡。 A list of devices will appear, from which you can multi-select and then delete.将出现一个设备列表,您可以从中进行多选然后删除。

显示 Apple Xcode 中的模拟器的屏幕截图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM