Question

I've installed the XCode 4.3. I've seen that in preferences general tab, there is the "iOS device discovery" tab. Maybe it was there before too, but I just noticed now. So I've checked it, after this I can do anything, but the XCode crashes constantly when I try to access the organizer's devices tab.

Any clues for solution?


Update: I've deleted it and reinstalled it from the Mac App Store, but it didn't help


Update: I've submitted the bug to Apple, they marked it as duplicate and after this they closed both of them. So, I hope we will have a solution from Apple.

Was it helpful?

Solution

Same Problem here. I just created a new user on my system. With it I have no problem open the Devices in the Organizer Window.... strange...

Edit: I've deleted one certificate in my keychain that solve the problem for me. It was a certificate which was not trustful. Maybe this will help you.

Note that the "harmful" certificate might not be a development certificate or related to development/provisioning at all. Make sure to check for "Certificates", not just "My certificates" in Keychain. The culprit could be any certificate, like a company-signed SSL certificate etc.

OTHER TIPS

I can't take full credit for this. I found it here and added a little bit to the end that I needed in my case.

Create readcert.m with these contents:

#import <Security/Security.h>
#import <Foundation/Foundation.h>

void checkCerts () {
    OSStatus status;

    const void *keys[] = {
        kSecClass,
        kSecReturnRef,
        kSecMatchLimit
    };
    const void *values[] = {
        kSecClassCertificate,
        kCFBooleanTrue,
        kSecMatchLimitAll
    };
    CFDictionaryRef query = CFDictionaryCreate(NULL, keys, values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

    CFArrayRef results;
    if ((status = SecItemCopyMatching((CFDictionaryRef) query, (CFTypeRef *)&results)) != noErr) {
        NSLog(@"Failed to copy certificates: %d", status);
        return;
    }

    CFIndex count = CFArrayGetCount(results);
    CFIndex i;
    for (i = 0; i < count; i++) {
        SecCertificateRef cert = (SecCertificateRef) CFArrayGetValueAtIndex(results, i);
        CFErrorRef error;
        CFDictionaryRef vals = SecCertificateCopyValues(cert, NULL, &error);
         if (vals == NULL) {
            CFStringRef subjectSummary = SecCertificateCopySubjectSummary(cert);
              NSLog(@"Found a triggering certificate: %@", subjectSummary);
         }
    }

    CFRelease(results);
}

int main (int argc, char *argv[]) {
    NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
    checkCerts();
    [p release];

    return 0;
}

Then, compile it with:

clang -o readcert readcert.m -framework Security -framework Foundation

Then run it:

./readcert

It should output the name of the bad certificate. In my case, it was a certificate from a Linksys router. I deleted the certificate from my keychain, but Xcode was still crashing and readcert was still saying it was there, so I ended up executing this command.

sudo security delete-certificate -c Linksys_WRVS4400Nv2

I'm not sure where the certificate was coming from, I didn't see it in the login or system keychains, but after deleting it from the command line, everything was peachy again in Xcode.

Same Problem. Not happy. I have a hard time believing apple released this in such a state. XCode has crashed at least 25x today on me.

I solved the problem. I don't know if its the best solution, but after five days I'm happy to have Xcode working again.

I solved the problem by doing two things. Resetting my Keychain under Lion and revoking my existing provisioning profiles.

So first, reset your Keychain under Lion (http://support.apple.com/kb/TS1544). This will make the Organizer launch without crashing.

Unfortunately, now you can't deploy your software because you killed all the certs in the keychain. So now you need to revoke all your developer certs (developer.apple.com/membercenter) and delete the provisioning profiles from your Organizer. Then tell the Organizer to refresh.

It will restore all your sick profiles, but will also create at least one healthy one.

The new version of Xcode tries to be helpful, and wants to handle all your cert needs for you. So bring up an Xcode project, and set code signing to the new provisioning profile. Compile, and everything will work again.

As I said, may not be the best solution, but deleting old certs from the Keychain and extra prefs files did nothing to help me. If all else fails, try this recipe and it will probably help.

Finally figured this out. The problem for me was with the my dev device and not XCode. I restored my device to the factory defaults. Now XCode won't crash when the device is plugged in.

Before I reset the device, I tried just deleting all the certificates on the device. However, XCode still crashed. That's the only other step I took on the device before reseting it.

3/22/12 UPDATE: Apple released a new version of XCode today. From the release notes:

Additional bug fixes and stability improvements

Hopefully this fixes the issue for most people.

4/11/12 UPDATE

I started to have issues again with XCode. A colleague suggested I clear out the XCode cache for my project, which was located here for me:

~/Library/Developer/Xcode/DerivedData/your_app_name-abunchofletters

Within that folder run:

rm -r *

XCode no longer crashes when plugging in my dev device.

and again here.. I noticed my iphone would wake up after these crashes - it syncs via wifi.

I thought it fixed the problem yesterday until I started work today.. I can't work like this.. I'm already looking for an alternative.

I can force it to crash Today (for something different from Apple) File > Open > And select the programming folder where all the work is..Boom! Every Time..

Bottom Line: No Apple App release expected Today...

Same here. Check out your the System logs. For me it seems to be a bogus USB connection. I see stuff like that in the logs (console app):

27.02.12 13:34:16,537 com.apple.usbmuxd: _SendAttachNotification (thread 0x7fff756c7960): sending attach for device xxx._apple-mobdev._tcp.local.: _GetAddrInfoReplyReceivedCallback matched.

And then 27.02.12 13:34:20,407 [0x0-0x6b06b].com.apple.dt.Xcode: garbage pointer stored into reachable memory, break on auto_zone_resurrection_error to debug 27.02.12 13:34:20,425 [0x0-0x6b06b].com.apple.dt.Xcode: Xcode(2099,0x114d85000) malloc: * error for object 0x7fef55278cb0: pointer being freed was not allocated

Interestingly right after that tere is a backupd process that tries to start the time machine backup. Maybe related - I'll keep an eye on it.

I tried removing certificates as others have suggested and even reset my Keychain. However this had no affect and opening the organiser always causes a crash/hang.

My fix was to remove some of the Xcode settings files. Specifically I removed the following:

~/Library/Developer/Xcode/UserData/IDEOrganizerWindowController.xcuserstate
~/Library/Developer/Xcode/UserData/IDEPreferencesController.xcuserstate
~/Library/Developer/Xcode/UserData/KeyBindings

The solution to this Xcode problem seems to vary, but I had not seen anyone else post this solution, so I hope it will help others. Remember I had gone through the Keychain reset before getting to this, so I'm not ruling out a keychain reset with this solution.

This isn't a real fix, but if you open up Activity Monitor, filter for bash, and continue to close/force close that process, xCode will regain consciousness.

If above solutions dosen't work then try installing previous version of your xcode using time machine. Really it worked for, apple updates is creating problem.

I deleted all old certificates which were not trustful. Even after doing so, my Xcode 4.5 crashed while opening organizer.

Hard Resetting the Xcode fixed my problem.

  1. Fire up your terminal.

  2. Type "defaults delete com.apple.Xcode" and press "Enter." This deletes the customized settings set up.

    Sometimes if you have more than one version of Xcode installed the defaults bundle identifier could be different. You can check lists of bundles identifiers by allowing terminal to show possibilites by pressing Tab button.

  3. Type "rm -rf ~/Library/Application\ Support/Xcode" and press "Enter." This removes the configuration folders as well.

Now open up an Xcode and it will show you agreement page. In this way my Xcode worked as expected.

I hope it might be help to someone.

I tried all the above and couldn't, the solution I found was really simple:

Go to ~/Library/Developer/ , inside this folder has a folder Xcode, all I did was renaming the existent one and reopen Xcode, then Xcode created a new folder name Xcode and everything started to work again.

Hope that helps.

I had this same error on Xcode 5.0 whenever I went to the Devices tab. The solution was found by looking at Applications->Utilities->Console. It was attempting to write to a read-only device logs database which then meant it couldn't instantiate the object model (ORM) and context for that database. The crash description was "Cannot perform operation without a managed object context".

Removing ~/Library/Developer/Xcode/iOS Device Logs/* and ~/Library/Developer/Xcode/iOS Device Logs*.db meant that it recreated the (now empty) .db file on startup with the right permissions, and everything works fine now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top