After it’s quiet acquisition by Apple early this year, TestFlight has now been fully integrated in iTunes Connect. In this guest blog, Nick den Engelsman shows you how to distribute your Titanium apps via TestFlight.
How it should work
- Create AppStore build
- Upload to iTunes connect
- Turn on TestFlight beta testing for your build
For me this didn’t work out of the box. When I uploaded my build to iTunes connect I received the following error message:
App does not contain the correct beta entitlement.
A quick Google told me to regenerate all your provisioning profiles. After spending atleast an hour on regenerating all my provisioning profiles and uploading new builds without any success (same error messages) I ended up wth the following solution:
How it does work
1. Add Entitlements.plist
Add a new file called Entitlements.plist
to the root of your Titanium project folder with the following content:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>beta-reports-active</key> <true/> <key>get-task-allow</key> <false/> <key>aps-environment</key> <string>production</string> <key>application-identifier</key> <string>XXXXXXXXXX.com.example.app</string> <key>keychain-access-groups</key> <array> <string>XXXXXXXXXX.com.example.app</string> </array> </dict> </plist>
WARNING: When building for AdHoc the Entitlements.plist
file should not be present. To automate this I use the following Grunt tasks.
- Add
grunt-rename
topackage.json
- Add
grunt.loadNpmTasks('grunt-titanium');
to yourGruntfile.js
- Add
rename
tasks:
rename: { backup_entitlements: { src: 'Entitlements.plist', dest: 'Entitlements-backup.plist' }, add_entitlements: { src: 'Entitlements-backup.plist', dest: 'Entitlements.plist' } }
- Update your
adhoc
task:
grunt.registerTask('adhoc', ['rename:backup_entitlements', 'clean', 'titanium:adhoc', 'rename:add_entitlements']);
Continue as normal
Now you can continue as normal:
- Create AppStore build
- Upload to iTunes connect
- Turn on TestFlight beta testing for your build
You should now be able to turn on TestFlight beta testing in iTunes connect console.
Comments
Almo
But HOW do you turn on Test Flight Beta Testing? I have my app uploaded, and I can’t find how to turn this on. :(
Almo
OK… so the switch to turn this on doesn’t show up until it’s finished processing your app upload. Very confusing.
Dakaz
Thanks for the article, it is helpful, but where are editing the package.json and Gruntfile.js at? Could you provide at least relative directory locations? Thanks
Niek
SO, for Bèta testing, we need to upload AppStore builds now? Then what is the use of AdHoc?
Cola
Hi all, I want to ask the same Question as Dakaz, did somebody can post the files that we must change?