Uploads the build to TestFlight
npm install grunt-testflight> Uploads the build to TestFlight
From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
``bash`
npm install grunt-testflight --save-dev
Once that's done, add this line to your project's Gruntfile:
`js`
grunt.loadNpmTasks('grunt-testflight');
If the plugin has been installed correctly, running grunt --help at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a devDependency, which ensures that it will be installed whenever the npm install command is run.
[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html
to the data object passed into grunt.initConfig().`js
grunt.initConfig({
testflight: {
iOS: {
options: {
apiToken: 'Enter your api token',
teamToken: 'Enter your team token',
file: 'Enter your build path',
notes: "It's a awesome app!",
distributionLists: ['Enter your distribution list'],
notify: true
}
}
}
})
`$3
#### options.apiToken
Type:
StringRequired. (Get your API token)
#### options.teamToken
Type:
StringRequired, token for the team being uploaded to. (Get your team token)
#### options.file
Type:
StringRequired, file path for the build.
#### options.notes
Type:
String or functionRequired, release notes for the build.
#### options.dsym
Type:
String
Default: nulliOS ONLY - the zipped .dSYM corresponding to the build.
#### options.distributionLists
Type:
Array
Default: nulldistribution list names which will receive access to the build.
#### options.notify
Type:
Boolean
Default: falsenotify permitted teammates to install the build.
#### options.replace
Type:
Boolean
Default: false#### options.onDone
Type:
Function
Default: function (responseJson) {}could be used to get JSON Result testflight sends back to each API call (https://testflightapp.com/api/doc/)
replace binary for an existing build if one is found with the same name/bundle version.
$3
`js
var gitRev = require('git-rev');grunt.initConfig({
localConfig: grunt.file.readYAML('localConfig.yml');
testflight: {
options: {
apiToken: '<%= localConfig.testflight.apiToken %>',
teamToken: '<%= localConfig.testflight.teamToken %>',
notes: function(done) { // you can use async function.
gitRev.long(function(hash) {
done("commit " + hash);
});
},
distributionLists: ['gatchamen'],
notify: true
},
iOS: {
options: {
file: '<%= localConfig.builds.ipa %>'
}
},
android: {
options: {
file: '<%= localConfig.builds.apk %>'
}
}
}
});
``