Guest Post: All About Mobile Continuous Integration
Sauce AI for Test Authoring: Move from intent to execution in minute.|xBack to ResourcesBlogPosted April 20, 2015
Guest Post: All About Mobile Continuous Integration
CI ’ s not a new thing. Wikipedia says the phrase was first used back in 1994, way before modernistic mobile apps. Today it ’ s commonplace in many dev shops for developer to expect that their code is automatically tested when they commit and even automatically deploy to a scaffolding environment. For mobile developers though, it ’ s been a dim road to adopting many of these same practices. In turgid component, this is because mobile brings with it a whole set of unique challenge that do implementation rugged. Nevertheless, tools have evolved a lot and nomadic dev teams get a lot of value and good from having a solid CI system in place. Here are my top 3 reason for using CI with the nomadic production I act on:
No Touch Configuration:Human beings are terrible at creating liberation. They inescapably misconfigure something. I want PROD releases to literally be a single button imperativeness.
Automated OTA Distribution:During ontogenesis there ’ s always individual that needs a new build of the app and receive to manually create a build each time is super clip consuming. With CI I can exhort a push and have it mechanically build, code sign and push them an email w/ an install link.
Builds And Tests:If code is committed that doesn ’ t compile or fault tests I desire to cognize ASAP.
What Makes CI for Mobile Different?
Infrastructure:
As we all know, iOS is an huge part of the mobile ecosystem. If you ’ re at all conversant with iOS maturation then you ’ re almost certainly well acquainted with Xcode and I ’ ll bet you a warm cup of java you ’ re perform all your evolution on a Mac. Know how I know? Of line, you can only make (and compile) iOS applications on Mac hardware. What that means for setting up a CI system is that if you ’ re going to indorse iOS you ’ re go to get to get a dedicated physical Mac machine. No EC2 for you.
Compilation/Code Signing: Configuring an environment to hoard a mobile app is quite different than setting up CI for most web environments. There are often a act of dependency that need to be in place to make the compile work, like Xcode or Android SDK versions. Once a compilation has dispatch and you ’ re left with an APK (Android) or IPA (iOS) file there ’ s a codification signing step that ’ s required before an app can be establish on a gimmick. This is an important and non-trivial step that has no parallel in a web environment. Any CI solution that isn ’ t specifically designed to handle this step will not be able to create builds that run on device. Furthermore, since code signing certificates/keystores are sensitive pieces of data the signing process needs to be contrive to protected them.
Testing: Testing peregrine applications bears some resemblance to web prove. There are both Functional and Unit testing frameworks for iOS and Android. However, go Functional tests on a peregrine application take the use of an Emulator/Simulator or a physical device. In either case, automatically starting/stopping emulators and simulator is unmanageable and error prone and physical devices get bottlenecks in a hosted surround. There exactly isn ’ t a corollary to this on former platforms.
Deployment: Deployment for mobile typically means either distribution to tester or publishing your app to an App Store. For web developers getting your app our there is as easygoing as committing your codification, especially if you ’ re doing some form of Continuous Delivery. For mobile this is a multi step process that command edifice, signing and uploading your app to a service likeHockey App.
Simulators, Emulators and Real DevicesWhen it comes to testing mobile applications there appear to be a lot of confusion around when/how often to test using real devices vs simulators/emulators. The actual decision regarding which to use is subject to a few variables that deviate by product/team. First, yet it ’ s often helpful to explain the benefit and differences of each of these options.
SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.
Simulators vs Emulators:It ’ s significant to note that these are not the like thing and while the Android SDKs ship with Emulators, Xcode (iOS) habituate Simulators. The large dispute between the two is that Android Emulators actually use the same instruction set (normally ARM) that the quarry device utilize. On the other hand iOS Simulators run employ the teaching set on your dev machine (x86). What this means is that the like build that runs on an Android emulator will run on an existent device. Builds amass to run in an iOS simulator however will not run on an iOS device. The downside to emulator is that they ’ re very slow while simulator are much faster.
Real Devices:There ’ s really no relief for test your application on the like physical ironware that your user are running. In drill Simulators and Emulators will catch many matter but, and this is especially true w/ Android, the variations and sometimes bug found on the devices themselves can only be ground by testing w/ the actual device. Furthermore, if your application has a reliance on specific physical hardware (i.e. Bluetooth Radio) it may be impossible to test without physical hardware.
So, when/how oft should you test w/ each option? (Disclaimer, sentiment to follow) In my experience, during the development process the variables to optimize for are race and cost. In other words, when your developers are committing a lot of code you want your examination to be tight and cheap. On the other hand, when you ’ re getting ready to prep a release build it ’ s ok if your trial lead longer to finish. What ’ s important is that you ’ re getting as much coverage and truth as potential. As such, my recommendation to most people is that they use simulators/emulators on their feature branches and physical device on their master and release branches.Tools For Mobile CIThere ’ s been a lot of progress over the terminal yr or two on mobile CI tool. Testing fabric have come a long way and now there are a fistful of hosted CI platforms designed to make setup as easy as potential. Here are a few of my favorite tools:
Hosted CI Platforms:
Ship.io: The first CI solution to market focused specifically on mobile. Ship has an easy to use setup process, and support both Simulators and Real Devices for testing.
Greenhouse CI: A newcomer, also focused specifically on CI for mobile applications. Greenhouse has a well designed UI that makes it easygoing to use for less technical squad member.
Travis CI: Popular, robust CI platform with support for OSX based infrastructure. Configuration process is motor by a YAML file so it ’ s a bit less friendly than the UI offered by Ship and Greenhouse. That said, some folks favour YAML.
Testing Frameworks:
XCTest: This unit test framework first debut in Xcode 5 and supplant the older OCUnit framework. Since it ’ s baked right into Xcode it ’ s get the “ default ” go-to fabric for many citizenry. XCTest has a solid characteristic set and is relatively straight to memorize and start using.
JUnit: The corresponding “ Out Of The Box ” solution for Android developers. Similiarly it is tightly incorporate with Eclipse and Android Studio but can also be run from the command line habituate Grandle or Ant.
Appium: Developed by Sauce Labs, Appium is a popular cross-platform fabric that allows you to indite trial that run on both iOS and Android. Another big plus is that it ’ s based on Selenium so folks who have worked w/ this in the past will find it a familiar conversion.
KIF: “ Keep If Functional ” (KIF) is an iOS-only Functional Testing framework with a strong focus on usableness. If you ’ re looking to write tests that reproduce user behavior at the UI-level (vs unit tests) I powerfully recommend taking a aspect at this one.
In the end setting up CI for your mobile dev team is all about picking the right puppet for the job. There is no one-size fits all solution and the deepness and complexity of your system should match the motivation and budget of your squad. Big, well-funded organizations hold very different engineering and line needs than pocket-sized, early point startups. The approach that I ’ ve seen be the most successful is to start with obvious pain point that everyone on the squad knows about and automating them on a gradual fundament rather than sinking scads of time into a large, potentially unnecessary process. -By Kevin RohlingKevin Rohling is the Co-Founder of Emberlight and Ex-CEO of Ship.io (formerly CISimple), the initiatory platform to offer Mobile CI as a Service.
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free