From d4fcf29c1fc533d06978d9d453dca629246b5e69 Mon Sep 17 00:00:00 2001 From: Michael May Date: Tue, 17 Mar 2015 16:37:16 +0000 Subject: [PATCH 1/5] Moved the various commands into scripts to make it a little easier to use and update the README with the new flows --- .gitignore | 36 ++++++++++++++++++++++++++++++++++++ README.md | 39 +++++++++++++++++---------------------- download-metadata.sh | 8 ++++++++ environment.sh | 35 +++++++++++++++++++++++++++++++++++ screenshots.php | 15 ++++++++------- upload-metadata.sh | 5 +++++ verify-metadata.sh | 9 +++++++++ 7 files changed, 118 insertions(+), 29 deletions(-) create mode 100644 .gitignore create mode 100755 download-metadata.sh create mode 100755 environment.sh create mode 100755 upload-metadata.sh create mode 100755 verify-metadata.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d9ba42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Xcode +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside + +#OSX Generated Stuff +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db + +# Custom +DerivedData/* +*/DerivedData/* +coverage.xml +test-report.xml +*/test-reports/* +*.xarchive + +# ITMS +itms/* diff --git a/README.md b/README.md index 9bc8241..c279ab1 100644 --- a/README.md +++ b/README.md @@ -6,47 +6,43 @@ This script helps prepare localized screenshots for delivery to iTunes Connect v *** #### Step 1 -Open your app in iTunes Connect and create a new version. Ensure your app is listed in the "Prepare for Upload" status. Download your app's metadata package from Apple. +Open your app in iTunes Connect and create a new version. Ensure your app is listed in the "Prepare for Submission" status. Download your app's metadata package from Apple using the download script. - ITMSUSER=YourItunesUsername - ITMSPASS=YourItunesPassword - ITMSSKU=YourAppSKU - PATH="$PATH:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/" - iTMSTransporter -m lookupMetadata -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -destination ~/Desktop + > `download-metadata.sh` -This will save the .itmsp file to your desktop. +This will save the .itmsp archive to the directory you specify, defaulting to `./itms/itmsp`. You'll also find a new screenshots directory under there too. #### Step 2 -Take screenshots and save them to `~/Desktop/screenshots` with the format like +Take screenshots and save them to this new directory `./itms/screenshots` with the format like - > `cmn-Hans___ios4in___portrait___screen1.png` + > `en-GB___iOS-4-in___portrait___screen1.png` -This is comprised of sections delimited by `___`: +This is comprised of case sensitive sections delimited by three underscores `___`: - - Device name: correct names are `Mac`, `iOS-3.5-in`, `iOS-4-in` or `iOS-iPad` - - Locale: like `es-ES`, `fr-FR`, `ja-JP`, `en-US`, **HELP: NEED HELP FULLY DOCUMENTING LOCALE NAMES IN ITMS** + - Device: Correct names are (currently) `Mac`, `iOS-3.5-in`, `iOS-4-in`, `iOS-4.7-in`, `iOS-5.5-in` or `iOS-iPad` + - Locale: like `es-ES`, `fr-FR`, `ja-JP`, `en-US`, `en-CA`, `en-GB` **HELP: NEED HELP FULLY DOCUMENTING LOCALE NAMES IN ITMS** + - Orientation: optional (`portrait`) + - Screen: screenN where N is the ordering for it when uploaded `(1,2,3,4,5)` + - Extension: always use .png Optional: write a UI script and automate generation of screenshots for all devices and localizations using https://github.com/jonathanpenn/ui-screen-shooter Note: if your screenshots are in the format `Locale/Devicename___other.png`, fix this with: `for a in */*; do d=$(dirname $a); f=$(basename $a); mv $a ${d}___${f}; done; rmdir */` #### Step 3 -Run `php screenshots.php` – this will add the XML chunks you need and make a fresh copy of your `metadata.xml` in the screenshots folder. +Run `php screenshots.php` – this will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. #### Step 4 -Copy the contents of "screenshots" on your desktop into the itmsp file on your desktop (right-click -> show package contents to access the latter). Or use the following command: +Verify the content you have generated by running the verify script. - cp ~/Desktop/screenshots/* ~/Desktop/*.itmsp +> `verify-metadata.sh` -#### Step 5 -Verify your upload: - - iTMSTransporter -m verify -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f ~/Desktop/*.itmsp +This will put a copy of all your screenshots inside the itmsp package and then attempt a verify only upload. Error "software_screenshots cannot be edited in the current state" happens if your app is currently being reviewed. #### Step 6 -If things went well, execute your upload: +All being well, you can perform the actual upload - iTMSTransporter -m upload -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f ~/Desktop/*.itmsp +> `upload-metadata.sh` ----------------- @@ -56,7 +52,6 @@ You can modify Xcode schemes to automatically launch your app in a particular lo On top of that, I wanted localized users for my screenshots, so I pass an Environment Variable of "USER_ID", then grab that in my code & setup the user programmatically. You can get Environment Variables via: [[NSProcessInfo processInfo] environment] - ## Heads Up There's a bug in the Transporter that removes newlines from any textual metadata, so I don't recommend using it for that purpose at this time. diff --git a/download-metadata.sh b/download-metadata.sh new file mode 100755 index 0000000..49ab8af --- /dev/null +++ b/download-metadata.sh @@ -0,0 +1,8 @@ +. environment.sh + +echo "Downloading..." + +iTMSTransporter -m lookupMetadata -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -destination $ITMSFOLDERNAME + +echo "itmsp package is now at $ITMSFOLDERNAME" + diff --git a/environment.sh b/environment.sh new file mode 100755 index 0000000..1ce31fa --- /dev/null +++ b/environment.sh @@ -0,0 +1,35 @@ +ITMSFOLDERNAME=./itms +ITMSSCREENSHOTSFOLDERNAME="$ITMSFOLDERNAME/screenshots" +PATH="$PATH:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/" + +if [ -z "$ITMSUSER" ]; +then + read -p "Username:" ITMSUSER +fi + +if [ -z "$ITMSPASS" ]; +then + read -s -p "Password:" ITMSPASS + echo "" +fi + +if [ -z "$ITMSSKU" ]; +then + read -p "SKU:" ITMSSKU +fi + +if [ ! -f "$ITMSFOLDERNAME" ]; +then + echo "Directory $ITMSFOLDERNAME already exists. This might be expected but it might mean old assets lying around" +else + echo "Making directory $ITMSFOLDERNAME for the itmsp package" + mkdir $ITMSFOLDERNAME +fi + +if [ ! -f "$ITMSSCREENSHOTSFOLDERNAME" ]; +then + echo "Directory $ITMSSCREENSHOTSFOLDERNAME already exists. This might be expected but it might mean old screenshots lying around" +else + echo "Making directory $ITMSSCREENSHOTSFOLDERNAME for the screenshots" + mkdir $ITMSSCREENSHOTSFOLDERNAME +fi diff --git a/screenshots.php b/screenshots.php index 330a850..bd18bcc 100755 --- a/screenshots.php +++ b/screenshots.php @@ -2,13 +2,14 @@ asXML("$screen_shots_dir/metadata.xml"); - echo "Saved updated metadata.xml file to $screen_shots_dir/metadata.xml\n"; + $itmsp_parsed->asXML("$itmsps"); + echo "Saved updated metadata.xml file to $itmsps\n"; } function xmlChunk($display_target, $position, $file_path, $file_name) diff --git a/upload-metadata.sh b/upload-metadata.sh new file mode 100755 index 0000000..2b5b784 --- /dev/null +++ b/upload-metadata.sh @@ -0,0 +1,5 @@ +. environment.sh + +echo "Uploading..." + +iTMSTransporter -m upload -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f "$ITMSFOLDERNAME/$ITMSSKU.itmsp" diff --git a/verify-metadata.sh b/verify-metadata.sh new file mode 100755 index 0000000..5c253be --- /dev/null +++ b/verify-metadata.sh @@ -0,0 +1,9 @@ +. environment.sh + +echo "Ensuring screenshots are in place..." + +cp -v -f "$ITMSSCREENSHOTSFOLDERNAME"/*.png "$ITMSFOLDERNAME/$ITMSSKU.itmsp/" + +echo "Verifying..." + +iTMSTransporter -m verify -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f "$ITMSFOLDERNAME/$ITMSSKU.itmsp" From 8a8886be5bf3971e3691ecb387ee9169de0cb3a8 Mon Sep 17 00:00:00 2001 From: Michael May Date: Tue, 17 Mar 2015 18:19:58 +0000 Subject: [PATCH 2/5] Latest version of the scripts including a new prepare step that puts all the screenshots where they need to be --- .gitignore | 1 + README.md | 23 ++++++++++++++++------- download-metadata.sh | 2 +- environment.sh | 10 ++++++++-- prepare-screenshots.sh | 11 +++++++++++ screenshots.php | 6 +++--- verify-metadata.sh | 4 ---- 7 files changed, 40 insertions(+), 17 deletions(-) create mode 100755 prepare-screenshots.sh diff --git a/.gitignore b/.gitignore index 8d9ba42..c0047e5 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ test-report.xml # ITMS itms/* +environment-local.sh diff --git a/README.md b/README.md index c279ab1..01c6d52 100644 --- a/README.md +++ b/README.md @@ -13,29 +13,38 @@ Open your app in iTunes Connect and create a new version. Ensure your app is lis This will save the .itmsp archive to the directory you specify, defaulting to `./itms/itmsp`. You'll also find a new screenshots directory under there too. #### Step 2 -Take screenshots and save them to this new directory `./itms/screenshots` with the format like +Take screenshots and save them to this new directory `./itms/screenshots-raw` with the format like - > `en-GB___iOS-4-in___portrait___screen1.png` + > `en-GB___iOS-4-in___screen1.png` This is comprised of case sensitive sections delimited by three underscores `___`: - Device: Correct names are (currently) `Mac`, `iOS-3.5-in`, `iOS-4-in`, `iOS-4.7-in`, `iOS-5.5-in` or `iOS-iPad` - - Locale: like `es-ES`, `fr-FR`, `ja-JP`, `en-US`, `en-CA`, `en-GB` **HELP: NEED HELP FULLY DOCUMENTING LOCALE NAMES IN ITMS** + - Locale: like `es-ES`, `fr-FR`, `ja-JP`, `en-US`, `en-CA`, `en-GB`, `en-AU`, `cmn-Hans`, `cmn-Hant` **HELP: NEED HELP FULLY DOCUMENTING LOCALE NAMES IN ITMS** - Orientation: optional (`portrait`) - Screen: screenN where N is the ordering for it when uploaded `(1,2,3,4,5)` - Extension: always use .png Optional: write a UI script and automate generation of screenshots for all devices and localizations using https://github.com/jonathanpenn/ui-screen-shooter Note: if your screenshots are in the format `Locale/Devicename___other.png`, fix this with: `for a in */*; do d=$(dirname $a); f=$(basename $a); mv $a ${d}___${f}; done; rmdir */` +If you are unsure of any country codes, check the `metadata.xml` file that is downloaded in step 1 + +The files can be in subdirectories as they will be flatted in the next step + #### Step 3 -Run `php screenshots.php` – this will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. +Prepare the screenshots you have generated by running the verify script. + +> `prepare-screenshots.sh` + +This will make two copies of your screenshots, both flattened from the `screenshots-raw` version. One in the .itmsp package and one in screenshots. The ones in the package will be uploaded, the ones in screenshots are for the php script to act on. This should be improved to just one dir. #### Step 4 -Verify the content you have generated by running the verify script. +Run `php screenshots.php` – this will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. -> `verify-metadata.sh` +#### Step 5 +Verify the content you have generated can be uploaded by running the verify script. -This will put a copy of all your screenshots inside the itmsp package and then attempt a verify only upload. +> `verify-metadata.sh` Error "software_screenshots cannot be edited in the current state" happens if your app is currently being reviewed. diff --git a/download-metadata.sh b/download-metadata.sh index 49ab8af..4e32734 100755 --- a/download-metadata.sh +++ b/download-metadata.sh @@ -5,4 +5,4 @@ echo "Downloading..." iTMSTransporter -m lookupMetadata -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -destination $ITMSFOLDERNAME echo "itmsp package is now at $ITMSFOLDERNAME" - +echo "Now put your screenshots into $ITMSSCREENSHOTSFOLDERNAME" diff --git a/environment.sh b/environment.sh index 1ce31fa..3111726 100755 --- a/environment.sh +++ b/environment.sh @@ -1,3 +1,9 @@ +if [ -f "environment-local.sh" ]; +then + echo "Using local environment variables in environment-local" + . environment-local.sh +fi + ITMSFOLDERNAME=./itms ITMSSCREENSHOTSFOLDERNAME="$ITMSFOLDERNAME/screenshots" PATH="$PATH:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/" @@ -18,7 +24,7 @@ then read -p "SKU:" ITMSSKU fi -if [ ! -f "$ITMSFOLDERNAME" ]; +if [ -f "$ITMSFOLDERNAME" ]; then echo "Directory $ITMSFOLDERNAME already exists. This might be expected but it might mean old assets lying around" else @@ -26,7 +32,7 @@ else mkdir $ITMSFOLDERNAME fi -if [ ! -f "$ITMSSCREENSHOTSFOLDERNAME" ]; +if [ -f "$ITMSSCREENSHOTSFOLDERNAME" ]; then echo "Directory $ITMSSCREENSHOTSFOLDERNAME already exists. This might be expected but it might mean old screenshots lying around" else diff --git a/prepare-screenshots.sh b/prepare-screenshots.sh new file mode 100755 index 0000000..6635f3d --- /dev/null +++ b/prepare-screenshots.sh @@ -0,0 +1,11 @@ +. environment.sh + +echo "Ensuring screenshots are flattened and in place..." + +ITMSSCREENSHOTSFOLDERRAWNAME="$ITMSSCREENSHOTSFOLDERNAME-raw" +echo "$ITMSSCREENSHOTSFOLDERRAWNAME" + +for i in `find $ITMSSCREENSHOTSFOLDERRAWNAME -name \*.png -print`; do + cp -v -f $i "$ITMSSCREENSHOTSFOLDERNAME/" + cp -v -f $i "$ITMSFOLDERNAME/$ITMSSKU.itmsp/" +done diff --git a/screenshots.php b/screenshots.php index bd18bcc..cf194eb 100755 --- a/screenshots.php +++ b/screenshots.php @@ -8,7 +8,7 @@ # $ITMSFOLDERNAME = "itms"; -$screen_shots_dir = "$ITMSFOLDERNAME"; +$screen_shots_dir = "$ITMSFOLDERNAME/screenshots"; $itmps_dir = "$ITMSFOLDERNAME"; /* @@ -74,8 +74,8 @@ echo "Saved XML chunks of ".count($screen_shots_by_locale_and_device, COUNT_RECURSIVE)." screen shots to $screen_shots_dir/xml_chunks_DEBUG.txt\n"; if (isset($itmsp_parsed)) { - $itmsp_parsed->asXML("$itmsps"); - echo "Saved updated metadata.xml file to $itmsps\n"; + $itmsp_parsed->asXML("$itmsps[0]"); + echo "Saved updated metadata.xml file to $itmsps[0]\n"; } function xmlChunk($display_target, $position, $file_path, $file_name) diff --git a/verify-metadata.sh b/verify-metadata.sh index 5c253be..b8899f2 100755 --- a/verify-metadata.sh +++ b/verify-metadata.sh @@ -1,9 +1,5 @@ . environment.sh -echo "Ensuring screenshots are in place..." - -cp -v -f "$ITMSSCREENSHOTSFOLDERNAME"/*.png "$ITMSFOLDERNAME/$ITMSSKU.itmsp/" - echo "Verifying..." iTMSTransporter -m verify -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f "$ITMSFOLDERNAME/$ITMSSKU.itmsp" From b6af2f53b42b9385cca2b6d089beb14b7a5d3feb Mon Sep 17 00:00:00 2001 From: Michael May Date: Tue, 17 Mar 2015 18:23:07 +0000 Subject: [PATCH 3/5] Tweaked the script to properly detect directories existing or not --- environment.sh | 16 +++++++++++++--- prepare-screenshots.sh | 3 --- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/environment.sh b/environment.sh index 3111726..66dd059 100755 --- a/environment.sh +++ b/environment.sh @@ -5,7 +5,9 @@ then fi ITMSFOLDERNAME=./itms -ITMSSCREENSHOTSFOLDERNAME="$ITMSFOLDERNAME/screenshots" +ITMSSCREENSHOTSFOLDERNAME="$ITMSFOLDERNAME/screenshots/" +ITMSSCREENSHOTSFOLDERRAWNAME="$ITMSSCREENSHOTSFOLDERNAME-raw/" + PATH="$PATH:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/" if [ -z "$ITMSUSER" ]; @@ -24,7 +26,7 @@ then read -p "SKU:" ITMSSKU fi -if [ -f "$ITMSFOLDERNAME" ]; +if [ -d "$ITMSFOLDERNAME" ]; then echo "Directory $ITMSFOLDERNAME already exists. This might be expected but it might mean old assets lying around" else @@ -32,10 +34,18 @@ else mkdir $ITMSFOLDERNAME fi -if [ -f "$ITMSSCREENSHOTSFOLDERNAME" ]; +if [ -d "$ITMSSCREENSHOTSFOLDERNAME" ]; then echo "Directory $ITMSSCREENSHOTSFOLDERNAME already exists. This might be expected but it might mean old screenshots lying around" else echo "Making directory $ITMSSCREENSHOTSFOLDERNAME for the screenshots" mkdir $ITMSSCREENSHOTSFOLDERNAME fi + +if [ -d "$ITMSSCREENSHOTSFOLDERRAWNAME" ]; +then + echo "Directory $ITMSSCREENSHOTSFOLDERRAWNAME already exists. This might be expected but it might mean old screenshots lying around" +else + echo "Making directory $ITMSSCREENSHOTSFOLDERRAWNAME for the screenshots" + mkdir $ITMSSCREENSHOTSFOLDERRAWNAME +fi diff --git a/prepare-screenshots.sh b/prepare-screenshots.sh index 6635f3d..11d167f 100755 --- a/prepare-screenshots.sh +++ b/prepare-screenshots.sh @@ -2,9 +2,6 @@ echo "Ensuring screenshots are flattened and in place..." -ITMSSCREENSHOTSFOLDERRAWNAME="$ITMSSCREENSHOTSFOLDERNAME-raw" -echo "$ITMSSCREENSHOTSFOLDERRAWNAME" - for i in `find $ITMSSCREENSHOTSFOLDERRAWNAME -name \*.png -print`; do cp -v -f $i "$ITMSSCREENSHOTSFOLDERNAME/" cp -v -f $i "$ITMSFOLDERNAME/$ITMSSKU.itmsp/" From 610f19cc27630bbaeab68ba9446870d3fb9cfc11 Mon Sep 17 00:00:00 2001 From: Michael May Date: Tue, 17 Mar 2015 18:28:29 +0000 Subject: [PATCH 4/5] Minor tweak to the README to make it more readable --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 01c6d52..23c4290 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,11 @@ Prepare the screenshots you have generated by running the verify script. This will make two copies of your screenshots, both flattened from the `screenshots-raw` version. One in the .itmsp package and one in screenshots. The ones in the package will be uploaded, the ones in screenshots are for the php script to act on. This should be improved to just one dir. #### Step 4 -Run `php screenshots.php` – this will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. +Generate a new metadata file for the new screenshots. + +> `php screenshots.php` + +This will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. #### Step 5 Verify the content you have generated can be uploaded by running the verify script. From 3f583e1361026af2914300202543bb6f330afa12 Mon Sep 17 00:00:00 2001 From: Michael May Date: Wed, 18 Mar 2015 12:27:08 +0000 Subject: [PATCH 5/5] Various tweaks to make the flow simpler and give hints as to what to do next --- README.md | 13 +++++++++++-- download-metadata.sh | 2 +- environment.sh | 11 +---------- prepare-screenshots.sh | 5 +++-- screenshots.php | 20 +++++--------------- upload-metadata.sh | 2 ++ 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 23c4290..922d5a1 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,15 @@ Prepare the screenshots you have generated by running the verify script. > `prepare-screenshots.sh` -This will make two copies of your screenshots, both flattened from the `screenshots-raw` version. One in the .itmsp package and one in screenshots. The ones in the package will be uploaded, the ones in screenshots are for the php script to act on. This should be improved to just one dir. +This will make a copy of your screenshots, flattened from the `screenshots-raw` version, in the .itmsp package, ready for upload. #### Step 4 Generate a new metadata file for the new screenshots. > `php screenshots.php` -This will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This can be discarded if not needed. +This will add the XML chunks you need and write an updated copy of your `metadata.xml` in the `$ITMSFOLDERNAME` folder. +A copy of what was actually generated will also be written to `xml_chunks_DEBUG.txt`. This DEBUG file can be discarded if not needed. #### Step 5 Verify the content you have generated can be uploaded by running the verify script. @@ -65,6 +66,14 @@ You can modify Xcode schemes to automatically launch your app in a particular lo On top of that, I wanted localized users for my screenshots, so I pass an Environment Variable of "USER_ID", then grab that in my code & setup the user programmatically. You can get Environment Variables via: [[NSProcessInfo processInfo] environment] +You can speed things up by having a file called `environment-local.sh` in which you define the details that you are otherwise prompted for: + +ITMSUSER='myitmsusername' +ITMSPASS='myitmspassword' +ITMSSKU=com.myapp.sku + +All of the shell scripts will use this instead, if available. + ## Heads Up There's a bug in the Transporter that removes newlines from any textual metadata, so I don't recommend using it for that purpose at this time. diff --git a/download-metadata.sh b/download-metadata.sh index 4e32734..b3ec10a 100755 --- a/download-metadata.sh +++ b/download-metadata.sh @@ -5,4 +5,4 @@ echo "Downloading..." iTMSTransporter -m lookupMetadata -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -destination $ITMSFOLDERNAME echo "itmsp package is now at $ITMSFOLDERNAME" -echo "Now put your screenshots into $ITMSSCREENSHOTSFOLDERNAME" +echo "Now put your screenshots into $ITMSSCREENSHOTSFOLDERRAWNAME and run prepare-screenshots.sh" diff --git a/environment.sh b/environment.sh index 66dd059..4a25fa8 100755 --- a/environment.sh +++ b/environment.sh @@ -5,8 +5,7 @@ then fi ITMSFOLDERNAME=./itms -ITMSSCREENSHOTSFOLDERNAME="$ITMSFOLDERNAME/screenshots/" -ITMSSCREENSHOTSFOLDERRAWNAME="$ITMSSCREENSHOTSFOLDERNAME-raw/" +ITMSSCREENSHOTSFOLDERRAWNAME="$ITMSFOLDERNAME/screenshots-raw" PATH="$PATH:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/bin/" @@ -34,14 +33,6 @@ else mkdir $ITMSFOLDERNAME fi -if [ -d "$ITMSSCREENSHOTSFOLDERNAME" ]; -then - echo "Directory $ITMSSCREENSHOTSFOLDERNAME already exists. This might be expected but it might mean old screenshots lying around" -else - echo "Making directory $ITMSSCREENSHOTSFOLDERNAME for the screenshots" - mkdir $ITMSSCREENSHOTSFOLDERNAME -fi - if [ -d "$ITMSSCREENSHOTSFOLDERRAWNAME" ]; then echo "Directory $ITMSSCREENSHOTSFOLDERRAWNAME already exists. This might be expected but it might mean old screenshots lying around" diff --git a/prepare-screenshots.sh b/prepare-screenshots.sh index 11d167f..4e25d51 100755 --- a/prepare-screenshots.sh +++ b/prepare-screenshots.sh @@ -1,8 +1,9 @@ . environment.sh -echo "Ensuring screenshots are flattened and in place..." +echo "Ensuring screenshots are flattened and in place in the package..." for i in `find $ITMSSCREENSHOTSFOLDERRAWNAME -name \*.png -print`; do - cp -v -f $i "$ITMSSCREENSHOTSFOLDERNAME/" cp -v -f $i "$ITMSFOLDERNAME/$ITMSSKU.itmsp/" done + +echo "Now run php screenshots.php to splice in the new screenshots" diff --git a/screenshots.php b/screenshots.php index cf194eb..51f1fa7 100755 --- a/screenshots.php +++ b/screenshots.php @@ -8,9 +8,12 @@ # $ITMSFOLDERNAME = "itms"; -$screen_shots_dir = "$ITMSFOLDERNAME/screenshots"; +# $screen_shots_dir = "$ITMSFOLDERNAME/screenshots"; $itmps_dir = "$ITMSFOLDERNAME"; +$itmsps_dirs = glob("$itmps_dir/*.itmsp"); +$screen_shots_dir=$itmsps_dirs[0]; + /* * STEP 1: INHALE SCREEN SHOTS */ @@ -76,6 +79,7 @@ if (isset($itmsp_parsed)) { $itmsp_parsed->asXML("$itmsps[0]"); echo "Saved updated metadata.xml file to $itmsps[0]\n"; + echo "Now you can run verify-metadata.sh to check it all looks fine\n"; } function xmlChunk($display_target, $position, $file_path, $file_name) @@ -91,17 +95,3 @@ function xmlChunk($display_target, $position, $file_path, $file_name) END; } - - -function translateDevice($device) -{ - if ($device == 'iphone4') { - return 'iOS-3.5-in'; - } elseif ($device == 'iphone5') { - return 'iOS-4-in'; - } elseif ($device == 'ipad') { - return 'iOS-iPad'; - } else { - print "\n\n\n******\n\nWTF $device\n\n\n"; - } -} diff --git a/upload-metadata.sh b/upload-metadata.sh index 2b5b784..3899e15 100755 --- a/upload-metadata.sh +++ b/upload-metadata.sh @@ -3,3 +3,5 @@ echo "Uploading..." iTMSTransporter -m upload -u $ITMSUSER -p $ITMSPASS -vendor_id $ITMSSKU -f "$ITMSFOLDERNAME/$ITMSSKU.itmsp" + +echo "Done!"