around this issue All Xcode knows is that the app has terminated. It doesn't know why, and there is no specific place because an exception wasn't thrown. So, all Xcode can do is to show that the main function crashed. This isn't strange, it's to be expected if you terminate the process that the debugger is connected to. Your app also isn't going to the background, it's being forcibly removed from memory.
With these it helps An incorrect ID may indicate, as Eugene Sh mentioned, the device is not a PIC18F45K50. It also may be that the data read back (over PGC/PGD) is corrupted. Wiring between the ICD3 and the chip must be kept reasonably short. Have you followed section 2.0 of the datasheet regarding power? In particular the requirement that VUSB3VS must be connected to either a supply voltage (not VDD for F devices) or a low ESR cap.
When app crash that time device is not connected to xcode. then how to check crash log?
To fix the issue you can do I am creating dynamic Framework and providing to clients.. I am also not giving my .dsym files to anyone. And the client App has crash reporting tolls when ever crash happens will look into stack trace and find root cause .. this seems working fine. , Yes you can. You can add this method in your AppDelegate.m file