Xcode iOS testsuite NSLog output missing

If you want to see your messages or your strings in your tests being printed on the output console use printf and not NSLog

Example: printf("%s", [yourNSString UTF8String]);


Log output in tests does not go to the console.

If you want to see your logs, they are in the build output.


Check console in the debugging area (the lower view) in Xcode. To open this view, click the square button with the blue rectangle on the bottom in the top-right corner of Xcode.

Edit: Why the downvote? Log statements appear in the debugging area for me.

Test:

- (void)testLoginViewControllerViewExists {
    NSLog(@"Testing Login View Controller");
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Login" bundle:nil];
    CSLoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:
                                      @"loginVC"];
    XCTAssertNotNil([loginVC view], @"loginVC should contain a view");
}

Output:

Test Case '-[AppTests testLoginViewControllerViewExists]' started.
2014-11-06 15:52:00.175 App[14870:2071450] Testing Login View Controller
Test Case '-[AppTests testLoginViewControllerViewExists]' passed (0.001 seconds).