Search code examples
iosswiftxcodetestflight

How to run TestFlight build locally


We're beta testing right now and users are experiencing crashes when they select a cell in the explore page. didSelect is suppose to push the users to another view controller that will display posts.

When I run the app locally on Xcode everything is fine, no crashes. I sent myself an invite and installed the testflight build and sure enough the app crashes when I select a category on the explore page. Is it possible to run the TestFlight build on Xcode so I can see why its crashing? I thought the builds was the same but there must be a difference between TestFlight and running it locally on Xcode.

Here is the pushing code


 func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let vc = storyboard!.instantiateViewController(withIdentifier: "selectedDiscoverCell") as! DiscoverPostsViewController
        vc.discoverCategories = discoverCategories[indexPath.row]
        vc.styleDetails = styleDetails[indexPath.row]
        self.navigationController?.pushViewController(vc, animated: true)


    }

No errors, when I run a break on each line it works as expected..


Solution

  • To run your TestFlight build locally, first consider whether this is really what you want - vs. debugging the equivalent build. So find out what you're actually sending to TestFlight. It's what you're archiving. So look at your scheme's settings - select Archive section of its settings, and see what configuration of your target you're archiving.

    Once you know your archive's project configuration, edit that configuration temporarily in the target's Build Settings to allow for debugging (such as turning off optimization, not stripping debug symbols, etc... just walk through the target's build settings and compare your debug configuration vs. whatever configuration you use when archiving (typically it's Release but you might have a custom configuration).

    Alternatively, if you just want to run (without debugging) the archive build, just temporarily change your scheme's Run setting "Build Configuration" to whatever configuration you use for archiving - then run the app.

    If you still can't repro the crash, then revert all the temporary changes I suggested above and try archiving as normal - only instead of sending to Connect, choose to create an .ipa. You can drop it into iTunes to install it onto the connected device (or so I've heard). Then you can at least verify the crash. Maybe you can then "attach" to the running process prior to crashing... maybe...