mobile developments at exo
DESCRIPTION
Tools and processes used at eXo to develop our mobile applications (iOS & Android) including continuous integration and deployment. Tips and tricks to setup all the infrastructure involved in them.TRANSCRIPT
![Page 1: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/1.jpg)
Mobile Development Tools and Practices
Arnaud HéritiereXo Platform@aheritier
Wednesday, December 14, 11
![Page 2: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/2.jpg)
Our Motivation
• Observations
• eXo Mobile division had many difficulties to stabilize applications (build failures, dependencies to the development environment ...),
• Functional and technical feedbacks were very limited because the deployment/update process was complex for testers / early adopters.
Wednesday, December 14, 11
![Page 3: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/3.jpg)
Our Motivation
• Prescription
• Continuous build and deployment of mobile applications (iOS, Android)
• to speedup the feedback loop
• to increase the number of testers / early adopters
• to increase the quality and the stability of these applications.
Wednesday, December 14, 11
![Page 4: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/4.jpg)
Our Motivation
• CI wasn't easy to setup the first time, especially for iOS. The experience is worth being shared.
Wednesday, December 14, 11
![Page 5: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/5.jpg)
Webinar Schedule
• The development environment
• Setup the continuous integration
• Setup the continuous deployment
Wednesday, December 14, 11
![Page 6: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/6.jpg)
Environment overviewWednesday, December 14, 11
![Page 7: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/7.jpg)
The Development Environment for iOS
Wednesday, December 14, 11
![Page 8: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/8.jpg)
iOS Development Toolbox
• Xcode
• http://developer.apple.com/xcode/
Wednesday, December 14, 11
![Page 9: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/9.jpg)
Setup a Development Environment for iOS
• Apple documentation
• http://goo.gl/Ge13t
• The most important part is to register your Apple developer account and to correctly set your code signing identity
Wednesday, December 14, 11
![Page 10: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/10.jpg)
CertificatesWednesday, December 14, 11
![Page 11: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/11.jpg)
ProvisioningWednesday, December 14, 11
![Page 12: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/12.jpg)
Setup a Development
Environment for iOS
The developer can spend the major part of the day in Xcode and the emulator as long as the code is regularly committed in
the SCM
Wednesday, December 14, 11
![Page 13: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/13.jpg)
The Development Environment for
Android
Wednesday, December 14, 11
![Page 14: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/14.jpg)
• Java JDK
• http://www.oracle.com/technetwork/java/javase/downloads/index.html
• Android SDK
• http://developer.android.com/sdk
• Eclipse 3.7 IDE for Java Developers
• http://eclipse.org
• Apache Maven
• http://maven.apache.org/
Android Development Toolbox
Wednesday, December 14, 11
![Page 15: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/15.jpg)
Setup a Development Environment for Android• Installation
• Java JDK
• Android SDK
• Don’t forget to set the ANDROID_HOME environment variable
• Maven 3.0.3 min
• Required by the 3.0 version of the android plugin
• Eclipse
• Use Java Developers edition with its Maven integration (m2e)
• Don’t forget to configure your Maven and ADT paths in eclipse settings.
Wednesday, December 14, 11
![Page 16: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/16.jpg)
Maven installation path to use in eclipse
Wednesday, December 14, 11
![Page 17: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/17.jpg)
ADK installation path to use in eclipse
Wednesday, December 14, 11
![Page 18: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/18.jpg)
Maven POM for an Android Project
• Packaging = apk
• Uses the plugin com.jayway.maven.plugins.android.generation2:android-maven-plugin
• version 3.0.0 min
• manifest-update goal bound to the phase process-resources
Wednesday, December 14, 11
![Page 19: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/19.jpg)
Setup a Development Environment for Android• Just import your Maven/APK project in eclipse with m2e.
• M2e and its market place will automatically install and configure the Android extension in eclipse
• You’ll be able to manage your project dependencies with Apache Maven
• You don’t have to explicitly use Maven in your development process. M2e does the necessary to hide it.
• Manage your Android project with Apache Maven
• http://www.sonatype.com/books/mvnref-book/reference/android-dev.html
• http://code.google.com/p/maven-android-plugin/
Wednesday, December 14, 11
![Page 20: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/20.jpg)
Maven POM for an android
project
Wednesday, December 14, 11
![Page 21: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/21.jpg)
Setup a Development
Environment for Android
The developer can spend the major part of the day in Eclipse and the emulator as long as the code is regularly committed in
the SCM
Wednesday, December 14, 11
![Page 22: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/22.jpg)
Continuous Integration Environment
Wednesday, December 14, 11
![Page 23: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/23.jpg)
Continuous Integration Toolbox
• Jenkins
• http://jenkins-ci.org/
• Java JDK
• http://www.oracle.com/technetwork/java/javase/downloads/index.html
• Android SDK
• http://developer.android.com/sdk
• Apache Maven
• http://maven.apache.org/
• Xcode
• http://developer.apple.com/xcode/
Wednesday, December 14, 11
![Page 24: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/24.jpg)
Continuous Integration for iOS
• Jenkins with the Xcode plugin
• https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin
• Requires a MacOS platform to build (using a Jenkins agent if necessary)
Wednesday, December 14, 11
![Page 25: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/25.jpg)
Continuous Integration for iOS
• Configure the environment where build will be run as a development environment (Xcode + certificates)
• Connect your Jenkins Server to an iOS agent :
• Use a dedicated user account on the agent host,
• Allow Remote Login (Sharing preferences) on the agent to connect to it using SSH,
• Configure an SSH key on the Server that you will authorize on the agent (~/.ssh/authorized_keys)
Wednesday, December 14, 11
![Page 26: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/26.jpg)
Dedicated account for Jenkins agent on Macos X host
Wednesday, December 14, 11
![Page 27: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/27.jpg)
Activate Remote Login (aka SSH)
Wednesday, December 14, 11
![Page 28: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/28.jpg)
Continuous Integration for iOS
• Create a freestyle job in jenkins with an Xcode Build Step
• Ask to build the IPA
• Configure it to unlock the login keychain
• Use build variables to generate a unique technical version
Wednesday, December 14, 11
![Page 29: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/29.jpg)
Continuous Integration for iOS
• “User interaction is not allowed” error returned while signing your binary ?
• Launch one time manually the build on the agent to validate permanently the access to the keychain for the process “codesign”
Wednesday, December 14, 11
![Page 30: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/30.jpg)
Continuous Integration for Android
• Install an Android SDK on all agents where the android job can be launched
• Configure in Jenkins
• JDK 1.6+
• Apache Maven 3.0.3+
• ANDROID_HOME environment variable or define the property android.sdk.path in a profile activated from maven settings.xml configuration file.
Wednesday, December 14, 11
![Page 31: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/31.jpg)
Continuous Integration for Android
• Create a Maven Job
• Use the property “android.manifest.versionCode” to inject a unique version number in the application Manifest
Wednesday, December 14, 11
![Page 32: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/32.jpg)
Continuous Deployment Environment
Wednesday, December 14, 11
![Page 33: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/33.jpg)
Continuous Deployment Toolbox
• Jenkins
• http://jenkins-ci.org/
• Appaloosa Store
• http://appaloosa-store.com
Wednesday, December 14, 11
![Page 34: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/34.jpg)
Private Store
• Appaloosa allow you to manage a private store for Android or iOS devices
• Even if our applications are deployed in public app-stores after the release we rely on a private app-store to easily deploy tests versions to our QA or our early adopters.
Wednesday, December 14, 11
![Page 35: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/35.jpg)
Continuous Deployment with Appaloosa
• Install the appaloosa plugin in Jenkins
• https://wiki.jenkins-ci.org/display/JENKINS/Appaloosa+Plugin
• Get the organization token in the administration panel of your appaloosa store
• Create a private store for each system : One for iOS and one for Android
• Configure in each job a post build task to deploy binaries
• **/*.ipa for the iOS build
• **/target/*(-aligned).apk for the android build
Wednesday, December 14, 11
![Page 36: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/36.jpg)
Continuous Deployment with Appaloosa
• Check your emails and install the Appaloosa Store App or open the website on your mobile.
• Both of them will warn you about the availability of a new version of your application.
• Just install/update it
Wednesday, December 14, 11
![Page 37: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/37.jpg)
FULL SCENARIO
Wednesday, December 14, 11
![Page 38: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/38.jpg)
FULL SCENARIOWednesday, December 14, 11
![Page 39: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/39.jpg)
iOS developmentWednesday, December 14, 11
![Page 40: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/40.jpg)
Jenkins pluginsWednesday, December 14, 11
![Page 41: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/41.jpg)
Xcode build configuration in Jenkins for iOS jobs
Wednesday, December 14, 11
![Page 42: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/42.jpg)
Post-build configuration for iOS Jobs in Jenkins
Wednesday, December 14, 11
![Page 43: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/43.jpg)
Let’s launch the iOS jobbuild
Wednesday, December 14, 11
![Page 44: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/44.jpg)
iOS build outputWednesday, December 14, 11
![Page 45: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/45.jpg)
iOS post-build outputWednesday, December 14, 11
![Page 46: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/46.jpg)
iOS job pageWednesday, December 14, 11
![Page 47: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/47.jpg)
We receive a notification
from Appaloosa(using the private store
application)
Wednesday, December 14, 11
![Page 48: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/48.jpg)
Notification sticker on our Appaloosa
store app
Wednesday, December 14, 11
![Page 49: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/49.jpg)
In the application detail screen we
can see the update
Wednesday, December 14, 11
![Page 50: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/50.jpg)
Application installation or
update
Wednesday, December 14, 11
![Page 51: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/51.jpg)
Application installation or
update
Wednesday, December 14, 11
![Page 52: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/52.jpg)
It’s ready !
Wednesday, December 14, 11
![Page 53: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/53.jpg)
Enjoy
Wednesday, December 14, 11
![Page 54: Mobile developments at eXo](https://reader035.vdocuments.site/reader035/viewer/2022070315/554f96feb4c905435d8b53e2/html5/thumbnails/54.jpg)
Q/A ?
Wednesday, December 14, 11