3

How can I detect where an iOS app was distributed from? I'd like to detect if it was through Apple's TestFlight, Apple's AppStore, or Beta by Crashlytics distribution platform.

pjs
  • 16,350
  • 4
  • 23
  • 44
Liran Cohen
  • 184
  • 2
  • 9

2 Answers2

3

You can examine the embedded.mobileprovision file in your .app package. It is an s/mime / CMS signed plist, whose contents can definitely tell you whether the app was in-house, ad hoc or appstore. I haven't actually seen the plist for a test-flight build, although if you retrieve one, I'd love to see it.

You can either scrounge the plist out of the binary goo in the .mobileprovision file, or you can properly decode the file by implementing the equivalent of

openssl smime -inform der -verify -noverify -in embedded.mobileprovision

or

security cms -D -i embedded.mobileprovision

using the Security.framework

Rhythmic Fistman
  • 30,464
  • 5
  • 74
  • 138
0

It's not possible to know this. As others have said, the only way to do it would be to make different builds for each source.

chedabob
  • 5,716
  • 2
  • 23
  • 42