Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with https://github.com/rhaining/itc-localized-screenshot-uploader #20

Merged
merged 6 commits into from Jan 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -19,13 +19,13 @@ To run the demonstration, type `./run_screenshooter.sh ~/Desktop/screenshots` to

By default each screenshot is named like so:

en-iphone5-portrait-screen1.png
en-ipad-portrait-screen1.png

The first part is the locale identifier, the second is the device (iphone, iphone5, ipad), the third is the device orientation, and the fourth is an identifier that you choose for each screen shot when you call `captureLocalizedScreenshot()`.
The first part is the locale identifier, the second is the device (iOS-3.5-in, iOS-4-in, iOS-iPad), the third is the device orientation, and the fourth is an identifier that you choose for each screen shot when you call `captureLocalizedScreenshot()`.

## Usage

To use UI Screen Shooter, copy the files (except the Hello World sample app) next to your project files. You may need to change the "Release" build configuration to add i386 to the VALID_ARCHITECTURES for this to work. Then play with the script `automation/shoot_the_screens.js` to simulate the user interaction you want. ((CONTRIBUTORS, PLEASE HELP EXPAND THIS SECTION WITH YOUR INTEGRATION ADVICE.))
To use UI Screen Shooter, copy the files (except the Hello World sample app) next to your project files. You may need to change the "Release" build configuration to add i386 to the VALID_ARCHITECTURES for this to work. Then play with the script `automation/shoot_the_screens.js` to simulate the user interaction you want. ((CONTRIBUTORS, PLEASE HELP EXPAND THIS SECTION WITH YOUR INTEGRATION ADVICE.)) After your screen shots are saved, see https://github.com/rhaining/itc-localized-screenshot-uploader about uploading them in batch to iTunes connect.

## How It Works

Expand Down
8 changes: 4 additions & 4 deletions automation/capture.js
Expand Up @@ -40,10 +40,10 @@ function captureLocalizedScreenshot(name) {
var rect = target.rect();

if (model.match(/iPhone/)) {
if (rect.size.height > 480) model = "iphone5";
else model = "iphone";
if (rect.size.height > 480) model = "iOS-4-in";
else model = "iOS-3.5-in";
} else {
model = "ipad";
model = "iOS-iPad";
}

var orientation = "portrait";
Expand All @@ -53,5 +53,5 @@ function captureLocalizedScreenshot(name) {
preferencesValueForKey("AppleLanguages")[0];

var parts = [language, model, orientation, name];
target.captureScreenWithName(parts.join("-"));
target.captureScreenWithName(parts.join("+"));
}
16 changes: 9 additions & 7 deletions ui-screen-shooter.sh
Expand Up @@ -27,13 +27,15 @@ set -e
destination="$1"

# The locale identifiers for the languages you want to shoot
languages="en_US fr ja"
# Use the format like en-US cmn-Hans for filenames compatible with iTunes
# connect upload tool
languages="en-US cmn-Hans"

# The iOS version we want to run the script against
ios_version="7.0"

# The iOS devices we want to run, can include: iphone4 iphone5 ipad
ios_devices="iphone4 iphone5 ipad"
# The iOS devices we want to run, can include: iOS-3.5-in, iOS-4-in and/or iOS-iPad
ios_devices="iOS-3.5-in iOS-4-in iOS-iPad"

function main {
_check_destination
Expand All @@ -47,21 +49,21 @@ function main {
# We have to build and explicitly set the device family because otherwise
# Instruments will always launch a universal app on the iPad simulator.

if [[ "$ios_devices" == *iphone* ]]
if [[ "$ios_devices" == *in* ]]
then
_xcode clean build TARGETED_DEVICE_FAMILY=1
if [[ "$ios_devices" == *iphone4* ]]
if [[ "$ios_devices" == *3.5-in* ]]
then
bin/choose_sim_device "iPhone Retina (3.5-inch)" $ios_version
_shoot_screens_for_all_languages
fi
if [[ "$ios_devices" == *iphone5* ]]
if [[ "$ios_devices" == *4-in* ]]
then
bin/choose_sim_device "iPhone Retina (4-inch)" $ios_version
_shoot_screens_for_all_languages
fi
fi
if [[ "$ios_devices" == *ipad* ]]
if [[ "$ios_devices" == *iPad* ]]
then
_xcode build TARGETED_DEVICE_FAMILY=2
bin/choose_sim_device "iPad Retina" $ios_version
Expand Down