What's the best approach for sanity testing?

Following the process for distributing an app...

  1. Build for Release
  2. Archive
  3. Export the .ipa for development (sanity testing in our case)
  4. Export the .ipa for the App Store
  5. Push the App Store build to App Store Connect
  6. Make the build available in TestFlight to App Store Connect Users
  7. Make the build available in TestFlight to External Users
  8. Publish in App Store 🙂


Q1: Can steps 1 and 2 be combined using a single xcodebuild command with the archive parameter and Release configuration specified? It doesn't always work as expected now that we are using the 'New Build System' (Xcode 10.2). Sometimes it doesn't build a static library we have in the project 😕.


Q2: Step 3 has the issue of getting Push Notifications to work. That is, Push Notifications only work for App Store builds if the app was downloaded from the store (or TestFlight). How do you indicate to your server this is not an App Store build and to use the APN debug sandbox instead. That being the case, why not skip step 3 and just have Sanity testers in the TestFlight Users group?


Thoughts?