Mobile delivery with a devops mindset - Craftsconf edition

109
Mobile Continuous Delivery with a devops mindset @patrickdebois http://dotcomplicated.co/content/wp-content/uploads/mobile-devices.jpg

Transcript of Mobile delivery with a devops mindset - Craftsconf edition

Page 1: Mobile delivery with a devops mindset  - Craftsconf edition

MobileContinuous

Deliverywith a devops mindset

@patrickdebois

http://dotcomplicated.co/content/wp-content/uploads/mobile-devices.jpg

Page 2: Mobile delivery with a devops mindset  - Craftsconf edition

LIVE RESULTSINTERACTION MODERATIONSTUDIO CONTROLPART OF THE SHOW

Page 3: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

4 areas of improvement

Page 4: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 1: Extend delivery to production

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 5: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 6: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

Area 3: Embed Projectknowledge into Operations

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 7: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 4: Embed Operations knowledge into Project

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

Area 3: Embed Projectknowledge into Operations

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 8: Mobile delivery with a devops mindset  - Craftsconf edition

TOOLS

DEVOPS

Page 9: Mobile delivery with a devops mindset  - Craftsconf edition

CI Pipeline

Page 10: Mobile delivery with a devops mindset  - Craftsconf edition

MAC OSX CIavoid it works on my machine

https://circleci.com/

https://travis-ci.com/http://www.objc.io/issue-6/travis-ci.html

https://hosted-ci.com/

Page 11: Mobile delivery with a devops mindset  - Craftsconf edition

SDK INSTALLATION

http://stackoverflow.com/questions/8649874/how-do-i-automate-the-installation-of-xcode

Page 12: Mobile delivery with a devops mindset  - Craftsconf edition

SETUP IOS KEYS

Page 13: Mobile delivery with a devops mindset  - Craftsconf edition

DEPENDENCIES

Page 14: Mobile delivery with a devops mindset  - Craftsconf edition

DIFFERENT ENVIRONMENTSvisual cues

Page 15: Mobile delivery with a devops mindset  - Craftsconf edition

BUILD CONFIGS

Page 16: Mobile delivery with a devops mindset  - Craftsconf edition

READABLE BUILDScompact output with xctool

https://github.com/facebook/xctoolhttps://github.com/supermarin/xcpretty

Page 17: Mobile delivery with a devops mindset  - Craftsconf edition

STATIC CODE ANALYSIS

http://clang-analyzer.llvm.org/http://oclint.org/

https://gist.github.com/rciovati/8461832

https://codeascraft.com/2014/01/15/static-analysis-with-oclint/http://fbinfer.com/

Page 18: Mobile delivery with a devops mindset  - Craftsconf edition

MOBILE SECURITY

http://dexter.dexlabs.org/

Page 19: Mobile delivery with a devops mindset  - Craftsconf edition

BATTERY & RESOURCES

http://developer.att.com/ARO

Page 20: Mobile delivery with a devops mindset  - Craftsconf edition

DISTRIBUTE BUILDScrashlytics , hockeyapp, testfairy , …

Page 21: Mobile delivery with a devops mindset  - Craftsconf edition

DEVICE UDIDmobile provisioning profiles

http://whatsmyudid.com/

Page 22: Mobile delivery with a devops mindset  - Craftsconf edition

ADHOC BUILDSshenzen

https://github.com/nomad/shenzhen

Page 23: Mobile delivery with a devops mindset  - Craftsconf edition

DEVICE MGMTcupertino

https://github.com/nomad/Cupertino

Page 24: Mobile delivery with a devops mindset  - Craftsconf edition

DEMYSTIFY PROVISION PROFILES

cd ~/Library/MobileDevice/Provisioning\ Profiles/

/usr/libexec/PlistBuddy -c 'Print DeveloperCertificates:4' /dev/stdin \

<<< $(security cms -D -i \

3a4f7c6e-4af6-4924-a267-d9ec8e6aab75.mobileprovision)\

| openssl x509 -subject -inform der -noout -text

Page 25: Mobile delivery with a devops mindset  - Craftsconf edition

TEST APPSkeep testers up to date

Page 26: Mobile delivery with a devops mindset  - Craftsconf edition

TEST FEEDBACKmake giving feedback easy & consistent

https://github.com/DZamataev/TestFlightFeedback

Page 27: Mobile delivery with a devops mindset  - Craftsconf edition

APPS IN BROWSERsimulator builds

https://appetize.io/https://app.io/

Page 28: Mobile delivery with a devops mindset  - Craftsconf edition

RECORD SESSIONSSeeing is believing

Page 29: Mobile delivery with a devops mindset  - Craftsconf edition

SCENARIO TESTINGcross technology testing

http://appium.io/

Page 30: Mobile delivery with a devops mindset  - Craftsconf edition

ACCESIBILITY LABELSunique ids for targeting UI elements

#pragma mark - Accessibility

- (void)addAccessibility:(UIView*)view label:(NSString*)label { view.accessibilityLabel = label; [view setIsAccessibilityElement:YES]; }

- (void)addAccessibility:(UIView*)view label:(NSString*)label value:(NSString*)value { // Set accessibility programmatically // because adding it to the UserInterface Storyboard doesn't allow you to set the value for Appium [self addAccessibility:view label:label]; view.accessibilityValue = value; }

<com.blokken.views.HomeTVGameButton android:id="@+id/button_tvspel" android:layout_margin="1dp" android:contentDescription = "TV SPEL" android:layout_width="@dimen/button_home_size_big" android:layout_height="@dimen/button_home_size_big" android:layout_column="2" /> </TableRow>

Page 31: Mobile delivery with a devops mindset  - Craftsconf edition

BEHAVIOURtesting / selenium style

Page 32: Mobile delivery with a devops mindset  - Craftsconf edition

SIMULATORSyou just can’t get enough (speed)

http://www.andyroid.net/#producthttps://www.manymo.com/emulators

https://www.genymotion.com/#!/

Page 33: Mobile delivery with a devops mindset  - Craftsconf edition

DEVICE IN A (VIRTUAL) BOXno test excuses

https://github.com/psde/aosp-dockerhttps://plus.google.com/+BradFitzpatrick/posts/CmqtqAShWZJ

https://github.com/jkingyens/docker4xcodehttp://hackersome.com/p/dockerparis/android-test-cluster

Page 34: Mobile delivery with a devops mindset  - Craftsconf edition

DEVICE FARMS

Page 35: Mobile delivery with a devops mindset  - Craftsconf edition

LOCAL DEVICE CLOUD

http://mobilelabsinc.com/

Page 36: Mobile delivery with a devops mindset  - Craftsconf edition

REAL DEVICESdoes it even start?

Page 37: Mobile delivery with a devops mindset  - Craftsconf edition

INTERACTIVE DEVICE

Page 38: Mobile delivery with a devops mindset  - Craftsconf edition

DEBUG TRAFFIC

https://github.com/facebook/stetho

IOS

ANDROID

https://github.com/square/PonyDebugger

Page 39: Mobile delivery with a devops mindset  - Craftsconf edition

http://www.charlesproxy.com/documentation/proxying/throttling/

Page 40: Mobile delivery with a devops mindset  - Craftsconf edition

CLI IOS-DEPLOYlook no UI mama

https://github.com/phonegap/ios-deploy

Page 41: Mobile delivery with a devops mindset  - Craftsconf edition

CLI HELP IOS

http://www.libimobiledevice.org/

https://github.com/phonegap/ios-sim

Page 42: Mobile delivery with a devops mindset  - Craftsconf edition

RE-SIGNbuild only once

https://gist.github.com/mediabounds/1367348

Page 43: Mobile delivery with a devops mindset  - Craftsconf edition

PUBLISH TO PLAYSTORE

https://github.com/Triple-T/gradle-play-publisher

Page 44: Mobile delivery with a devops mindset  - Craftsconf edition

IOS AUTOMATIONnot so official apple API

https://fastlane.tools/

Page 45: Mobile delivery with a devops mindset  - Craftsconf edition

CheckoutCode

& Metadata

InstallDependencies

UseCorrect

Build Settings

Build the executable

Setup keys& certificates

Sign the App

InstallTooling

Distribute tointernal

developers

Find matchingOS Machine

InstallSDK/Tools

Run tests

Distribute tointernaltesters

Distribute to external testers

(releasecandidates)

Promote to Public

LimitedSet of Devices

(staging)(master)

Simulator

LimitedSet of Devices(production)

(release)

Code Analysis

Test Cloudon Real Devices

Distribute internal

beta Appstore

Manage Tester List

Master branch

Release branch

Staging Build

Production build

Appstore build

Build

Promote

Page 46: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 1: Extend delivery to production

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 47: Mobile delivery with a devops mindset  - Craftsconf edition

Going Live

Page 48: Mobile delivery with a devops mindset  - Craftsconf edition

METRICScustomer focused

Page 49: Mobile delivery with a devops mindset  - Craftsconf edition

APP METRICS

https://fabric.io/

Page 50: Mobile delivery with a devops mindset  - Craftsconf edition

NETWORK ERRORSQuisque fringilla est eget arcu tindidunt

http://newrelic.com/mobile-monitoring/features

Page 51: Mobile delivery with a devops mindset  - Craftsconf edition

MOBILE MONITORINGit’s just another device

Page 52: Mobile delivery with a devops mindset  - Craftsconf edition

LOG ERRORios, android , web , backend, …

Page 53: Mobile delivery with a devops mindset  - Craftsconf edition

LOG DEBUGtagging log lines

Page 54: Mobile delivery with a devops mindset  - Craftsconf edition

LOGGING IOS != NSLOG

Page 55: Mobile delivery with a devops mindset  - Craftsconf edition

READ IOS LOGS

https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man3/asl.3.html

Page 56: Mobile delivery with a devops mindset  - Craftsconf edition

READ LOGS ANDROID

http://stackoverflow.com/questions/12692103/read-logcat-programmatically-within-application

Page 57: Mobile delivery with a devops mindset  - Craftsconf edition

TWITTER FEEDBACKwatch social media

Page 58: Mobile delivery with a devops mindset  - Craftsconf edition

RATINGSuser feedback android

Page 59: Mobile delivery with a devops mindset  - Craftsconf edition

APPSTOREautomated feedback

https://launchkit.io/reviews

Page 60: Mobile delivery with a devops mindset  - Craftsconf edition

CAPTURE FEEDBACKbefore they tell it in the App Store

Page 61: Mobile delivery with a devops mindset  - Craftsconf edition

FRESHDESK

http://freshdesk.com/

Page 62: Mobile delivery with a devops mindset  - Craftsconf edition

CONVERSATIONbecause email sucks

Page 63: Mobile delivery with a devops mindset  - Craftsconf edition

NOTIFICATIONSinform the users

https://appbot.co/appbotx/getstarted

Page 64: Mobile delivery with a devops mindset  - Craftsconf edition

SUPPORT FAQdon’t repeat yourself

Page 65: Mobile delivery with a devops mindset  - Craftsconf edition

REVIEW PROMPTShappy customer reviews

Page 66: Mobile delivery with a devops mindset  - Craftsconf edition

VERSION DRIFT

https://github.com/ArtSabintsev/Harpy

Page 67: Mobile delivery with a devops mindset  - Craftsconf edition

“SHARE SCREEN”

https://watchsend.com/install

www.hotjar.com

Page 68: Mobile delivery with a devops mindset  - Craftsconf edition

TEAM CHANNEL ++communicate all the things

Page 69: Mobile delivery with a devops mindset  - Craftsconf edition

END USER

APP APPSTORE

Social Media

SUPPORT

AnonymousPublic

User LoginNo device details

User LoginAll device details

Logging

BACKEND

FEEDBACK

FAQ/Ticket system

Record both App & Backend Activity

Correlate JSON Logs using e-mail, device-id, customer-id

CONFIG

FF_ENABLE_DEBUG(enable debug if needed)

IN APPFeedback

FF_RECORD_SESSION(capture more visual feedback)

FF_USE_STATIC_FAQ(switch to just a faq page)

'Live'-Chat

Re-directHappy Customers

Fetch Settings(per user/group/device)

+- Low Memory- API Errors- Warnings- Device Logs

FF_DEBUG_LEVEL(increase debug if needed)

Metrics

Crash Reports

WEBSITE

Page 70: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 71: Mobile delivery with a devops mindset  - Craftsconf edition

AppstoreApproval

Page 72: Mobile delivery with a devops mindset  - Craftsconf edition

REVIEW TIMES

Page 73: Mobile delivery with a devops mindset  - Craftsconf edition

EXPEDITEuse with care https://developer.apple.com/contact/app-store/?topic=expedite

Page 74: Mobile delivery with a devops mindset  - Craftsconf edition

IOSAPP

USEFEATURE FLAGS

No submit needed(if it does not change the app purpose drastically)

SWIZZLINGREMOTE NSBUNDLEUSE WEBVIEW

Pre-defined behaviorchange

Dynamic behaviorchange

= hooking into functionsand it's response

Download Contentto local Documents

Load Assets from Local Bundle

ImagesLocalesSettings

XIB/NIBS

Also possible to embedCordova Webview

Use bridge to communicatewith native

REMOTECONTENT

Expect internet connectivity

Cache Image Assets

OpenGL issues

Notify users of newapp version

TO SUBMIT OR NOT TO SUBMIT

Submit(code changes & extended new app behaviour)

Page 75: Mobile delivery with a devops mindset  - Craftsconf edition
Page 76: Mobile delivery with a devops mindset  - Craftsconf edition

IMAGE DELIVERYhttps://www.imgix.com/

Page 77: Mobile delivery with a devops mindset  - Craftsconf edition

REMOTE CONFIGchange settings with new submit to App Store

https://github.com/gangverk/Android-RemoteConfighttps://github.com/mattt/GroundControl

Page 78: Mobile delivery with a devops mindset  - Craftsconf edition

LOCALIZATION

https://github.com/joytunes/JTLocalize

Page 79: Mobile delivery with a devops mindset  - Craftsconf edition

UI CONTROLcontrol all text & images from the backend

Page 80: Mobile delivery with a devops mindset  - Craftsconf edition

CROSSWALKQuisque fringilla est eget arcu tindidunt

https://crosswalk-project.org/

Page 81: Mobile delivery with a devops mindset  - Craftsconf edition

JOCKEY.JS https://github.com/tcoulter/jockeyjs

Page 82: Mobile delivery with a devops mindset  - Craftsconf edition

CORDOVA/PHONEGAP

http://docs.phonegap.com/en/3.5.0/guide_platforms_ios_webview.md.html#iOS%20WebViews

Page 83: Mobile delivery with a devops mindset  - Craftsconf edition

REMOTE BUNDLEhttps://github.com/sirnicolaz/NMRemoteBundle

Compile Xib & Storyboard

Image from Remote Bundle

Storyboard from Remote Bundle

XIB from Remote Bundle

Page 84: Mobile delivery with a devops mindset  - Craftsconf edition

https://facebook.github.io/react-native/

Page 85: Mobile delivery with a devops mindset  - Craftsconf edition

DETAIL CRASH

Page 86: Mobile delivery with a devops mindset  - Craftsconf edition

CRASH REPORTSlink to user ID

Page 87: Mobile delivery with a devops mindset  - Craftsconf edition

LIVE PATCHswizzling

https://www.rollout.io/http://nshipster.com/method-swizzling/

Page 88: Mobile delivery with a devops mindset  - Craftsconf edition

LIVE PATCHswizzling

http://nshipster.com/method-swizzling/

Page 89: Mobile delivery with a devops mindset  - Craftsconf edition

FASTERRRRRR

Page 90: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

Area 3: Embed Projectknowledge into Operations

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 91: Mobile delivery with a devops mindset  - Craftsconf edition

Improve the Business

Page 92: Mobile delivery with a devops mindset  - Craftsconf edition

USER ACTIONShow do they use the app

http://heapanalytics.com

Page 93: Mobile delivery with a devops mindset  - Craftsconf edition

RECORD HEATMAPSwhere do they click

http://appsee.com

Page 94: Mobile delivery with a devops mindset  - Craftsconf edition

FLIGHTRECORDER

http://flightrecorder.io/

Page 95: Mobile delivery with a devops mindset  - Craftsconf edition

FLOWsee what features are used

Page 96: Mobile delivery with a devops mindset  - Craftsconf edition

RANKINGkeep track

https://www.appannie.com/

Page 97: Mobile delivery with a devops mindset  - Craftsconf edition

RETENTIONwho returns?

Page 98: Mobile delivery with a devops mindset  - Craftsconf edition

APPSTORE SEO

Page 99: Mobile delivery with a devops mindset  - Craftsconf edition

APP ICON/NAME A/B TESTING

Page 100: Mobile delivery with a devops mindset  - Craftsconf edition

A/B TEST STORE LISTING

Page 101: Mobile delivery with a devops mindset  - Craftsconf edition

ALL CHANNELSgo where your users are

https://www.appboy.com/products

Page 102: Mobile delivery with a devops mindset  - Craftsconf edition

A/B TESTINGscience not gut feeling

http://apptimize.com/product

Page 103: Mobile delivery with a devops mindset  - Craftsconf edition

APP FIGURES

Page 104: Mobile delivery with a devops mindset  - Craftsconf edition

OPSDEV

Area 4: Embed Operations knowledge into Project

Area 2: Extend operations feedback to project

Area 1: Extend delivery to production

Area 3: Embed Projectknowledge into Operations

http://www.jedi.be/blog/2012/05/12/codifying-devops-area-practices/

Page 105: Mobile delivery with a devops mindset  - Craftsconf edition

S3 (Storage)

Cognito (Login)

Mobile Hub (Analytics)

Cognito Sync (Settings)

DynamoDB (Database)

Lambda (Async/Sync API)

API Gateway (Proxy)

Kinesis (Logging)

Elastic search (Search)

SNS (Push & Email)

Page 106: Mobile delivery with a devops mindset  - Craftsconf edition

(Storage)

(Login)

(Analytics)

(Settings)

(Database)

(Async/Sync API)

(Proxy) (Logging)

(Search)

(Push & Email)

Page 107: Mobile delivery with a devops mindset  - Craftsconf edition
Page 108: Mobile delivery with a devops mindset  - Craftsconf edition

Next up , IOT ?