Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS app crash on launch using XCode debugger, runs fine without debugger

When running the app on a device (iphone), it crashes at startup without any error messages. But if the device is not connected to xcode (not in debug mode), just open up the app, it runs fine.

Same code runs perfect on simulator.

Never seen this before, I guess something went wrong in code signing setting or LLDB debugger, but I can't work it out.

I just cannot run on a real device to debug, any idea? It stop here:

int main(int argc, char * argv[]) {
    @autoreleasepool {
        // stop here:
        return UIApplicationMain(argc, argv, nil,  NSStringFromClass([AppDelegate class])); 
    }
}

==== 2015/6/19 Edited ====

Thanks to Jim Ingham give a clear explanation. Before, I set Xcode to catch all exceptions like this:

enter image description here

This is convenient when development. However this breakpoint exception include both C++ and Obj-C type. By exclude catching the C++ breakpoints, we can solve this problem:

enter image description here

like image 869
Alston Avatar asked Jun 15 '15 03:06

Alston


1 Answers

Sometimes when you debug with real device, new version of Xcode stops your prices at beginning like described in question :

int main(int argc, char * argv[]) {
    @autoreleasepool {
        // stop here:
        return UIApplicationMain(argc, argv, nil,  NSStringFromClass([AppDelegate class])); 
    }
}

but this is not real crash (it is just some security staff - I guess ), and all you need to do is click on triangle button for go further in debug mode.

Yes I know there was no breakpoint, but do it anyway.

like image 155
Marko Zadravec Avatar answered Nov 15 '22 05:11

Marko Zadravec