Continuous Integration for Android via TeamCity. Preferred tools? - android

Our team is new to both Android and Java development (originally, we came from C++), therefore our knowledge about build tools for java is pretty shallow.
There are few build tools which can be used for build automation, and the most interesting I found were ant and maven. And although there are many articles on build automation, I didn't find any comprehensive tutorial on automating Integration process for android apps.
I would be very greatful if you could state your preferable build tool for Android and explain or give any links explaining the process of continuous integration for android apps (which cover not only building application package, but running tests under the emulator).
Thank you very much for your time and assistance.
P.S.: We are using Team City as the Continuous Integration server.

We are building our continuous integration platform for Android using the following:
Maven - for managing the build/unit-test/integration-test/deploy cycle
Hudson - for continuous integration
Team City will also run Maven projects - it is fairly simple to configure a TeamCity agent to run a specific Maven goal e.g. mvn integration-test - the agent could be running on a PC with an Android emulator or a real Android device plugged in.
In the past I've had a whole bank of TeamCity agents testing against different hardware. For example if you have 5 Android devices plugged into an agent you can configure the TeamCity build pipeline to run the integration tests (controlled easily via Maven) on ALL 5 devices and only declare a PASS when they pass on all 5.

Ant (http://ant.apache.org/) is pretty much the de facto standard for building java projects. It features a very easy to learn scripting language and can even be used to deploy your application to multiple targets.
For automated testing, most java developers use jUnit (http://www.junit.org/). While not quite as seamless as the Ruby on Rails testing framework, jUnit tests do allow for test-driven development.
Maven (http://maven.apache.org/what-is-maven.html) is more of a meta-program that can use ant scripts and run your jUnit tests. True, ant can also be used to run jUnit tests, but Maven does a good job of pulling all of that together as well as providing extra functionality (example: the ability to automatically find external dependencies and download them).
While I am not familiar with TeamCity, I would be surprised if it did not have a way to integrate with ant/maven/junit.
Best of luck!

Related

Developing Ruby on an Android tablet

I want to do Ruby development on an Android tablet, just like on any laptop. So, using vim, git, and rspec to run tests. So, I've found the following apps:
Vimtouch
Ruboto
Git (yes, it's an app)
Terminal Emulator (provides bash)
Each app works just fine. By itself. But, I don't know how to put it all together. I'm a bit of a newbie when it comes to how Android works. So, if anyone could help provide a writeup so that I can:
clone a github repository
edit files from that repository
run my tests
NOTE: I don't want to write an Android app. I want to use my tablet to do Ruby development.
The Android Scripting Environment said to plan on Ruby. Might be worth a check how far they got; at least they're tagged "JRuby" at Google Code. According to their project page:
Scripts can be run interactively in a terminal, in the background, or via Locale. Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell are currently supported, and we're planning to add more.
this can be done
Compile Ruby and Nodejs for android
Install on device and configure with c/c++ ide (You can use
C4droid,CCTools,Terminal IDE.... for installing the expansion
modules on с/с++)

What tools use and how do continuous integration and test in Android with eclipse?

I have some experience in Android, and I have been working always with Eclipse. Now I want to start to develop doing test and continuous integration, so I have been researching in Google, but I have found so much different information, and I'm a little confused.
I have seen Jenkins as a good option for CI server, Robolectric for tests, and I have read about ant, maven and gradle, but, are this the best options? How I configure this tools to work together in Eclipse? Do you recommend me something better to start?
Thank you
For my part, I use Android Studio, and gradle. I use TeamCity as the continuous integration server, which supports Gradle.
I have my unit tests launched automatically by TeamCity, using Gradle, on a desktop Android device (kind of mini-computer), it's pretty usefull.
I've started tests with a phone plugged in USB on a TeamCity agent, that works very well too.

TFS automated build setup for android application

I am developing an android application. TFS is used for version control. Even the automated build also needs to setup for the android app on TFS server.
It would be great If anyone can guilde me on this.
This is a really broad question, so I'm giving you a really broad answer:
Install the Java SDK, the Android SDK, and whatever you need to build your application on your build agent(s).
Create a custom build process template (or find one online) that can execute an ANT or Maven script.

Continuos delivery pipeline for Android Applications

I am doing a little research on how to setup Continuos delivery pipeline for Android apps. I am aware of existing approaches of using Jenkins and Ant scripts for making a build. What I'd really like to do is when I do a git push on say a development branch, I'd like Jenkins to do a build on bunch of emulators (With different resolutions) run my Robotium scripts and email me results.
I am looking for end-to-end setup preferably the server would run on Ubuntu.
Siddharth,
You may want to consider CloudMunch for this need. All you need to do is launch the emulators as part your pipeline to test various stacks and finally get an update over mail. Robotium scripts can be called over shell and reports will come to you as mail at the end of the test.

Mono for Android: Which Testing Frameworks work

I have created a Mono for Android VS2010 project and added NUnit tests.
It seems Mono for Android does not support NUnit according to this post from Xamarin:
https://bugzilla.novell.com/show_bug.cgi?id=644813
Are there any testing frameworks that do run when in a Mono for Android project?
no, nunit does not work nor do any other frameworks. the intent of monodroid and monotouch is to provide a .net development environment that allows you to easily port business logic between different environments. as a result you can't really test android/ios specific code, but you can test generic .net business logic code. in the monodroid projects that i write, i create 3 projects in the solution, one is the android project, another is a .net library that holds all of my non-android specific logic and the final project is a nUnit test library against the .net library. I then add my logic code files into the android project with linked files. monodroid project files can not be tested, but .net codes files linked into monodroid projects can be tested with what ever framework you choose.
There is now a Mono for Android test runner for NUnitLite (0.6). This allows you to run some (or all) your unit tests inside the emulator or on device(s).
It's very similar to Touch.Unit which provides a runner for MonoTouch on iPhones and iPads (iOS) and feature parity is planned (i.e. adding the network logging).
Disclaimer: I wrote the runner (but the most interesting code is NUnitLite and the, several times forked, MonoDroid.Dialog library ;-).
For UI testing on actual devices, LessPainful announced earlier today that Calabash for Android supports it since version 0.1.0:
[...] we now support Mono for Android.
[...] Currently you can only test Release builds of your app. If you need to test Debug builds let me know.
I've not used Calabash with Mono.
I created a version of NUnitLite that targets MonoDroid.
It's worked quite well for me so far.
It needs to run directly on the emulator or device at the moment. If someone were able and inclined to write a runner for it, I'd welcome the input.
Check it out here: https://github.com/SpiritMachine/NUnitLite.MonoDroid

Categories

Resources