xcodebuild: Deploy iOS app from Command Line

Shashikant Jagtap
Jun 4, 2017 · 6 min read
Image for post
Image for post

Pre-requisite

Analysing

$ xcodebuild -project CLI.xcodeproj -scheme CLI -sdk iphonesimulator10.3 clean analyze

Building

build for running

$ xcodebuild -scheme CLI -workspace CLI.xcworkspace/ build

build for testing

$ xcodebuild build-for-testing -workspace CLI.xcworkspace -scheme
CLI -destination generic/platform=iOS

Testing

$ xcodebuild -scheme CLI -workspace CLI.xcworkspace/ test

test-without-building

$ xcodebuild test-without-building -workspace CLI.xcworkspace
-scheme CLI -destination 'platform=iOS
Simulator,name=iPhone 7' -destination
'platform=iOS,name=My iPad'

Archiving

$ xcodebuild -workspace CLI.xcworkspace \
-scheme CLI \
-destination generic/platform=iOS build
$ xcodebuild -workspace CLI.xcworkspace -scheme CLI -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/CLI.xcarchive
$ xcodebuild -exportArchive -archivePath $PWD/build/CLI.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>YOUR_TEN_CHARACTER_TEAM_ID</string>
</dict>
</plist>

Uploading IPA to iTunes Connect

/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool
$ altool --upload-app -f "CLI.ipa" -u $USERNAME -p $PASSWORD

What Next

Image for post
Image for post
XCTEQ Limited: Mobile DevOps, CI/CD and Automation

XCBlog

P.S:

Shashikant Jagtap

Written by

All the posts published on this channel before I joined Apple. Thanks for being a reader of XCBlog. Web: shashikantjatap.net, xcteq.co.uk

XCBlog

XCBlog

P.S: All the posts from this publication are published before author Shashikant Jagtap joined Apple. Thank you so much for being a reader of XCBlog. Tech Blog about DevOps, CI/CD for  Platforms. Xcode Server, XCTest, SwiftPM, Server Side Swift, XCUITest etc.

Shashikant Jagtap

Written by

All the posts published on this channel before I joined Apple. Thanks for being a reader of XCBlog. Web: shashikantjatap.net, xcteq.co.uk

XCBlog

XCBlog

P.S: All the posts from this publication are published before author Shashikant Jagtap joined Apple. Thank you so much for being a reader of XCBlog. Tech Blog about DevOps, CI/CD for  Platforms. Xcode Server, XCTest, SwiftPM, Server Side Swift, XCUITest etc.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store