XCUITest crashes when recording with Xcode 7.2 - ios

I am experimenting with new UI testing framework for iOS, using Xcode 7.2.
I have followed some tutorials and watched the presentation video from Apple and tried to record some test cases. The first tests were successful when the target was the "Simulator". When I tried to repeat the steps in a real device Xcode crashed immediately after launching the app. I used the iPhoneCoreDataRecipes demo app from Apple in order to start working with something simple and "verified".
A simple test class below:
#import <XCTest/XCTest.h>
#interface RecipesUITests : XCTestCase
#end
#implementation RecipesUITests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
[[[XCUIApplication alloc] init] launch];
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[#"Recipes"].buttons[#"Add"] tap];
[app.textFields[#"Recipe Name"] typeText:#"Lef"];
[app.navigationBars[#"Add Recipe"].buttons[#"Save"] tap];
XCUIElementQuery *tablesQuery = app.tables;
XCUIElement *descriptionTextField = tablesQuery.textFields[#"Description"];
[descriptionTextField tap];
//[descriptionTextField tap];
//[descriptionTextField tap];
XCUIElement *lefNavigationBar = app.navigationBars[#"Lef"];
[lefNavigationBar.buttons[#"Edit"] tap];
XCUIElement *overviewTextField = tablesQuery.textFields[#"Overview"];
[overviewTextField tap];
//[overviewTextField typeText:#"Lef2"];
[lefNavigationBar.buttons[#"Done"] tap];
[lefNavigationBar.buttons[#"Recipes"] tap];
}
Is it a known issue? Any idea on how to debug the problem? Do I need "somehow" to enable the device?
Update #1
When I am trying to run a test case in the device, I receive some logs in the Xcode.
2016-01-19 13:18:36.772 XCTRunner[9331:2287347] Running tests...
2016-01-19 13:18:36.776 XCTRunner[9331:2287347] Looking for test bundles in /var/mobile/Containers/Bundle/Application/42229178-A3D8-4BB1-A4CD-7E2FC28E90F9/RecipesUITests-Runner.app/PlugIns
2016-01-19 13:18:36.778 XCTRunner[9331:2287347] Found test bundle at /var/mobile/Containers/Bundle/Application/42229178-A3D8-4BB1-A4CD-7E2FC28E90F9/RecipesUITests-Runner.app/PlugIns/RecipesUITests.xctest
2016-01-19 13:18:36.780 XCTRunner[9331:2287347] Looking for configurations in /var/mobile/Containers/Bundle/Application/42229178-A3D8-4BB1-A4CD-7E2FC28E90F9/RecipesUITests-Runner.app/PlugIns/RecipesUITests.xctest
2016-01-19 13:18:36.784 XCTRunner[9331:2287347] Found configuration <XCTestConfiguration: 0x145e317d0>
testBundleURL:file:///Users/unifyit/Downloads/iPhoneCoreDataRecipes_3/Build/Products/Debug-iphoneos/RecipesUITests-Runner.app/PlugIns/RecipesUITests.xctest/
productModuleName:RecipesUITests
testsToSkip:(null)
testsToRun:RecipesUITests/testExample
reportResultsToIDE:YES
sessionIdentifier:<__NSConcreteUUID 0x145e235a0> DD878763-999D-467F-968D-599B82EC5651
pathToXcodeReportingSocket:(null)
disablePerformanceMetrics:no
treatMissingBaselinesAsFailures:no
baselineFileURL:(null)
targetApplicationPath:/Users/unifyit/Downloads/iPhoneCoreDataRecipes_3/Build/Products/Debug-iphoneos/Recipes.app
targetApplicationBundleID:com.example.apple-samplecode.Recipes
reportActivities:YES
testsMustRunOnMainThread:YES
***** Begin XCTest Status Log *****
***** End XCTest Status Log *****
Looks that nothing happens, no test case is executed, Xcode tries to load the app but it shows a black screen.
Additionally when I am trying to recode the Xcode gives the following crash:
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 7C68
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-9548/IDEKit/Testing/IDEUIRecordingManager.m:429
Details: (result) should not be nil.
Object: <IDEUIRecordingManager: 0x7fb40190c640>
Method: -_workspaceTabController
Thread: <NSThread: 0x7fb3fb519b00>{number = 1, name = main}
Hints: None
Backtrace:
0 0x0000000103e541fa -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 0x00000001029e4761 _DVTAssertionHandler (in DVTFoundation)
2 0x00000001029e4978 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x0000000103f3256b -[IDEUIRecordingManager _workspaceTabController] (in IDEKit)
4 0x0000000103f33433 __94-[IDEUIRecordingManager _startRecordingWithLaunchSession:alwaysAskForAPIAccess:reservedNames:]_block_invoke_2 (in IDEKit)
5 0x0000000102a20a04 __DVTDispatchAsync_block_invoke (in DVTFoundation)
6 0x00007fff8c97d8f5 _dispatch_call_block_and_release (in libdispatch.dylib)
7 0x00007fff8c9723c3 _dispatch_client_callout (in libdispatch.dylib)
8 0x00007fff8c985c1b _dispatch_main_queue_callback_4CF (in libdispatch.dylib)
9 0x00007fff986ac999 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation)
10 0x00007fff9866b9cd __CFRunLoopRun (in CoreFoundation)
11 0x00007fff9866afc8 CFRunLoopRunSpecific (in CoreFoundation)
12 0x00007fff8a5ead55 RunCurrentEventLoopInMode (in HIToolbox)
13 0x00007fff8a5eab8f ReceiveNextEventCommon (in HIToolbox)
14 0x00007fff8a5ea9cf _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
15 0x00007fff93319d96 _DPSNextEvent (in AppKit)
16 0x00007fff933191c5 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
17 0x0000000102fc00c2 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
18 0x00007fff9330dd28 -[NSApplication run] (in AppKit)
19 0x00007fff932d6fbe NSApplicationMain (in AppKit)
20 0x00007fff8fec85ad start (in libdyld.dylib)
abort() called

My best shot in the dark:
IOS 8 ENHANCEMENT
iOS 8 includes a new Enable UI Automation preference under Settings > Developer, which allows third-party developers finer control of when their devices are available to perform automation. For physical iOS devices, this setting is off by default and must be enabled prior to performing any UI Automation. In the simulator, the setting is enabled by default.
Source
This in on top of the more obvious requirements (ios9 target, 10.10/11, etc.) The document also lists a number of other requirements and links you might find helpful for reference.

Confirmed that enabling UI Automation and power cycling the device does allow Apple's UI Test to run on a real device. Tested on Xcode 8 + iOS 10.1.

Related

Xcode UI Testing leads to crash on every iOS Device

When trying to use the new Xcode 7 UI Testing feature on a physical iOS device by pressing the record button having the caret inside a test method, Xcode builds the project but just before starting the app on the device, the IDE crashes. I tested this with different projects (even a freshly created template one without writing a single line of code) and different devices (iPhone 6s Plus, iPad Pro, iPad mini 2 and iPhone 5, all running iOS 9.2). Does anyone have the same problem and already found a solution? Here is the complete crash log:
Process: Xcode [48959]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 7.2 (9548)
Build Info: IDEFrameworks-9548000000000000~7
App Item ID: 497799835
App External ID: 814662604
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [48959]
User ID: 501
Date/Time: 2015-12-16 20:52:24.497 +0100
OS Version: Mac OS X 10.11.2 (15C50)
Report Version: 11
Anonymous UUID: DF96274B-998D-3102-7E2F-CECD011B3D38
Sleep/Wake UUID: 613A68D1-4541-4DB7-B1C5-BC255278457F
Time Awake Since Boot: 25000 seconds
Time Since Wake: 19000 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 7C68
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-9548/IDEKit/Testing/IDEUIRecordingManager.m:429
Details: (result) should not be nil.
Object: <IDEUIRecordingManager: 0x7fa128e011a0>
Method: -_workspaceTabController
Thread: <NSThread: 0x7fa119504010>{number = 1, name = main}
Hints: None
Backtrace:
0 0x0000000102f861fa -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 0x0000000101b12761 _DVTAssertionHandler (in DVTFoundation)
2 0x0000000101b12978 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x000000010306456b -[IDEUIRecordingManager _workspaceTabController] (in IDEKit)
4 0x0000000103065433 __94-[IDEUIRecordingManager _startRecordingWithLaunchSession:alwaysAskForAPIAccess:reservedNames:]_block_invoke_2 (in IDEKit)
5 0x0000000101b4ea04 __DVTDispatchAsync_block_invoke (in DVTFoundation)
6 0x00007fff9545c871 _dispatch_call_block_and_release (in libdispatch.dylib)
7 0x00007fff9545133f _dispatch_client_callout (in libdispatch.dylib)
8 0x00007fff95464c1d _dispatch_main_queue_callback_4CF (in libdispatch.dylib)
9 0x00007fff8b1d0cd9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation)
10 0x00007fff8b18bd3d __CFRunLoopRun (in CoreFoundation)
11 0x00007fff8b18b338 CFRunLoopRunSpecific (in CoreFoundation)
12 0x00007fff846ce935 RunCurrentEventLoopInMode (in HIToolbox)
13 0x00007fff846ce76f ReceiveNextEventCommon (in HIToolbox)
14 0x00007fff846ce5af _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
15 0x00007fff899610ee _DPSNextEvent (in AppKit)
16 0x00007fff89d2d943 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
17 0x00000001020ef0c2 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
18 0x00007fff89956fc8 -[NSApplication run] (in AppKit)
19 0x00007fff898d9520 NSApplicationMain (in AppKit)
20 0x00007fff8589a5ad start (in libdyld.dylib)
abort() called
HandleCommand(command = "process plugin packet send 'QSetEnableAsyncProfiling;enable:0;'")
I run into the same problem. I even tried cleaning the cache (rm -r ~/Library/Developer/Xcode/DerivedData), without success.
I found a way around it:
Start running the application in the device of your choice (Command-R)
Once the app is ready and running in the device, hit on the red "Record UI Test" button in the Debug toolbar.
Hopefully this works for you.
EDIT. To make things more strange, this works for an iPhone 6 physically connected to my computer and for an iPhone 5s run in the Simulator. Attempts to record UI tests on an iPhone 6 Plus were not successful.

Xcode NSMangedObjectContext save causing crash

Since upgrading my iOS app to Xcode 6.3 (and I admit, doing a few changes to the code), I'm getting a crash on a save to my app's managedObjectContext.
Within Xcode, I get a break on the save call without any information in the debug window. The instruction pointer shows an EXC_BAD_ACCESS.
However, the call-stack shows this 'worrying' information..
Instruments is not helping me. On the device the app crashes without interception. The device logs show similar debug info...
Date/Time: 2015-04-13 11:39:53.861 +0100 Launch Time:
2015-04-13 11:39:32.805 +0100 OS Version: iOS 8.3 (12F69)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype:
KERN_INVALID_ADDRESS at 0x000000001bd5bec8 Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0
Crashed: 0 libobjc.A.dylib 0x0000000197ba8174
objc_release + 20 1 libobjc.A.dylib
0x0000000197ba9720 (anonymous
namespace)::AutoreleasePoolPage::pop(void*) + 560 2
liboainject.dylib 0x0000000100a657dc 0x100a60000 + 22492
3 CoreFoundation 0x00000001865c5070
_CFAutoreleasePoolPop + 24 4 Foundation 0x0000000187504ff8 -[NSAutoreleasePool drain] + 148 5 CoreData
0x00000001863ab6a4 -[_PFManagedObjectReferenceQueue
_processReferenceQueue:] + 2092 6 CoreData 0x00000001863b323c
-[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 4704 7 CoreData 0x00000001863b1790 -[NSManagedObjectContext save:] + 160
As you can see, I am saving the data on a viewWillDisappear of my ViewController.
-(void)saveCompanyDetails
{
// Do change to my 'Company' NSManagedObject
...
// Save the Moc
id delegate = [[UIApplication sharedApplication]delegate];
NSManagedObjectContext *managedObjectContext = [delegate managedObjectContext];
__autoreleasing NSError *error = nil;
if( ![managedObjectContext save:&error] ) // CRASH HERE
{
// Report error etc...
}
}
It looks like something's being released out-of-sync. I'm of course, using ARC so it is (in one respect out of my hands). I'm working on the main thread, not any background thread, so am confused as to what it could be.
Can anyone assist with what could be causing this problem, or give pointers as to where to look? At the moment I'm considering going back to xCode 6.2 to see if it rectifies (or rather 'hides' the problem), but this would be a retrograde step and not really solving the problem. I have done code changes since upgrading, but nothing around the core-data area of the app.
Thanks

XCode 5 crash on loading the project

My Xcode 5 crashes each time i want to open a project.
I deleted the derived data, the cache, the preferences and reinstall xcode.
I don't know what i should do know. I can't work.
Here is the failure message. PLease help me. I looked a lot about this in the internet.
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 5A1413
ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-3532/Framework/Classes/Protocols/DVTInvalidation.m:243
Details: <IDESourceControlCredentialsValidator, 0x7f9f18c44cb0> was never invalidated.
Backtrace for allocation (if _creationBacktrace is set):
(null)
Object: <IDESourceControlCredentialsValidator: 0x7f9f18c44cb0>
Method: -dealloc
Thread: <NSThread: 0x7f9f12c14bc0>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x00000001108fb188 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x000000010f68d655 _DVTAssertionHandler (in DVTFoundation)
2 0x000000010f68d984 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x000000010f7626a6 _DVTInvalidation_DeallocSuper (in DVTFoundation)
4 0x00000001108982a3 -[IDESourceControlSSLAuthenticationWindowController .cxx_destruct] (in IDEKit)
5 0x00007fff8703ffcc object_cxxDestructFromClass(objc_object*, objc_class*) (in libobjc.A.dylib)
6 0x00007fff87039922 objc_destructInstance (in libobjc.A.dylib)
7 0x00007fff87039fa0 object_dispose (in libobjc.A.dylib)
8 0x000000010f6b7995 __DVTSetupKVODeallocAssertions_block_invoke_371 (in DVTFoundation)
9 0x00007fff82d347fa -[NSResponder dealloc] (in AppKit)
10 0x00007fff82c6a162 -[NSWindowController dealloc] (in AppKit)
11 0x00007fff82dde901 -[NSWindowController release] (in AppKit)
12 0x00007fff82f145b0 -[NSAutounbinder dealloc] (in AppKit)
13 0x00007fff8703a230 (anonymous namespace)::AutoreleasePoolPage::pop(void*) (in libobjc.A.dylib)
14 0x00007fff80818d72 _CFAutoreleasePoolPop (in CoreFoundation)
15 0x00007fff811cd47a -[NSAutoreleasePool drain] (in Foundation)
16 0x00007fff82d3527e -[NSApplication run] (in AppKit)
17 0x00007fff82cd9bd6 NSApplicationMain (in AppKit)
18 0x00007fff82bb27e1 start (in libdyld.dylib)
19 0x0000000000000002
Status update:
I started Xcode without loading the opened projects Alt + Shift.
After that i unchecked Enabled Source Control in Preferences. Since now i can work with Xcode. That's not a fix, but for now it is ok. I look for an answer in future. For now I have no problems ;)
This Devforums post seems to have a possible solution.
For anybody else reading this before a fix is found. My specific issue was resolved by using the correct hostname for the cert on the server. Our internal DNS could direct a more logical hostname to the svn server but it was not the same hostname that was in our cert. Using the correct hostname in the cert did away with the crashing.
This Problem can be solved by
Right click on xCode show package contents
Navigate to
/Applications/Xcode.app/Contents/PlugIns/
Rename the "IDESubversion.ideplugin.hold" to Some thing else
I tried disabling the "Source control" - but Xcode would crash when I select "Source Control" tab in "Preferences". I tried some of the other things - deleting the ~/.subversion/auth/svn..... files/directories. NONE of that worked.
Finally what worked was renaming IDESubversion.ideplugin inside of Xcode.App to IDESubversion.ideplugin.old.
To do this - open "Application" on Finder. Click on Xcode.App and then "Control-click" on it. Select "Show Package Contents". Next find "IDESubversion.ideplugin". Click on it - it would change to edit name mode - change name by adding .old to the end.
After this XCode will allow you to select "Source Control" tab in "Xcode->Preferences". Deselect "Enable Source Control" and then open Xcode again and select the project you want to open. It should work. However, if you enable source control again or rename the IDESubversion.ideplugin.old to IDESubversion.ideplugin - the project/Xcode crashes again. So these two seems to be essential changes to make this work.
BTW, this is with OS X Mavericks update and to latest version of XCode (5A2053).
Hope this helps.
The only solution for me was to rename
/Applications/Xcode.app/Contents/PlugIns/IDESubversion.ideplugin
as muthukumar mentioned.
XCode crashed even if I clicked on Source Control in perferences...
#muthukumar thanks for that.

Xcode Crash each as soon as I open my project

Everything worked fine yesterday but this morning XCode crash as soon as I open my project.
Any suggestions??
The crash dialog says
Internal error
Xcode encountered an internal logic error. Choose "Continue" to
continue running Xcode in an inconsistent state. Choose "Crash" to
halt Xcode and file a bug with Crash Reporter. Choosing "Crash" will
result in the loss of all unsaved data.
and if I click on "show details" the following info is shown
ASSERTION FAILURE in
/SourceCache/IDEFoundation/IDEFoundation-287/Framework/Classes/Model/SourceControl/IDESourceControlTree.m:2548
Details: (addedItem) should not be nil. Object:
Method:
-mergeStatusOperationResults:forLocalStatusOnly: Thread: {name = (null), num = 11} Hints: None Backtrace: 0
0x0000000100949773 -[IDEAssertionHandler
handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:]
(in IDEKit) 1 0x000000010006d394 _DVTAssertionFailureHandler (in
DVTFoundation) 2 0x000000010055e1c1
__78-[IDESourceControlWorkingTree
mergeStatusOperationResults:forLocalStatusOnly:]_block_invoke_0 (in
IDEFoundation) 3 0x0000000100005fdc __38-[DVTDispatchLock
performLockedBlock:]_block_invoke_0 (in DVTFoundation) 4
0x00007fff87886fbb dispatch_barrier_sync_f (in libSystem.B.dylib) 5
0x0000000100005f83 -[DVTDispatchLock performLockedBlock:] (in
DVTFoundation) 6 0x000000010055ccd3 -[IDESourceControlWorkingTree
mergeStatusOperationResults:forLocalStatusOnly:] (in IDEFoundation)
7 0x00000001005db64c __77-[IDESourceControlWorkingTree
updateLocalStatusForDirectory:completionBlock:]_block_invoke_01137 (in
IDEFoundation) 8 0x00007fff8788dd64
_dispatch_call_block_and_release (in libSystem.B.dylib) 9
0x00007fff8786c8d2 _dispatch_queue_drain (in libSystem.B.dylib) 10
0x00007fff8786c734 _dispatch_queue_invoke (in libSystem.B.dylib) 11
0x00007fff8786c2de _dispatch_worker_thread2 (in libSystem.B.dylib) 12
0x00007fff8786bc08 _pthread_wqthread (in libSystem.B.dylib) 13
0x00007fff8786baa5 start_wqthread (in libSystem.B.dylib)
You probably have duplicate entries for the source code repository for this project. Go under Organizer and remove the duplicate and see if fixes the issue. Unfortunately, there are still a lot of bugs in the SCM tooling in XCode 4.

XCode needs to be restarted after any simulator crash

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 0x000000010085b656 -[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.

Resources