Xcode 9.3 Playground - diagnosticd - 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?

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...

As a temporary workaround, I run this script after starting up a playground to kill the rogue diagnosticd and homed processes:
#!/bin/bash
kill $(ps -ef | grep Xcode.app | egrep "diagnosticd|homed" | awk '{ print $2 }')
Edit: This seems to be a problem with iOS playgrounds only, so another (less drastic) workaround is to use a macOS playgrounds for those cases where no UIKit components are needed.
2nd Edit: This bug appears to be fixed in Xcode 9.3.1 (available via MAS or direct download from developer.apple.com)
3rd Edit: 9.3.1 doesn't fully fix this, despite what the Release Notes say. According to the comments in my bug report, this is only be fully fixed in 9.4.

Get Xcode 9.4 Beta. It resolved my issue.
killing homed is not good solution and playground is not acting correctly anyway.
Had same issue and there was no way around it. People filed bugs as far back as April 8th.
Best solution is to download Xcode 9.4 Beta from Apple Developer Page.
This worked for me and CPU usage is low and Xcode doesn't crash on playgrounds anymore.

I also had the same issue with Xcode v 11.2.1(11B53)
It seems the issue happened after updating Mac OS and Xcode.
I found out that diagnosticd has something to do with Xcode simulators.
So I tried to Erase All Content and Settings... in Simulator menu.
Please refer to above picture.
After erasing all content and settings the issue was resolved. :D

This is a known bug, attributed by Apple to “over-enthusiastic logging by the MediaRemote subsystem”. There is no official workaround at this time.
See https://forums.developer.apple.com/message/305885

Same problem here, the only temporary solution I found was to kill 'homed', which was flooding the system with errors like
MediaRemote reply error: <error: 0x11162ed20> { count = 1, transaction: 0, voucher = 0x0, contents =
"XPCErrorDescription" => <string: 0x11162efc8> { length = 18, contents = "Connection invalid" }
}
I suppose diagnosticd, designed to report errors automatically, simply went in overdrive mode.
That's all I have for now...

Related

How to upgrade version of CXXABI in libstdc++.so.6

This is connected to my previous question. I've done a bit of research and managed to do the following:
I set the LD_LIBRARY_PATH environment variable to /home/user1/anaconda3/lib/ since this is where my libstdc++.so.6 is located. After that I kept getting the "could not find CXXABI_1.3.11 which is required version" error, and so did:
strings /home/user1/anaconda3/lib/libstdc++.so.6 | grep CXXABI
which outputs:
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_TM_1
CXXABI_FLOAT128
I'm assuming that in order for the original program to run properly, I need to be seeing CXXABI_1.3.11 when I run the strings command as I did.
Does anybody know how I might be able to upgrade the version here? Thanks.

xcodebuild (XCode 7.1) - unexpected successful exit code from cancelled command

I'm getting the following during the bundle resources copying phase in xcodebuild (XCode 7.1):
2015-11-03 22:16:28.218 xcodebuild[28202:300463] DVTAssertions:
Warning in
/Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-9061/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:739
Details: unexpected successful exit code from cancelled command
<C0505:'CpResource Foo.json':P10> Object: <PBXTargetBuildContext:
0x7faec015a440> Method:
-createCommandInvocationRecordFromInvocation: Thread: <NSThread: 0x7faebc8cc070>{number = 10, name = (null)} Please file a bug at
http://bugreport.apple.com with this warning message and any useful
information you can provide.
I have ~170 items I'm copying, but for some reason a few of them give me this error.
EDIT - I just ran the command again and now it works, so it doesn't seem deterministic.
The issue was a duplicate folder in the Copy Bundle Resources section. It used to be two different files, but they were moved so XCode decided to change them both to the folder they got moved into. Go figure.
Had this issue a couple of months ago. Today that error made it's comback.
I have it only if I try to emulate from ionic (--livereload) on a iOS-Device. Seem like if you have Xcode running it occurs. Close Xcode. That fixes it.

Unexpected '#' in program Xcode 7 and Receigen

I just updated to Xcode 7.0 last night and it seems to have broken Receigen's generated code.
CFStringRef ReceiptValidation_str1 = #obfuscateCF#("");
Unexpected '#' in program
Receigen hasn't been updated since 2014, so this is almost certainly an Xcode 7 issue.
I reached out to the developer of Receigen and haven't heard back yet (it has only been a few hours). Any help would be appreciated.
In your Xcode Target, tab "Build Phases", edit your Receigen shell script. Replace the declaration EXPANDED_BUNDLE_ID that looked like:
EXPANDED_BUNDLE_ID=`eval \"echo $BUNDLE_ID\"
simply by the variable PRODUCT_BUNDLE_IDENTIFIER (introduced in Xcode 7)
EXPANDED_BUNDLE_ID=$PRODUCT_BUNDLE_IDENTIFIER
(you can also delete the old, now needless, declaration of BUNDLE_ID)
Your script should look like this:
# Receigen binary
RECEIGEN="/Applications/Receigen.app/Contents/MacOS/Receigen"
# Extract Info.plist information
INPUT="$INFOPLIST_FILE"
BUNDLE_VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INPUT"`
# Expand information if needed
EXPANDED_BUNDLE_ID=$PRODUCT_BUNDLE_IDENTIFIER
EXPANDED_BUNDLE_VERSION=`eval "echo $BUNDLE_VERSION"`
# ...etc...
Note: found this thanks to #mcgyver42's answer and this question
See "Get Bundle ID from build settings instead of info.plist". I think it's the same issue, and I posted a work-around.
Xcode Script - Get Bundle ID from build settings instead of info.plist

Mac OS X 10.10 merge tool git bugs

When I am attempting to use git mergetool I get the following errors.
Normal merge conflict for 'application/language/dutch/config_lang.php':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (opendiff):
2014-10-16 16:30:02.996 FileMerge[42541:5140761] Failed to connect (delegate) outlet from (DiffController) to (DiffController): missing setter or instance variable
2014-10-16 16:30:02.997 FileMerge[42541:5140761] Failed to connect (mainPrefPane) outlet from (DiffController) to (NSBox): missing setter or instance variable
2014-10-16 16:30:03.071 FileMerge[42541:5140761] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
2014-10-16 16:30:03.072 FileMerge[42541:5140761] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
What can I do to fix this? The tool launches but I cannot continue after the first file.
NOTE: This error is intermittent, but happens most of the time.
cd /Applications/Xcode.app/Contents/Developer/Platforms
plutil -convert xml1 iPhoneOS.platform/Info.plist
plutil -convert xml1 iPhoneSimulator.platform/Info.plist
This fixes the 2nd set of warnings. This has been an issue since 10.8,
but apple ignores my bug report :)
I see the same behavior after upgrading from 10.9. According to this answer, delete both iPhoneOS.platform and iPhoneSimulator.platform. Or reinstall them properly from XCode if you need them. The former worked for me.

"Command not found: grep" in karaf console

I have strange problem with Servicemix version Fuse ESB 4.4.1.
Sometimes the part of the commands will not load and be not available. Usually this happens with quite often used by me command, grep. This looks as following:
karaf#root> list | grep spring
Command not found: grep
It seems to be random, restart usually helps. With previous versions of Fuse ESB it happened sometimes, but quite rare, now it happens quite often. Can someone help, what is causing the problem?
Perhaps completely unrelated, but I've encountered a number of boot-time race conditions in Karaf and its dependencies. Most importantly, this one that I filed:
https://issues.apache.org/jira/browse/KARAF-910
"Race between FeatureService and ConfigAdmin for resolving mvn: URLs?"
That particular defect only manifests if you have some non-standard settings for pax-url-mvn, but it's a symptom of the general problem that configadmin applies settings asynchronously, so it matters if the configadmin thread is faster or slower than the main OSGi bundle-starting thread.
I have not seen any Karaf Command problems related to that race, but my problem is superficially similar in that some bundle services randomly don't start.
The 'grep' command has a full name - shell:grep. You might try that to see if e.g. another command has been installed with the same short (unqualified) name and it's getting confused.
The other possibility is that the bundle that provides the grep service has stopped, possibly by accident.
osgi:list -t 0 -s
will show you a list of all the bundles by symbolic name, which includes this one: (the number may be different):
[ 18] [Active ] [Created ] [ 30] org.apache.karaf.shell.commands (2.2.3)
karaf#root> osgi:stop 18
You are about to access system bundle 18. Do you wish to continue (yes/no): yes
karaf#root> help | grep grep
Command not found: grep
karaf#root> osgi:start 18
You are about to access system bundle 18. Do you wish to continue (yes/no): yes
karaf#root> help | grep grep
shell:grep
As for why that bundle is being stopped -- maybe something (or someone) is explicitly stopping it? Or it's being stopped by accident?

Resources