11

I just updated to xcode 14, and it seems the simulator can't run with Rosetta to fix scroll lag. Does anyone have a solution that can help me? thank you

This is photo can not open by Rosetta is here

Update: Thanks for all you guys help We have 2 solutions:

  1. (Recommended) James Risner and Manu 's solution: Force open simulator by terminal. First you need force quit simulator, than open it by terminal, keep the terminal when using simulator.
  2. Guillaume S 's solution: add new permissions admin/user for Xcode.app, Simulator.app, Simulator's Content file and Info.plist. Then, follow Guillaume S 's answer

Xcode 14.1 update: These solutions can't work anymore. So don't update now, Hope Apple will fix this problem soon

Dagg Tuan
  • 113
  • 1
  • 9
  • 1
    Same issue, following this thread hoping for a solution too. – Guillaume S. Sep 13 '22 at 13:39
  • 1
    @JamesRisner I believe he's referring to the very jumpy scrolling that the Xcode 14 simulator exhibits when opened without Rosetta on. – Steven Hepting Sep 16 '22 at 20:21
  • 1
    @JamesRisner If my simulator open without Rosetta, My app can not scroll smooth. https://developer.apple.com/forums/thread/668488 this issue happen when run on apple silicon – Dagg Tuan Sep 17 '22 at 02:26
  • The core issue ("scroll lag") is also now fixed in Xcode 14.1. – Jeremy Huddleston Sequoia Oct 18 '22 at 21:22
  • not fixed for me. What changed is this fix doesn't work anymore, so now im permanently stuck without scrolling momentum on iOS Simulators and have to use real device for dev – Jo Gro Oct 25 '22 at 12:01
  • @JoGro Which solutions are you choosing? I'm using first solution, it still working – Dagg Tuan Oct 26 '22 at 09:47
  • the first one as well, (arch -x86_x64 /path_to_simulator.app). The "scroll lag" i have is the lack of scrolling momentum when running x86_64 apps in Simulator, which was normally fixed by running Simulator in Rosetta. Now it doesn't work and scrolling momentum is permanently missing in all x86_64 apps. ARM64 apps work fine in ARM64 Simulator but this was always the case. – Jo Gro Oct 26 '22 at 18:47
  • Same for me with Xcode 14.1 :/ – Guillaume S. Nov 03 '22 at 11:09
  • @GuillaumeS. I thought in Xcode 14.1 they fixed it, I'm going to update 14.1 today, do you have any advice? – Dagg Tuan Nov 04 '22 at 08:38
  • @Dagg Tuan I rollbacked to 14.0.1, it didn't work for me. I filed a new radar with info for Apple. Hopefully they'll fix it for good in next release. – Guillaume S. Nov 04 '22 at 13:36
  • I opened a radar for it. The issue is still there in 14.1. I've narrowed it down though. It's the app store version. I installed Xcode from the developer portal twice and the app store version twice. App store was reproducible both times and the portal version didn't have the issue. @JeremyHuddlestonSequoia fyi – user1148417 Nov 21 '22 at 14:49
  • That is weird. They should be exactly the same... – Jeremy Huddleston Sequoia Nov 23 '22 at 03:22
  • 1
    Yea it is weird. In case this helps anyone. One thing I just noticed is if I expand the 14.1 .xip file and run Xcode from downloads folder the tableview's scrolling is fine. If I move Xcode to the Applications folder, the issue reappears (was trying to clean up my downloads folder haha). To your point @JeremyHuddlestonSequoia the builds are probably the same but the App Store puts Xcode into the applications folder by default. – user1148417 Dec 06 '22 at 21:28
  • 1
    any news on this? Still the same with Simulator Version 14.3 (994) and Xcode Version 14.3 (14E222b) - poke @JeremyHuddlestonSequoia – Guillaume S. May 04 '23 at 08:44
  • Still investigating... sorry for the non-update – Jeremy Huddleston Sequoia May 05 '23 at 16:54

4 Answers4

14

Solution for Xcode 14.0 (not working for Xcode 14.1 & 14.2)

Open the terminal and type :

arch -x86_64 /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator

This forces the use of Rosetta.

Manu
  • 838
  • 5
  • 7
  • Works for me. I am on Xcode 14, using react-native-maps. Without using Rosetta, map drag has huge inertia, i.e. a tiny drag would result in gigantic change on the map view. After forcing Rosetta on the simulator, the inertia is now tolerable. – Fanchen Bao Sep 23 '22 at 22:45
  • 4
    any luck for xcode 14.2 – Dhaval Patel Feb 02 '23 at 17:24
5

Launching Simulator.app under Rosetta is not supported and should not be needed. I am not aware of any issue which would require this.

You probably want to either boot the device in Rosetta or spawn some process in Rosetta, eg:

xcrun simctl boot <UDID> --arch=x86_64

or

xcrun simctl spawn <UDID> --arch=x86_64 ...

Additionally, if your app is x86_64-only, it will launch fine in a sim booted as arm64.

Note: Editing any files within Xcode.app will break its signature, meaning updates will fail to apply which will trigger a full download of Xcode.app (after first downloading and failing to apply a delta update). If you really need to launch Simulator.app as x86_64, use:

arch -x86_64 /path/to/Xcode.app/Contents/Developer/Applications/Simulator.app/MacOS/Simulator

or even create an alias in your ~/.zshrc, so you can just run sim:

alias sim='arch -x86_64 $(xcode-select -p)/Applications/Simulator.app/Contents/MacOS/Simulator'

AND file a radar about why you feel you need to do this at http://feedback.apple.com.

Followup: Thanks to whomever filed the radar about the HID issue with Simulator.app running as arm64 native after I posted this. The issue has been fixed in Xcode 14.1.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
  • 2
    Yes you are right. About your comment "I am not aware of any issue which would require this." You should research "Mac Silicon M1 react native iOS simulator scroll lag inertia" and you'll see that a lot of people are experiencing this issue that is not present with running the Simulator with Rosetta. – Guillaume S. Sep 27 '22 at 11:56
  • That very well may be so, but nobody has reported it to Apple AFAIK. I have not seen any bug report about it. Please file a radar at http://feedback.apple.com for that issue and include `simctl diagnose` and `sudo sysdiagnose -q` or it is not likely to be addressed. – Jeremy Huddleston Sequoia Sep 28 '22 at 17:12
  • Thanks to whomever just filed one! – Jeremy Huddleston Sequoia Sep 28 '22 at 23:22
  • Sorry, just saw your comment now. I’m glad that somebody did filed it. It’s really weird that no radar were there before because it’s been present since 2 or 3 Xcode/simulator versions already. Since the release of M1 MacBooks I think. Thanks again for your hard work Jeremy! – Guillaume S. Sep 29 '22 at 18:27
  • 1
    @GuillaumeS The core issue (HID issues when Simulator.app is running as arm64) has been addressed in Xcode 14.1 RC (https://developer.apple.com/documentation/xcode-release-notes/xcode-14_1-release-notes), so you should not need to do this hack any more. Thanks for reporting the bug. – Jeremy Huddleston Sequoia Oct 18 '22 at 21:20
  • 2
    I've sent you a new radar file with diagnose files for Xcode 14.1. It still is not working and even launchin with your command above doesn't work anymore. FB11749373 (Xcode 14.1 Simulator scrolling inertia lagging) – Guillaume S. Nov 03 '22 at 15:56
  • 2
    Please also take note of Jo Gro comment above, quote is: "The "scroll lag" i have is the lack of scrolling momentum when running x86_64 apps in Simulator, which was normally fixed by running Simulator in Rosetta. Now it doesn't work and scrolling momentum is permanently missing in all x86_64 apps. ARM64 apps work fine in ARM64 Simulator but this was always the case." https://stackoverflow.com/questions/73700696/open-simulator-xcode-14-by-rosetta-to-fix-scroll/73858748?noredirect=1#comment131026349_73700696 – Guillaume S. Nov 03 '22 at 16:23
  • 1
    Big lack of professionalism in the answer of my radar file on feedback.apple.com as seen on this screenshot. I am running under Xcode 14.1 and this issue IS STILL HERE. PLEASE FIX IT. https://imgur.com/a/MYc0mq3 – Guillaume S. Nov 09 '22 at 07:28
  • 2
    There are a few levels of screening between external filers and engineers. I suspect it may have been a response from someone that didn't realize you were reporting against a version we thought was fixed. I am aware there are reports it isn't fully fixed and will be looking into it more. – Jeremy Huddleston Sequoia Nov 23 '22 at 03:29
  • Super! Thanks a lot Jeremy, looking forward to this! – Guillaume S. Nov 24 '22 at 07:30
  • 1
    @JeremyHuddlestonSequoia thank you for looking into this. Is there any news on it? .. Just got my new M2 Max macbook, just to find out that I can't use the simulator for my purposes. – Jolle Mar 05 '23 at 07:09
  • 3
    The problem is still there on XCode 14.3.1 – Rados May 23 '23 at 20:02
2

Applications built with this Property List Key LSRequiresNativeExecution enabled forbid using Rosetta in launch services.

An excerpt from the Apple Documentaion:

... this key prevents the system from using the Rosetta translation process to execute the Intel portion of a universal app on Apple silicon.

A word of caution if using the simulator with Rosetta. There are known issues with the simulator, for example floating point exceptions do not work. So graphical apps may not work correctly.

You can force starting the simulator in Intel mode with Rosetta by use of this command:

arch -x86_64 /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator

sim

James Risner
  • 5,451
  • 11
  • 25
  • 47
2

Thanks to James' answer above, I found a temporary fix.

Add user/system permissions to the Simulator.app inside Xcode.app, the Contents folder inside Simulator.app and the Info.plist file inside too and modify this Info.plist by adding the following keys:

Architecture priority array with 1 item (Intel (32-bit) by default)

Application requires native environment Boolean with NO as value.

Cleanup everything and rebuild/run and it should fix the scroll lag issue.

Thanks again James Risner for this.

Guillaume S.
  • 216
  • 2
  • 7
  • How to give permission? I gave it read & write from info tab, still not working. – Abhishek Maurya Sep 23 '22 at 05:12
  • right click on the .app and get info > at the bottom of the info box you will have permissions. Click on the lock at the bottom right to enable permissions for you/admin and it should do the trick. Remember to do that for every folder/file before modifying the Info.plist in order to save your changes inside the file. But the recommended answer by James above is the great so far! Mine was tricky and before he found the command line to run the app in arch x86 which would enable Rosetta. – Guillaume S. Sep 26 '22 at 06:32