Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 9.3 Playground - diagnosticd

Tags:

xcode

I noticed every time I launch a Playground in Xcode (version 9.3) a daemon starts in the background and uses more that 100% of my CPU!

I deleted Xcode's cache and its DerivedData folder but no change.

Does anyone know how to resolve this problem?

like image 724
Berty86 Avatar asked Mar 31 '18 19:03

Berty86


1 Answers

diagnosticd is a daemon you need to stop/kill with launchctl. The daemon you most likely need to stop has 'SimDevice' in its name. To get the exact name do:

/bin/launchctl list | grep SimDevice 

Then with the appropriate name(s) (there could be more than 1) do:

/bin/launchctl stop 'name' 

In my case 'name' was: com.apple.CoreSimulator.SimDevice.380EFF06-B636-49CD-851E-5DB4890641AE

If you use Playground a lot and you usually have more than 1 simulator eating your CPU run this script instead:

/bin/launchctl list | grep SimDevice | awk '{print $3}' | xargs -I %s /bin/launchctl stop %s 

Oh, and dont forget to file a bug report with apple here: https://bugreport.apple.com/web/

Btw, its kinda fun to see playground/diagnosticd struggle with your code; if you create a bug or some other elaborate syntax, cpu goes up. If you clear it, cpu goes down (just a bit). Almost hilarious how Apple implemented this...

like image 142
Yohst Avatar answered Sep 20 '22 14:09

Yohst