339

I have been working on an app in iphone simulator for a number of weeks and it has been running well up until now, but all of a sudden has begun running very slow both when loading content and animations. I have not made any changes to my code since I last tested it successfully.

I tried restarting the simulator (multiple times) and removing the app and doing a completely clean rebuild, but no luck. I also checked my cpu usage through the monitor while the simulator is running and I am only using about 30% of my cpu and 40% of memory.

I fully understand that the simulator is never a quick as the device itself, but it seems strange that it has suddenly started running slow after such a long time, and by slow I mean less than a quarter of its original speed.

shim
  • 9,289
  • 12
  • 69
  • 108
Finglish
  • 9,692
  • 14
  • 70
  • 114

14 Answers14

820

In the iOS simulator, at the bar on the top, click on DebugToggle Slow Animations (or Slow Animations with Xcode 10+). Chances are you accidentally toggled it on.

Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
Metabble
  • 11,773
  • 1
  • 16
  • 29
  • 1
    I tried this but it does not seem to make any difference. I also tried restarting after toggling, but it is still very slow. Also the speed issue doesn't seem to be limited to animation. – Finglish Mar 11 '13 at 21:16
  • @Finglish Well, at least the most likely cause is out of the way. I'm not quite sure what else might be wrong. Do you have a version of the source from before it slowed down to compare to the source now? What has changed between when it was fast and now? – Metabble Mar 11 '13 at 21:18
  • Thats what is so strange. There is no change. I have even tried running a previously successful backup, but no luck. – Finglish Mar 11 '13 at 21:20
  • @Finglish Well, without significant changes this is about all I can think of that would reduce the speed to a quarter. If you toggle animation speed, do the slow animations get even slower? If so, it isn't that because then it's working correctly. – Metabble Mar 11 '13 at 21:23
  • Ahhh! Interestingly enough the speed doesn't change when I toggle the animation speed, I am guessing this means there is something very strange happening with the simulator. – Finglish Mar 11 '13 at 21:32
  • @Finglish Well, it depends on what you mean by "animation," honestly. How are you animating your objects? If they are just UIViews and you're using `animateWithDuration:`, then they should change speed when you toggle. If nothing changes speed, then it seems like your simulator has somehow gotten stuck in slow animation mode. When you toggle the speed, open the debugger at the bottom of the Xcode window and see what it says. It usually logs "Simulator slow-motion animations are now off" when you turn them off. – Metabble Mar 11 '13 at 21:41
  • try resetting the simulator in "ios simulator" -> "reset contents and settings" – Edwin Iskandar Mar 11 '13 at 21:51
  • 1
    Not sure why this worked, but I saved but I made a new copy of the project and re-ran the simulator and it is back to full speed. I am not sure if this is just a coincidence though. – Finglish Mar 11 '13 at 22:24
  • I have given this answer a point as several of these answers could certainly help someone else. I will leave the question open for a while though just incase someone can shed light on what might have been going on. – Finglish Mar 12 '13 at 00:29
  • @Finglish Alright. Sorry I couldn't give more insight on the matter. :) – Metabble Mar 12 '13 at 03:15
  • This option is no longer available in the top bar -> Debug – iosCurator Sep 12 '18 at 00:20
  • @iosCurator What version? I have 10.1 (Simulator-877 CoreSimulator-581.2), I have the option. – titogeo Feb 21 '19 at 11:56
  • 1
    Oh wow this is likely happening to many (including me) because of the mapping to ⌘T , so if you're trying to open a browser or terminal tab it's probably toggling slow animations...... – Smitty Feb 21 '19 at 17:45
  • 1
    @Smitty this is exactly what happened to me haha :) – DavidA May 31 '19 at 17:35
  • OMG can't believe I only find out the reason now.. I guess it's because I use command + R a lot and once in a while I press on T accidentally. Thanks so much for the answer that would save me so much time!! – esdotzed Jun 14 '19 at 07:52
  • @Metabble, thanks, after six years this answer is still relevant. – Daniel Oct 25 '19 at 14:06
189

Simple Command + T will fix this problem.

Command + T toggles the simulator's Slow Animations, which can be found under the Simulator Menu: Debug -> Slow Animations.

Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
Tyler Hackbart
  • 1,948
  • 1
  • 10
  • 5
172

Go to the simulator's Debug menu and select "Toggle Slow Animations".

Update: In Xcode 10, it's just "Slow Animations":

Simulator Debug menu

Caleb
  • 124,013
  • 19
  • 183
  • 272
  • 6
    I bet every person looking at this answer hit cmd+T thinking they were in a different application and then started getting slow animations. Apple should remap the cmd+T keystroke to something way more arcane and less commonly used. – cs01 Apr 03 '19 at 20:54
56

Select Simulator,

Select Debug and uncheck slow animation.
shortcut command + t

That's work for me.

Urvish Modi
  • 1,118
  • 10
  • 11
41

If the Cmd-T (slow animations) option doesn't work for you and Debug -> Slow Animations is off but you still have slow animations try Simulator -> Reset Contents and Settings (or possibly Hardware -> Erase All Content and Settings). That worked for me when none of the other answers in here did. Anyone have a suggestion as to why?

Also having a debugger attached (at all) may make the animations very slow.

jcollum
  • 43,623
  • 55
  • 191
  • 321
  • 1
    This worked for me, but I'm also curious why. I'm developing in React Native and I wonder if my application started to take up too much space with AsyncStorage. That is just a guess. – nomad Oct 29 '16 at 03:23
  • i have tried everything but nothing fixes the slowness i am seeing i am seeing fast animations but slow movement, like in scene kit i have a ball falling and it goes so slow that you can see it move like it is 1 fps and takes like 10 sec to hit the floor – Repardeimaj Jul 31 '17 at 14:55
  • This is no longer available with the current version of Xcode, but there is a `Hardware -> Erase All Content and Settings...` option. – nomad Dec 28 '17 at 02:21
  • 1
    `Hardware -> Erase All Content and Settings...` is the ticket. – nomad Sep 09 '18 at 03:56
  • It does not help in my case https://stackoverflow.com/a/59626207/3826175 – mikep Jan 07 '20 at 10:13
33

Another potential fix for React-Native users:

Chrome de-prioritizes Javascript running in any tabs not in the foreground. So if you have enabled remote debugging, be sure to put the debugger in its own window.

Brandon
  • 917
  • 10
  • 11
29

You accidentally pressed the slow animation on debug when using simulator. So Run Simulator -> Debug -> Uncheck Slow Animation.

Digvijay Rajput
  • 351
  • 3
  • 8
  • Could you please elaborate more your answer adding a little more description about the solution you provide? – abarisone Jun 10 '15 at 13:53
13

I think you pressed command + T instead of command + R by mistake.

Saad Ur Rehman
  • 798
  • 1
  • 10
  • 19
  • 1
    Command + R to refresh. Spend 20min trying to figure out how I ruined my app. Restart my Mac, the last resort. Come here, learn something new and rejoice. – ThunderHorse Oct 27 '16 at 03:29
8

I don't have the rep yet to leave a comment, but I upvoted some answers here and wanted to say more. I had a problem with slow animations in the iOS Simulator, especially on rotation, and I found this post via Google. Indeed, somehow "Toggle Slow Animations" must have been on, because three shifts fixed it. At first, I didn't think this was a problem because there's no checkmark next to "Toggle Slow Animations." It turns out there's never a checkmark, or any indication from the menu whether it's on or off. So just try toggling it and see if the rotation/navigation is faster/slower.

So, thank you!

Geoff Hom
  • 162
  • 1
  • 9
6

Simulator -> Reset contents and settings works for me. The issue seems to reappear when I debug my react-native code remotely. It could also be to do with AsyncStorage as nomad suggested.

Community
  • 1
  • 1
smmaca
  • 85
  • 1
  • 5
2

It is NOT only about slow animations. Xcode simulator has extremely low performance in global. It is Apple's bug. I have reported it via Feedback Assistant. I have created demo with code demonstrating that simulator is 200 times slower than any old real device. I have found that JavaScript code with Date object executed in WKWebView is pain for simulator. Changing options in simulator does not help in my case. See jsfiddle https://jsfiddle.net/kjms16cw/ I hope Apple will fix it soon!

var log = document.getElementById("log");
document.getElementById("button").onclick = function() { run(); };

function run() {
 var d1 = new Date();
 for (var i = 0; i < 1000; i++) {
  var x = new Date();
  x.setMilliseconds(0);
  x.setSeconds(0);
  x.setMinutes(0);
 }
 var d2 = new Date();
 log.innerHTML = ((d2.getTime() - d1.getTime()) / 1000) + " seconds";
}
<h3>Xcode Simulator Extremely Low Performance</h3>
<p>This test runs fast (several tens milliseconds e.g. 30 ms)
in any browser any device any platform including very old iOS device
e.g. iPhone 5C and several years old iPad 2, BUT IN SIMULATOR IT TAKES 6000 ms 
(yes, 6 seconds!). Terrible!</p>
<button id="button">run()</button>
<div id="log"></div>
mikep
  • 5,880
  • 2
  • 30
  • 37
  • UPDATE: Apple did not respond to my apple feedback ticket *Jan 7, 2020 at 10:30 AM – FB7523875* (I can not provide link because any bug including non-security bug are not visible - terrible policy of apple - nobody see/know how many bugs are reported and not solved for ages) but I just tested this bug in Xcode v12.0.0 (12A7209) and wow problem is fixed! This test now runs fastly in simulator such as in real iOS device. – mikep Sep 30 '20 at 08:27
1

You can try to turn off remote debugging (Cmd-D -> Stop Remote JS Debugging). That usually speed things up.

Heinrisch
  • 5,835
  • 4
  • 33
  • 43
0

When the chrome debug is active and the browser tab is not in the foreground, the emulator is slow too. For me, I decided to put the guide in the foreground.

0

Go to menu of simulator Device -> Restart

Then everything faster than you think -_-

Thang Pham
  • 71
  • 1
  • 4