What are the best ways to debug an app when you’re testing it on your device. I’ve done a lot of simulator stuff and I was testing my app today “in the field” so to speak and it crashed. So wasn’t sure how to figure out why it crashed? Same for when it goes to TestFlight, is there a method?
Check out the Intermediate Debugging with Xcode 8 tutorial. If your device is connected to your development machine, you can still use Xcode’s debugger to trace through your app.
When an app crashes, it will generate a crash log. Take a look at Demystifying iOS Application Crash Logs for more info on how to access and use these crash logs.
More info available from Apple at Analyzing Crash Reports. They talk about TestFlight as well.
For Xcode to symbolicate a crash log, it needs to have access to the matching application binary that was uploaded to the App Store, and the .dSYM file that was generated when that binary was built. This must be an exact match; otherwise, the report cannot be fully symbolicated.
So, it is essential that you keep each build distributed to users. When you archive your app before submission, Xcode stores your binary. You can find all of your archived applications in the Xcode Organizer under the Archives tab.
You want to keep the archive for any version of your app that you distribute. That will let you symbolicate crash reports.