DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Build an Android Mobile Application Using Azure DevOps

Build an Android Mobile Application Using Azure DevOps

As an introduction, use Azure DevOps to construct, build, and deploy a mobile app using Gradle.

Sidda Reddy Moolamreddy user avatar by
Sidda Reddy Moolamreddy
·
Sudheer Mareddy user avatar by
Sudheer Mareddy
·
Gopal Jayanthi user avatar by
Gopal Jayanthi
·
Anjanidevi Oruganti user avatar by
Anjanidevi Oruganti
·
May. 24, 19 · Tutorial
Like (6)
Save
Tweet
Share
22.81K Views

Join the DZone community and get the full member experience.

Join For Free

This post is as an introduction to Azure DevOps. If you are new to this, can check out a helpful DZone article here.

Use the azure-pipelines.yml file at the root of the repository. Get this file to build the Android application using a CI (Continuous Integration) build.

Follow the instructions in Create a build pipeline , https://dzone.com/articles/introduction-to-azure-pipelines to create a build pipeline for an Android application.

After creating a new build pipeline, you will be prompted to choose a repository. Select the Github/Azure Repository. Need to authorize the Azure DevOps service to connect to GitHub account, Click Authorize, this will integrate with your build pipeline.


Image title

After connection to GitHub has been authorized, select the right repo, which is used to build the application.

Steps

Azure pipelines have an option to build and deploy using a Microsoft-hosted agent. When running a build or release pipeline, get a fresh virtual machine (VM). If Microsoft-hosted agents will not work, use a self-hosted agent, as it will act as a build host.

pool:
  name: Hosted VS2017
  demands: java
  • Build a mobile application using a Gradle wrapper script, check out the branch and repository of the gradlew wrapper script. The gradlew wrapper script is used for the build, if the agent is running on windows must use the gradlew.bat, if the agent runs on Linux or MacOs can use the gradlew shell script.


Set the current working directory and Gradle wrapperfile script directory.

steps:
- task: Gradle@2
  displayName: 'gradlew assembleDebug'
  inputs:
    gradleWrapperFile: 'MobileApp/SourceCode -Android/gradlew'
    workingDirectory: 'MobileApp/SourceCode -Android'
    tasks: assembleDebug
    publishJUnitResults: false
    checkStyleRunAnalysis: true
    findBugsRunAnalysis: true
    pmdRunAnalysis: true


This task detects all open source components in your build, security vulnerabilities, scan libraries, and outdated libraries (including dependencies from the source code). You can view from the build level, project level, and account level.

task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@18
displayName: 'WhiteSource Bolt'
  inputs:
    cwd: 'MobileApp/SourceCode -Android'


Copy the .apk file from source to the artifact directory.

- task: CopyFiles@2
  displayName: 'Copy Files to: $(build.artifactStagingDirectory)'
  inputs:
    SourceFolder: 'MobileApp/SourceCode -Android'
    Contents: '**/*.apk'
    TargetFolder: '$(build.artifactStagingDirectory)'


Use this task in the build pipeline to publish the build artifacts to Azure pipelines and file share.it will store it in the Azure DevOps server.

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'


The new pipeline wizard should recognize that you already have an azure-pipelines.yml in the root repository.

The azure-pipeline.yml file contains all the settings that the build service should use to build and test the application, as well as generate the output artifacts that will be used to deploy the app later release pipeline(CD).

After everything is perfect, save and queue the build so you can see the corresponding task of logs to the respective job.

Image title

Image title

Image title


After everything is done, extract the artifact zip folder, copy the .apk file into the mobile device and install the .apk file.



Continuous Integration/Deployment mobile app azure DevOps Android (robot) Pipeline (software)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Data Ingestion vs. ETL: Definition, Benefits, and Key Differences
  • A Comprehensive Selenium Locators Cheat Sheet
  • Key Considerations When Implementing Virtual Kubernetes Clusters
  • Pipes And Filters Pattern

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: