How to deploy from XCode to the device the app that behaves exactly as the app from TestFlight or AppStore?

Even when I export IPA file from exactly the same archive that is uploaded to TestFlight, with or without thinning, it behaves a bit differently.

Specifically, the exception with 0xdead10cc exit code ("dead lock") that happens in TestFlight and App Store versions, never happens with IPA version.

Choose ad hoc distribution rather than developer distribution

How to deploy from XCode to the device the app that behaves exactly as the app from TestFlight or AppStore?
 
 
Q