简体   繁体   English

如何加速Xcode中的iPhone模拟器

[英]How to speed up the iPhone simulator in Xcode

I'm using Xcode 7.2.我正在使用 Xcode 7.2。 When I build/run my app on device, all objects and images move according to the speed I set in the code, everything moves quickly.当我在设备上构建/运行我的应用程序时,所有对象和图像都按照我在代码中设置的速度移动,一切都在快速移动。 However, on iPhone simulator in Xcode, everything moves slowly.然而,在 Xcode 的 iPhone 模拟器上,一切都进展缓慢。 I don't have iPhone 6Plus device so with the slow moving app in simulator it'll be difficult for me to determine whether the objects are moving fast enough in the code.我没有 iPhone 6Plus 设备,所以在模拟器中移动缓慢的应用程序让我很难确定代码中的对象是否移动得足够快。

Is there a way on Xcode to make the simulator move the objects and images at the same speed as the device instead of a slowed down version? Xcode 上有没有办法让模拟器以与设备相同的速度移动对象和图像,而不是减速版本?

In the Debug menu in the Simulator, there is a "Slow Animations" menu item.在模拟器的调试菜单中,有一个“慢速动画”菜单项。 It sounds like you have it set.听起来你已经设置好了。

Once you execute your app in simulator you can go to Debug Menu and select the "slow Animations" option Check for slowness and UnCheck for Fast response on the screen changes.在模拟器中执行您的应用程序后,您可以转到调试菜单并选择“慢动画”选项检查缓慢并取消检查屏幕变化的快速响应。

Debug -> Slow Animation调试 -> 慢动画

Command + T is the short cut for same. Command + T 是同样的捷径。

在此处输入图片说明

Check out this link看看这个链接

A couple things you could do include:您可以做的几件事包括:

  • Close unused applications to free system resources such as cpu & memory关闭未使用的应用程序以释放系统资源,例如 CPU 和内存
  • make sure "slow animations" is not selected in the simulator debug menu.确保在模拟器调试菜单中没有选择“慢动画”。 Short cut for this is ⌘T simulator -> Debug -> slow animations快捷方式是 ⌘T模拟器 -> 调试 -> 慢速动画

The IOS simulator is used for rapid prototyping and is not guaranteed to perform like a real device. IOS 模拟器用于快速原型制作,不能保证像真实设备一样运行。 It operates similar to any OSX application and is limited to the available resources(eg memory, storage , cpu, etc) provided by OSX.它的操作类似于任何 OSX 应用程序,并且仅限于 OSX 提供的可用资源(例如内存、存储、cpu 等)。

As mentioned in previous answers, in the Simulator "Debug" menu, make sure "Slow Animations" is turned off and any unnecessary applications are closed.正如前面的答案中提到的,在模拟器的“调试”菜单中,确保关闭“慢速动画”并关闭所有不必要的应用程序。 However, if you are still having slow performance from the Simulator, you can also select "Low Image Quality" in the "Debug" menu.但是,如果模拟器的性能仍然很慢,您也可以在“调试”菜单中选择“低图像质量”。 It's not ideal, however if your computer is still struggling to run the Simulator, it's a quick way to ensure your animations are running how they're supposed to.这并不理想,但是如果您的计算机仍在努力运行模拟器,这是确保您的动画按预期运行的快速方法。

我注意到例如选择 iPhone 6 而不是 iPhone X(较新的 iPhone)使事情变得更快。

Here are some solutions:以下是一些解决方案:

  1. -In the border of simulator with drag and make lower size, make your simulator more faster - 在模拟器的边框中拖动并缩小尺寸,使您的模拟器更快
  2. -In "Debug" allow slow Animations" - 在“调试”中允许慢速动画”
  3. -In the Debug, Graphics Quality make "Low Quality" - 在调试中,图形质量使“低质量”

and the best solution a below: quit all emulators Run the commands on terminal以及下面的最佳解决方案:退出所有模拟器在终端上运行命令

xcrun simctl erase all

then然后

defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint 3

here are parameters这里是参数

defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint X  

Where X is:其中 X 是:

0 = auto 0 = 自动

1 = Metal 1 = 金属

2 = OpenCL 2 = OpenCL

3 = OpenGL 3 = OpenGL

guide指导

在模拟器中输入command + T ) 来关闭模拟器慢动画。

Turn off Siri in the simulator this will make the simulator device run faster在模拟器中关闭 Siri 这将使模拟器设备运行得更快

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

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