Automate iOS Deployment with Hamper and Schezhen
-
Upload
kiran-panesar -
Category
Software
-
view
154 -
download
0
Transcript of Automate iOS Deployment with Hamper and Schezhen
A U T O M AT I N G I O S D E P L O Y M E N TK I R A N PA N E S A R @ K _ PA N E S A R
I ’ M T H E C T O O F M O B I L E X L A B S , A N D W E M A K E N AT I V. C O M .
W E ’ R E I N B E TA . B E N I C E .K I R A N @ M O B I L E X L A B S . C O M
I O S A U T O M AT I O N I S G R E AT.
xcodebuild - Jenkins - ios-sim - UIAutomation - TestFlight’s API - etc
T H I S M A K E S I O S D E V E L O P M E N T FA S T A N D F U N !
B U T , W H AT A B O U T D E P L O Y M E N T ?
1. Sign into the Provisioning Portal.
2. Create an app ID.
3. Create a distribution certificate.
4. Install distribution certificate.
5. Create provisioning profile.
6. Download and install profile.
7. Fight with Xcode’s profile management for some time.
8. Tell Xcode to use the profile for distribution.
9. Build.
10. Export archive.
11. Upload to TestFlight, App Store, HockeyApp, etc.
( D E L I B E R AT E LY S M A L L )
T H I S M A K E S I O S D E V E L O P M E N T S L O W A N D D U L L .
– Y O U
I D O N ’ T D O T H I S V E RY O F T E N . W H Y D O I C A R E ?
P E O P L E D O N ’ T C A R E E N O U G H A B O U T I T. B U T T H E Y A LWAY S C O M P L A I N .
T H I S I S A R E A L P R O B L E M F O R U S .
N O P R O V I S I O N I N G P O RTA L A P I .
S O W H AT ? B U I L D O N E .
I N T R O D U C I N G H A M P E R .G I T H U B . C O M / M O B I L E X L A B S / H A M P E R
A C O M M A N D L I N E I N T E R FA C E F O R I O S P R O V I S I O N I N GG I T H U B . C O M / M O B I L E X L A B S / H A M P E R
H O W D O E S I T W O R K ?
Python, Selenium, PhantomJS
W H AT C A N I T D O ?
• Authentication.
• App ID registration.
• Certificate generation.
• Provisioning profile creation.
I N S TA L L AT I O N
brew install phantomjs...sudo pip install hampercli
S T RU C T U R E
hamper <module> <verb> --<argument> <value>
L E T ’ S S E E W H AT I T C A N D O .
S I G N I N
hamper auth login --email [email protected] --password passwdAuthenticating user...User successfully authenticated.
(Password stored in the device’s keychain for future requests)
A P P I D R E G I S T R AT I O N
hamper identifier create --app_name MyApp --bundle_id com.mxl.new_app
Generating app ID...App ID successfully generated.
C E RT I F I C AT E G E N E R AT I O N
hamper cert create distribution --csr_path /request.csr --cert_path /out.cer --bundle_id com.mxl.new_app
...Generating certificate (this could take a minute)...Certificate successfully generated.Downloading certificate (this could take a minute)...Certificate successfully downloaded (/Users/kiran/out.cer).
openssl genrsa -out private.key 2048openssl req -new -key private.key -out request.csr
Using openssl to generate key and CSR
Generate a certificate
P R O V I S I O N I N G P R O F I L E C R E AT I O N
...Waiting for Apple to generate profile (this could take a minute)...Provisioning profile successfully generated.Downloading provisioning profile...Profile successfully downloaded (/Users/kiran/p.mobileprovision).
hamper profile create app_store --name MyApp_Production --bundle_id com.kp.my_app --profile_path p.mobileprovision --exp_day 20 --exp_month 04 --exp_year 2015
– Y O U
W H AT C A N I D O W I T H T H I S ?
T O T H E A P P S T O R E !
Using Hamper with Shenzhen (Mattt Thompson)
R E G I S T E R A N A P P
hamper identifier create --app_name MyApp --bundle_id com.mxl.new_app
Generating app ID...App ID successfully generated.
G E N E R AT E T H E P R O F I L E
Waiting for Apple to generate profile (this could take a minute)...Provisioning profile successfully generated.Downloading provisioning profile...Profile successfully downloaded (/Users/kiran/p.mobileprovision).
hamper profile create app_store --name MyApp_Production --bundle_id com.mxl.new_app --profile_path p.mobileprovision --exp_day 20 --exp_month 04 --exp_year 2015
I N S TA L L T H E P R O F I L E
uuid=`grep UUID -A1 -a p.mobileprovision | grep -io "[-A-Z0-9]\{36\}"`
cp p.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
H O L D O N T O T H AT U U I D , W E ’ R E G O I N G T O N E E D I T I N T H E N E X T S T E P
B U I L D A N D A R C H I V Excodebuild archive -workspace my_app.xcworkspace
-scheme MyApp -archivePath output.xcarchive PROVISIONING_PROFILE=$uuid
xcodebuild -exportArchive -archivePath output.xcarchive -exportPath ./ -exportFormat ipa -exportProvisioningProfile p.mobileprovision
U P L O A D !
ipa distribute:itunesconnect -a [email protected] -p passwd -i 234234235 --upload
U S I N G S H E N Z H E N
W H AT ’ S N E X T ?
• Prompting interface.
• Integration with openssl to generate CSRs.
• Integration with iTunes Connect to create an app, fill out metadata.
• General reliability improvements.
B E C A U S E I T ’ S I N B E TA .
T H A N K S !G I T H U B . C O M / M O B I L E X L A B S / H A M P E R
K I R A N PA N E S A RE N G I N E E R I N G . M O B I L E X L A B S . C O M
@ K _ PA N E S A R
K I R A N @ M O B I L E X L A B S . C O M