Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTunes Application Loader - automation

Since recently Apple changed the iTunes Connect interface, and people are required to upload apps with the Application Loader.

That's nice but I need a script for automating my work.

How can an app like App Loader be automated?

I was thinking of something written in AppleScript ... but I don't know what actions it exposes (if any). Found somewhere that I could also do GUI scripting from within AppleScript, but I can't find docs on that.

What I need ... some way to trigger input actions (mouse clicks / keyboard input) and read the text from the various controls displayed.

If that would be possible in Python/Ruby it would be great, but AppleScript is fine.

OS X is version 10.6.4.

Any suggestions are appreciated.

Thanks,

like image 399
Alexandru Nedelcu Avatar asked Aug 10 '10 14:08

Alexandru Nedelcu


People also ask

What is Apple Application loader?

Application Loader is a developer tool (part of Xcode) that uploads apps to the Mac/iOS App Stores for sale.

What does Application Loader do?

Application loaders are expected to instantiate all parts of an application, wiring everything together. They may be manually implemented, if compile time wiring is preferred, or core/third party implementations may be used, for example that provide a runtime dependency injection framework.


2 Answers

You can use any of these commands either one by one or all in one bash script to actually automate your Archive, Extract and Upload process to the AppStore Connect.

ARCHIVE

xcodebuild -workspace "${APP_NAME}.xcworkspace" -scheme "${APP_NAME}" clean archive -configuration release -sdk iphoneos -archivePath ".build/${TEMP_BUILD}.xcarchive"

EXPORT TO IPA

xcodebuild -exportArchive -archivePath  ".build/${TEMP_BUILD}.xcarchive" -exportOptionsPlist  "ExportOptions.plist" -exportPath  ".build/${TEMP_BUILD}.ipa"

UPLOAD IPA TO TESTFLIGHT

altool --upload-app -f ".build/${TEMP_BUILD}.ipa/${APP_NAME}.ipa" -u $APP_STORE_USERNAME -p $APP_STORE_PASSWORD

1) If you don't know what should be your ExportOptions.plist file just take a look here.

2) To use altool from anywhere in the terminal you could add it to your PATH env variable by typing in terminal:

MacBook-Pro:~ denis$ export PATH=$PATH:/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/
MacBook-Pro:~ denis$ source ~/.bash_profile
like image 101
denis_lor Avatar answered Oct 27 '22 02:10

denis_lor


Application Loader documentation mentions an altool which can be used for this purpose. (https://itunesconnect.apple.com/docs/UsingApplicationLoader.pdf)

The relevant information:

You can use altool, Application Loader’s command-line tool for validating and uploading your application binary files to the App Store.

To validate your build before upload or to automate uploads of valid builds to the App Store, you can include altool in your continuous integration systems. altool is located in the Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/ folder. (So full path would be /Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool)

To run altool, specify one of the following at the command-line:

$ altool --validate-app -f file -u username [-p password] [--output-format xml]

$ altool --upload-app -f file -u username [-p password] [--output-format xml]

Where:

--validate-app Specifies you want to validate the specified application.

--upload-app Specifies you want to upload the specified application.

-f file Specifies the path and filename for the application you are validating or uploading.

-u username Specifies your username (Apple ID).

-p password Specifies your user password.

--output-format [xml | normal] Specifies that you want Application Loader to return output in structured XML format or unstructured text format. By default, Application Loader returns output information in text format.

like image 44
Chad Stewart Avatar answered Oct 27 '22 02:10

Chad Stewart