Home News Fixed: How To Fix IOS Simulator CPU Usage

Fixed: How To Fix IOS Simulator CPU Usage

242
0

 

If you’ve noticed the CPU usage of the iOS simulator, this guide should help.

 

 

When I look at the performance of an application on a simulator, I see the CPU usage.

Is the processor a simulated load on a real device, or is the Mac processor load related to running the simulator?

I understand that none of these can say much about the actual performance of the device, and I test it regularly. But I was wondering if anyone knows anything and if there is any information about the meaning of this number.

ios simulator cpu usage

I run my application in a simulator and when I run and debug it for the first time there is no problem.

The problem occurs when I run it in the simulator, then open the activity monitor and see that the application is using about 104% CPU

Does anyone have any ideas?

EDIT: This will allow the fan to run FULLY the entire time until I exit the app.

Material presentation:

Model Name: MacBook Pro Model Identifier: MacBookPro6,2 processor Name: Intel Core i7 processor Speed: 2.66 GHz number Processors: Total 1 Cores: 2 L2 caches (per core): 256 KB L3 cache: 4 MB, memory : 8 GB
Processor connection speed: 4.8 GT / s Boot ROM Version: MBP61.0057.B0C SMC Version (system): 1.58f16 series Motion detector: status: activated

Description

After running a React Native app in debug mode on the iOS simulator (either directly from Xcode or via React Native Run-ios), the diagnostic process gradually increases the CPU load to 150 after a few (5-10)% minutes. My laptop becomes unusable because the process also consumes all of the operating system file descriptors. Press the simulator home button to immediately clear the CPU usage and free up all resources.

Reaction Of The Native Version:

System:
Operating system: macOS 10.15.3
Processor: (8) x64 Intel (R) Core (TM) i7-4750HQ-CPU 2.00 GHz
Memory: 454.38 MB / 8.00 GB
Shell: 3.2.57 – / bin / bash
Binaries:
Node: 12.4.0 – / usr / local / bin / node
Topic: 1.21.1 – / usr / local / bin / yarn
npm: 5.6.0 – / usr / local / bin / npm
Watchman: 4.9.0 – / usr / local / bin / watchman
SDK:
IOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API levels: 23, 25, 26, 27, 28, 29
Building tools:23.0.1, 25.0.2, 26.0.1, 26.0.2, 27.0.3, 28.0.0, 28.0.3, 29.0.0
System images: android-27 | Google API Intel x86 Atom
IDE:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.4 / 11E146 – / usr / bin / xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
non-reactive: 0.62.0 => 0.62.0
npmGlobalPackages:
create-react-native-app: 1.0.0
React-Native-Cli: 2.0.1
React-Native-Create-Library: 3.1.2
React-Native-Git Update: 0.2.7
React-Native-Rename: 2.2.2

Play Order

  1. npx Reag-native init AwesomeProject
  2. React-Native Run-ios
  3. Wait 5-10 minutes while you monitor CPU usage during diagnostics.

Expected Results

Normal CPU usage, so I can develop for more than 5 minutes.

Snack, Code Example, Screenshot Or Repository Link:

This happens with a new project.

[edit]
I just found out this is still happening on my system while the simulator is showing a red (random) RN application error screen. Ignoring the error will again reduce the CPU load. The difference is that this now happens during normal operation of the application.