Gerald Versluis

Xamarin Continuous Integration and Delivery

Team Services, Test Cloud, and HockeyApp

Foreword by Donovan Brown

Gerald Versluis

Sittard, The Netherlands

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book's product page, located at www.apress.com/9781484227152 . For more detailed information, please visit www.apress.com/source-code .

ISBN 978-1-4842-2715-2

e-ISBN 978-1-4842-2716-9

DOI 10.1007/978-1-4842-2716-9

Library of Congress Control Number: 2017941246

© Gerald Versluis 2017

This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.

Printed on acid-free paper

Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

Foreword

As a principal DevOps program manager for Microsoft, I was given the opportunity to define DevOps . After a month of soul searching, I came up with this single cohesive definition: DevOps is the union of people, process, and products to enable continuous delivery of value to our end users. This is true for all types of development, including mobile. Visual Studio Team Services (VSTS) is the product from Microsoft that enables DevOps for any language targeting any platform. With the help of this book, you are taken from creating your VSTS account all the way to deploying your application. The author gives a quick tour of all the functionality provided by VSTS and then jumps right in to helping with your first build.

Gerald Versluis touches on all three P ’s of DevOps: people, process, and products. Most of the book covers the products—specifically VSTS—but also discusses other products, including HockeyApp, Xamarin Test Cloud, and Microsoft partner products. Throughout the book, Gerald explains the process that guides teams on their DevOps journey. Additionally, he discusses how to address the toughest P : people.

DevOps has benefits for projects of all sizes. Gerald does a great job of not just telling you how DevOps can benefit you and your organization but also explaining why these practices are so important. I always describe VSTS as everything you need to turn an idea into a working piece of software, and Xamarin Continuous Integration and Delivery proves that for mobile.

Donovan Brown

Introduction

Continuous integration and delivery is a concept that we cannot do without anymore. In a world where good software is being delivered at a very high pace, it becomes more and more important to keep up. If you do not, others will steal away your users. Several books already describe this subject, but none of them focuses on Xamarin apps.

As a developer who loves Xamarin, I wanted to fill this gap. I have set up numerous CI/CD pipelines, and it never gets boring. The challenge is always different because no two apps are the same. Also, continuous integration and delivery for an app is different from “normal” applications. You must code sign your applications, abide by the rules for each app store, and let them go through a review process, to say the least. It requires some specific knowledge on how to achieve this in the first place and second on how to weave the steps into an automated pipeline.

With this book, I have created a hands-on guide for setting up a professional, automated building pipeline for yourself. I have focused on Microsoft technologies such as Visual Studio Team Services, HockeyApp, and of course Xamarin. Not only have I tried to describe the concepts behind these tools, but I take you through the actual steps to get things done. By following along from start to finish, you should be able to configure a pipeline for yourself.

To enable you to get the most out of this book, I also cover testing and specifically automated UI tests with Xamarin Test Cloud.

I hope you will enjoy reading my first book as much as I enjoyed writing it. Happy reading and learning!

Acknowledgments

There are a few people I would like to thank for making this all possible.

First, thank you to the people at Apress, especially Jonathan and Jill who have been guiding me through the adventure of writing my first book. Without them it wouldn’t look as good as it does now.

I would also like to thank Erwin, Patrick, Steven, and Ben, colleagues and friends. Each of them has helped me with early feedback and has been an inspiration at several stages while writing.

The technical review was in the hands of the skillful Adam Pedley, my friend from afar. Thank you for being willing to proofread my ramblings and ensure everything looks OK.

Despite his busy schedule, Donovan Brown of Microsoft found some spare time to not only proofread my book and provide some invaluable feedback but also write a foreword for it. Thank you for that.

Finally, I would like to thank Laurie for being patient with me and supporting me in whatever dream I am pursuing this time.

Although I did my best to name everyone who has helped me or has otherwise been of any importance to me during this process, I might have forgotten to mention you. For that I am sorry, but I want to thank you nevertheless.

Contents

  1. Chapter 1:​ Why an Automated Pipeline?​
    1. What Is Continuous Integration?​
    2. What Is Continuous Delivery?​
    3. Why Do You Need an Automated Build Pipeline?​
    4. Final Thoughts
  2. Chapter 2:​ Establishing the Prerequisites
    1. Setting Up a Visual Studio Team Services Account
      1. Project Overview
      2. Dashboards
      3. Code
      4. Work
      5. Build &​ Release
      6. Test
    2. Setting Up a Team Project
    3. Setting Up a Mac Build Agent
    4. Installing Xcode
    5. Installing Xamarin
    6. Final Thoughts
  3. Chapter 3:​ Creating Your First Build
    1. Introducing Visual Studio Team Services
    2. Creating a Build Definition
      1. Build Definition Templates
      2. Build Tasks
      3. Repository
      4. Variables
      5. Triggers
      6. Other Options
      7. iOS
      8. Android
      9. Universal Windows Platform (UWP)
    3. Final Thoughts
  4. Chapter 4:​ Customizing Your Builds
    1. Versioning
      1. Preparations
      2. iOS
      3. Android
      4. UWP
    2. Different Types of Build Definitions
    3. Triggers
      1. Continuous Integration
      2. Scheduled
      3. VSTS REST-API
    4. Final Thoughts
  5. Chapter 5:​ Creating and Running Tests with Xamarin Test Cloud
    1. A First Look at Xamarin Test Cloud
    2. Creating UI Tests
      1. Creating a Test Run
      2. Creating a App UI Test
    3. Final Thoughts
  6. Chapter 6:​ Integrating Tests into Your Builds
    1. Integrating Test Cloud as Part of Continuous Integration
    2. Integrating Unit Tests
      1. Unit Testing Shared Code
      2. Unit Testing Android- and iOS-Specific Code
    3. Other Test Types
    4. Final Thoughts
  7. Chapter 7:​ Preparing for Distribution
    1. A First Look at HockeyApp
      1. Distribution
      2. Crash Reports
      3. Feedback
      4. User Metrics
    2. Setting Up Your App for Delivery
      1. iOS
      2. Android
      3. Universal Windows Platform
    3. Setting Up VSTS for Delivery
      1. Getting Crashes and Feedback from HockeyApp in VSTS
    4. Final Thoughts
  8. Chapter 8:​ Releasing Your App
    1. Creating a Release Definition
      1. Building a Chain of Command Between Environments
    2. Deployment to Specific Users or Groups
    3. Release to the App Store
      1. Google Play Store
      2. Windows Store
      3. Apple App Store
    4. Final Thoughts
  9. Chapter 9:​ A Closer Look at HockeyApp
    1. Installing Your App on a Device
    2. Collecting Feedback
    3. Basic Error Reporting
    4. Tracking Custom Events
    5. Analyzing Usage Statistics
    6. Update Distribution
    7. Final Thoughts
  10. Chapter 10:​ Where to Go from Here
    1. Different Build Definitions
      1. Expanding Your Build Definitions
    2. Feature Flags
    3. Receiving Alerts
    4. The Human Factor
    5. Final Thoughts
  11. Appendix:​ Alternative Tooling
    1. Visual Studio Mobile Center
    2. Bitrise
    3. AppVeyor
    4. Fastlane
    5. TestFairy
    6. Flurry
    7. Raygun
    8. Jenkins
    9. TeamCity
    10. Final Thoughts
  12. Index

About the Author and About the Technical Reviewer

About the Author

A435607_1_En_BookFrontmatter_Figb_HTML.jpg

Gerald Versluis is a full-stack software developer and Microsoft MVP from Holland. After years of experience working with Xamarin and .NET technologies, he has been involved in numerous projects, in all kinds of roles. A great number of these projects are Xamarin apps.

Not only does he like to code, but he is keen on spreading his knowledge, as well as gaining some in the bargain. Gerald involves himself in speaking, providing training sessions, and writing blogs ( https://blog.verslu.is ) and articles in his spare time. You can find him on Twitter with the handle @jfversluis and can find more information on his web site at https://gerald.verslu.is .

About the Technical Reviewer

A435607_1_En_BookFrontmatter_Figc_HTML.jpg

Adam Pedley is a Microsoft MVP and actively engaged in the Xamarin community. He speaks at technical events and is a contributor and author to several open source projects, including Xamarin Forms. He currently runs the largest community blog dedicated to Xamarin and helps thousands of Xamarin developers around the world, through several online channels.

As a 15-year .NET developer and architect, he has helped government, large businesses, and startups with all aspects of development. Adam is a Xamarin Certified developer and has a bachelor’s degree in computer science from Edith Cowan University.

You can read Adam’s blog at www.xamarinhelp.com and follow him on Twitter @adpedley .

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.63.236