# itunes_transporter_generator [![Gem Version](https://badge.fury.io/rb/itunes_transporter_generator.png)](http://badge.fury.io/rb/itunes_transporter_generator) **CLI for generating and packaging app store assets for Game Center and In-App Purchases** Apple recently released their Transporter app (http://bit.ly/UcEhAh) which is a handy way to manage your App Store Packages (.itmsp) instead of having to input version information, achievements, leaderboards, and in-app purchases through iTunes Connect. Unfortunately, there isn't an easy way to generate these packages. Why write XML by hand and deal with the hassle of calculating MD5 and file sizes? Why not define your Game Center and In-App Purchases in a simple format and have your App Store Package generated for you? ## Installation ```sh $ gem install itunes_transporter_generator ``` ## Usage ### Get familiar with the spec First, you'll need to be familiar with the app metadata specification, available from the bottom navigation in the Manage Your Applications section of iTunes Connect, which outlines all the possible information describing an achievement, leaderboard, or in-app purchase. ### Describe your application metadata Next, you'll need to create a YAML file describing your company information, locale-specific version information, and achievement, leaderboard, and/or in-app purchase details. The beauty of describing your app store assets in YAML is no hand writing XML making it understandable at a glance, and you can store your configuration in source control. ### Generate the .itmsp This is as simple as running the following command in the folder containing your YAML config file and all referenced images. ```sh $ itmsp package -i --[no-]prefix-images ``` #### Options - ```-i / --input``` Required. Specified the config YAML used to generate the itmsp package - ```--[no-]prefix-images``` Options. False, if not specified. If true, all images specified will be prefixed with the locale, display target, and type (achievement, IAP, leaderboard) as appropriate ### That's It! You can now upload your .itmsp package to iTunes Connect using the Transporter tool. Alternatively, there is another great open-source tool which wraps some of the complexities of running Transporter directly (https://github.com/sshaw/itunes_store_transporter) ## Sample Config file Below is a sample configuration file describing an app version for the en-US and fi locale, achievement, leaderboard, and different types of in-app purchases. The specific metadata required for each item type is fully described in the [App Metadata Specification guide](http://bit.ly/TtHMF6) IMPORTANT: please note the syntax for multiline descriptions with extra line breaks. This is the literal syntax for [YAML used for multiline strings](http://www.yaml.org/YAML_for_ruby.html#extra_trailing_newlines_with_spaces). Also note the indentation. ```yaml provider: SampleCompany # optional if team_id is supplied team_id: ABCDE12345 # optional if provider is supplied vendor_id: sample-sku # the application's SKU as defined in iTunes Connect id_prefix: com.samplecompany.applicationname. # if supplied, this will be prefixed to achievement, leaderboard, and in-app purchase IDs versions: - name: 1.1.3.1 locales: - name: en-US title: sampleApp description: |+ Description of sampleApp. This description spans multiple lines using the pipe characters. All newlines are preserved. keywords: - Sample - App version_whats_new: |+ Version Whats New. extra line breaks software_url: 'http://example.com' privacy_url: 'http://example.com' support_url: 'http://example.com' screenshots: iphone_4in: - 'test-h568@2x.png' - 'test-h568-2@2x.png' iphone_3.5in: - 'test.png' ipad: - 'test-ipad.png' - name: fi title: sampleApp-FI description: |+ Description of sampleApp. This description spans multiple lines using the pipe characters. All newlines are preserved.-FI keywords: - Sample-FI - App-FI version_whats_new: |+ Version Whats New. extra line breaks software_url: 'http://example.com' privacy_url: 'http://example.com' support_url: 'http://example.com' screenshots: iphone_4in: - 'test-h568@2x.png' - 'test-h568-2@2x.png' iphone_3.5in: - 'test.png' ipad: - 'test-ipad.png' achievements: # the order in which achievements are defined will be the order in which they appear in Game Center - id: first_achievement name: First Achievement points: 10 locales: - name: en title: First Achievement before_earned_description: Complete a task after_earned_description: Completed a task achievement_after_earned_image: test.png - name: fi title: First Achievement-FI before_earned_description: Complete a task-FI after_earned_description: Completed a task-FI achievement_after_earned_image: test.png leaderboards: # the order in which leaderboards are defined will be the order in which they appear in Game Center - default: true # only one leaderboard can be set as default. id: top_scores name: Top Scores locales: - name: en title: Top Scores formatter_suffix: ' Points' # note the space. This must be provided if you want a space between the value and suffix formatter_suffix_singular: ' Point' formatter_type: INTEGER_COMMA_SEPARATOR leaderboard_image: test.png - name: fi title: Top Scores-FI formatter_suffix: ' Points' # note the space. This must be provided if you want a space between the value and suffix formatter_suffix_singular: ' Point' formatter_type: INTEGER_COMMA_SEPARATOR leaderboard_image: test.png purchases: auto_renewable_purchases: family: name: Sample Product Group review_screenshot_image: test.png review_notes: 'Review notes!' purchases: - product_id: six_month_subscription type: auto-renewable # products in a family group must be of auto-renewable type and be the same product but with different durations duration: 6 Months # specific values defined in the app metadata specification outline free_trial_duration: 1 Month bonus_duration: 1 Month cleared_for_sale: true wholesale_price_tier: 5 - product_id: one_year_subscription type: auto-renewable # products in a family group must be of auto-renewable type and be the same product but with different durations duration: 1 Year # specific values defined in the app metadata specification outline bonus_duration: 2 Months cleared_for_sale: true wholesale_price_tier: 9 locales: - name: en title: Sample Product Group description: All your products in this sample group publication_name: Sample Product Group - name: fi title: Sample Product Group-FI description: All your products in this sample group-FI publication_name: Sample Product Group-FI other_purchases: - product_id: one_hundred_dollars reference_name: 100 dollars type: consumable review_screenshot_image: test.png cleared_for_sale: true wholesale_price_tier: 1 # pricing tier matrix is available in Exhibit C of the iOS Paid Applications contract in the Contracts, Tax, and Banking section of iTunes Connect locales: - name: en title: $100 description: An extra $100 for you - name: fi title: $100-FI description: An extra $100 for you-FI - product_id: new_level reference_name: Unlocks a new level type: non-consumable review_screenshot_image: test.png cleared_for_sale: true intervals: - start_date: 2013-01-31 end_date: 2013-02-28 wholesale_price_tier: 3 - start_date: 2013-03-01 # no end date specified. The price will not change after this point. wholesale_price_tier: 2 locales: - name: en title: Unlocks a new level description: Try your luck at this new level - name: fi title: Unlocks a new level-FI description: Try your luck at this new level-FI - product_id: another_level reference_name: Unlocks another new level type: non-consumable review_screenshot_image: test.png cleared_for_sale: true intervals: - start_date: 2013-08-01 end_date: 2013-08-13 wholesale_price_tier: 3 - start_date: 2013-08-14 wholesale_price_tier: 2 locales: - name: en title: Unlocks a new level description: Try your luck at this new level - name: fi title: Unlocks a new level-FI description: Try your luck at this new level-FI ``` This configuration will generate the following metadata.xml if run with the --no-prefix-images option. ```xml SampleCompany ABCDE12345 sample-sku sampleApp Sample App http://example.com http://example.com http://example.com test-h568@2x.png 15580 87c19e9afd9bb2f0deee5d08233c7473 test-h568-2@2x.png 17003 3d3cd97260a3d61c0384127979253c5a test.png 147834 5db692abb9ae13bbb621cba672319ad9 test-ipad.png 49743 88755b5603befa4d7ce81dea5d9bc035 sampleApp-FI Sample-FI App-FI http://example.com http://example.com http://example.com test-h568@2x.png 15580 87c19e9afd9bb2f0deee5d08233c7473 test-h568-2@2x.png 17003 3d3cd97260a3d61c0384127979253c5a test.png 147834 5db692abb9ae13bbb621cba672319ad9 test-ipad.png 49743 88755b5603befa4d7ce81dea5d9bc035 com.samplecompany.applicationname.first_achievement First Achievement 10 false false First Achievement Complete a task Completed a task test.png 147834 5db692abb9ae13bbb621cba672319ad9 First Achievement-FI Complete a task-FI Completed a task-FI test.png 147834 5db692abb9ae13bbb621cba672319ad9 com.samplecompany.applicationname.top_scores Top Scores false Top Scores Points Point INTEGER_COMMA_SEPARATOR test.png 147834 5db692abb9ae13bbb621cba672319ad9 Top Scores-FI Points Point INTEGER_COMMA_SEPARATOR test.png 147834 5db692abb9ae13bbb621cba672319ad9 Sample Product Group All your products in this sample group Sample Product Group Sample Product Group-FI All your products in this sample group-FI Sample Product Group-FI test.png 147834 5db692abb9ae13bbb621cba672319ad9 Review notes! com.samplecompany.applicationname.six_month_subscription 6 Months 1 Month 1 Month auto-renewable true 5 com.samplecompany.applicationname.one_year_subscription 1 Year 2 Months auto-renewable true 9 com.samplecompany.applicationname.one_hundred_dollars 100 dollars consumable true 1 $100 An extra $100 for you $100-FI An extra $100 for you-FI test.png 147834 5db692abb9ae13bbb621cba672319ad9 com.samplecompany.applicationname.new_level Unlocks a new level non-consumable true 2013-01-31 2013-02-28 3 2013-03-01 2 Unlocks a new level Try your luck at this new level Unlocks a new level-FI Try your luck at this new level-FI test.png 147834 5db692abb9ae13bbb621cba672319ad9 com.samplecompany.applicationname.another_level Unlocks another new level non-consumable true 2013-08-01 2013-08-13 3 2013-08-14 2 Unlocks a new level Try your luck at this new level Unlocks a new level-FI Try your luck at this new level-FI test.png 147834 5db692abb9ae13bbb621cba672319ad9 ``` ## Todo * TESTS. High on my list * RDocs. Definitely need to document this. * Metadata validation. There are lots of rules depending on what values you provide. You should know when you generate the package if there are any issues instead of having Apple tell you when you upload * Anything else! Pull requests are welcome! This is my first Ruby project so I'm sure there is are a lot of improvements that can be made * Finish in-app purchase XML generation (lots of different options here!) ## Contact Colin Humber - http://github.com/colinhumber - http://twitter.com/colinhumber ## License itmsp is available under the MIT license. See the LICENSE file for more info.