TestFlight build different to local Release build. How?

My team and I have been working on production iOS apps since 2014, but today in 2021 we have an issue we can't figure out.

We have been working on a major feature which we are now at the point of internal alpha testing. We have two test apps: one of the specific section of the app the feature is in, and one of the entire app. In both of these apps, our local builds work without issue in both Debug and Release configurations. However, all of our TestFlight builds (we only do TestFlight builds of the complete app) are crashing all on devices we try it with as soon as the new feature is used.

The crash reports point to a 3rd party library we are using regarding buffer sizes (it is an audio feature, using low level I/O AudioUnits). This doesn't really help us track down the issue though because, try as we might, we have never been able to reproduce this in a local build. There it always works without failure.

I don't actually understand how this is possible. What could possibly be different between a Release build run locally compared to what is available on TestFlight?

Another side of this is, can we somehow debug the TestFlight build on our devices with lldb in order to track down what is going on here?

Apple say:

For all distribution methods except TestFlight, choose the following options to enhance your chances of discovering a bug that manifests only in the release build:

Set App Thinning to “All compatible device variants”.
Check “Rebuild from Bitcode”.

Accepted Answer

Thanks for your response, robnotyou. I upvoted it because it may be useful for others.

As for our issue, I think I tracked this down today (after a week) to a difference in the git setup. Because of an issue in the CI setup, we ended up bundling a bunch of files that should be binary files as just the git-lfs (text) placeholders. Since our app logic was expecting real files here, it was crashing. More moving parts = more things that can go wrong I guess.

Assuming that was the issue, Xcode was doing exactly what we were telling it to do 🤷‍♀️ Moving on...

TestFlight build different to local Release build. How?
 
 
Q