Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I tell if my app is running under Apple Test Flight Beta

Tags:

testflight

In the prior test flight system we pushed AdHoc builds which we used a compiler constant to identify to turn on/off features for our beta testers. Now with Apple's Beta Test Flight System we have to build for the App Store, i.e. not AdHoc, which is fine as if it tests good we can use the same build for a production review.

Is there any way from within iOS to detect that the build is a Test Flight delivered build so we know "this is beta" and do the same as before with the AdHoc compiler constant?

Thank you

like image 977
Neal Avatar asked Feb 02 '15 17:02

Neal


People also ask

How do you tell at runtime whether an iOS app is running through a TestFlight beta install?

For an application installed through TestFlight Beta the receipt file is named StoreKit/sandboxReceipt vs the usual StoreKit/receipt . Using [NSBundle appStoreReceiptURL] you can look for sandboxReceipt at the end of the URL.

Does Apple review apps on TestFlight?

Testers will use the TestFlight app to install your app and provide feedback. TestFlight supports apps for iOS, iPadOS, macOS, tvOS, watchOS, and iMessage, as well as automatic updates to ensure that testers always test the latest available build.

How long does it take Apple to review an app for TestFlight?

Approval usually takes no more than 48 hours. Once Apple approves your version of the app, subsequent builds won't need a review until you change the version number. When the app has passed Beta App Review, you'll receive an email with confirmation that your app can begin external testing.

How do I test my app in flight test?

Testing iMessage apps (iOS or iPadOS 10, or later)Install TestFlight on the iOS or iPadOS device that you'll use for testing. Open your email invitation or tap the public link on your iOS or iPadOS device. Tap View in TestFlight or Start Testing; or tap Install or Update for the app you want to test.


1 Answers

There is one way that I use it for my projects.

In Xcode, go to the the project settings (project, not target) and add "beta" configuration to the list:

enter image description here



Then you need to create new scheme that will run project in "beta" configuration. To create scheme go here:

enter image description here



Name this scheme whatever you want. The you should edit settings for this scheme. To do this, tap here:

enter image description here



Select Archive tab where you can select Build configuration

enter image description here



Then you need to add a key Config with value $(CONFIGURATION) the projects info property list like this:

enter image description here



Then its just the matter what you need in code to do something specific to beta build:

let config = Bundle.main.object(forInfoDictionaryKey: "Config") as! String
if config == "Debug" {
  // app running in debug configuration
}
else if config == "Release" {
  // app running in release configuration
}
else if config == "Beta" {
  // app running in beta configuration
}
like image 67
Klemen Avatar answered Nov 12 '22 23:11

Klemen