开发者

XCode needs to be restarted after any simulator crash

开发者 https://www.devze.com 2023-03-20 10:27 出处:网络
Just recently, I\'ve started having a lot of trouble with XCode. Whenever I run my app on a simulator, and it crashes (throws an exception or something), the simulator crashes the next time I run it,

Just recently, I've started having a lot of trouble with XCode. Whenever I run my app on a simulator, and it crashes (throws an exception or something), the simulator crashes the next time I run it, even after I undo the code that caused the initial crash.

For example, say in an init method, I call

 self = [super init];
 return self;

I can run it a hundred times and it works fine every time. But if I call

 self = [super init];
 [super wrlgnqelrguqrngouqerngerg];
 return self;

Then it crashes, as it should. But then if I undo the random message call so that once again it's

 self = [super init];
 return self;

And I run it on the simulator again, it crashes! Even though I undid the code that caused the crash. When I click run, it says XCode internal error, and when I hit show details it gives me this:

ASSERTION FAILURE in /SourceCache/IDEKit/IDEKit-303/Framework/Classes/Workspace/IDEWorkspaceTabController.m:2327
Details:  Assertion failed: [suppressionTargetValue isEqualToString:_kUserDefaults_IDESuppressStopExecutionWarningTargetValue_Add]
Object:   <IDEWorkspaceTabController: 0x201759bc0>
Method:   -_showWarningForBuild:forOtherExecution:trackersToStop:taskActionBlock:
Thread:   <NSThread: 0x2000217a0>{name = (null), num = 1}
Hints:   None
Backtrace:
  0  0x0000000100949773 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
  1  0x000000010006d394 _DVTAssertionFailureHandler (in DVTFoundation)
  2  0x0000000100931e02 -[IDEWorkspaceTabController _showWarningForBuild:forOtherExecution:trackersToStop:taskActionBlock:] (in IDEKit)
  3  0x00000001008e830b -[IDEWorkspaceTabController _performContextTask:command:commandName:] (in IDEKit)
  4  0x00007fff81fd7e9a -[NSApplication sendAction:to:from:] (in AppKit)
  5  0x00000001001cf63c -[DVTApplication sendAction:to:from:] (in DVTKit)
  6  0x000000010085b656 -[IDEApplication sendAction:to:from:] (in IDEKit)
  7  0x00007fff81fd7e9a -[NSApplication sendAction:to:from:] (in AppKit)
  8  0x00000001001cf63c -[DVTApplication sendAction:to:from:] (in DVTKit)
  9  0开发者_StackOverflow中文版x000000010085b656 -[IDEApplication sendAction:to:from:] (in IDEKit)
 10  0x000000010031b9f3 -[DVTDelayedMenuButtonCell trackMouse:inRect:ofView:untilMouseUp:] (in DVTKit)
 11  0x00007fff82062215 -[NSControl mouseDown:] (in AppKit)
 12  0x00007fff81f7c34f -[NSWindow sendEvent:] (in AppKit)
 13  0x00007fff81eb1a86 -[NSApplication sendEvent:] (in AppKit)
 14  0x000000010085b36e -[IDEApplication sendEvent:] (in IDEKit)
 15  0x00007fff81e484da -[NSApplication run] (in AppKit)
 16  0x00007fff81e411a8 NSApplicationMain (in AppKit)
 17  0x0000000100000eec
 18  0x0000000000000002

Then I hit continue, the simulator starts, the app crashes, and I get:

Couldn't register NI.nipod-app-final with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.

I've tried reinstalling XCode. Doesn't help!


I solved the problem by deleting my preference files. Cleaning the project and simulators did not work. I found the file in username/library/preferences. It was called com.apple.Xcode.plist. There were a couple of other files there with Xcode in their names. I deleted all three, restarted XCode, and everything worked fine. I was using XCode 4.


Have you tried clearing the iOS simulators contents? Go to iOS Simulator > Clear all Content.

Then clean your project in xCode (available in the build menu)(and then maybe try another iOS SDK). Then run it. It should have worked, and if doesn't repeat the Clearing/Cleaning and restart your mac.

0

精彩评论

暂无评论...
验证码 换一张
取 消