Guest post by Ihor Klimov, originally posted on My Hexaville.
Ihor lives in Stockholm, Sweden. and he loves Android development, blogging, working out and traveling.
Are you annoyed by slow Android builds which slow down your system and make it unusable? I’ve just found a solution to some of those problems!
Now in my previous post, I talked about what minimum hardware you need for more or less comfortable development experience. Without it you better off sticking to web development, because you’ll hate Android for sure, just because of Android builds
So basically this service offers you cloud-based builds for Android, iOS based on git push to your repository (GitHub, BitBucket …), run tests, some integrations with services like Slack and more
One Person Team
So let’s start with single developer team, just like you’re alone developing your app and publishing it. What can Bitrise bring? Since it’s triggered by git push – it’s not a solution for incremental build during development, plus Android Studio does it better with Instant Run
If you have bad hardware and release build takes you forever – then you Bitrise is great for you! You can work in develop or some other branch and when ready to publish app – push to master branch and Bitrise trigger will be called to build signed release version of your app. Then you just wait and download apk from there
Building debug build doesn’t make much sense for you alone. Bitrise testing is great also. When you finished writing new feature, pushed code to develop branch and Bitrise makes sure you didn’t break anything by running tests
Now here it gets way more interesting. Let’s say you have a team of three developers: web, Android, iOS, few managers, QA testers etc
For Android, we can use debug on git push builds, because now we have other members of the team which might want to test the latest version of the app without you having to publish a beta version to Play Store each time. They can just install apk from Bitrise
Of course, Slack integration comes in handy here as well
So you excited? Ready to get started?
What you can certainly expect from latest startups – their products extremely easy and fast to use. It’s just the industry standard now. If you already have a GitHub/BitBucket account and a repo – you halfway done
Go to Bitrise.io, click Sign up, I signed up with GitHub, by doing this you grant Bitrise access to all your public and private repositories with just one click
After done setting up – click Add new app
Then you’ll be able to select GitHub/Bitbucket repo
You’ll go through small setup like which branch to scan, determining is it Android/iOS project and set a webhook to build once you pushed to your master GitHub branch. All of it you can change later
Build Your First APK
Then you’ll see your first build already started. Click on the message
And you’ll see it building
One thing you need of course to make sure is that this repo has no build errors, all the dependencies Bitrise will take care of. And when it’s done – click apps & artifacts, you’ll see all the possible debug build apk to download
I have two product flavors for different minSdkVersion: pre L and >=L for multidex faster builds, but I think Android Studio 3.0 got smarter and does this optimization for you already
And from now on anytime you push to the main branch – you’ll get your debug build triggered
Building Signed Release APK
Now the coolest thing is to have signed release apk being built every time you push master branch. You just use develop branch as your main branch, which does not trigger release apk build. Check how simple it is
First, of course, you need to create .keystore from Android Studio. In there you set Key store password, Key alias and Key password. Remember those, you’ll need them. So just create .keystore, no need to actually build signed apk from Android Studio
Then in Bitrise go to Workflow/Triggers, change * (all branches) to master and change primary to deploy (those are Bitrise scrips that you can edit)
Save changes and go to Code signing, upload the keystore file you’ve just created and fill out those three fields: Key store password, key alias, key password. Save changes
Final steps. You’re almost done, one thing is to include apk signing in deploy workflow, for some reason, it’s not included by default
Go to Workflow, select deploy and right after Gradle runner click plus button
Then find Sign APK, add it and save changes
That’s it, now every push to master branch will trigger signed release APK build. You’ll be getting emails every time your build succeeded/failed, you can download signed apks from there and even share the download link to non-Bitrise users!
Impressed yet? There’s a bunch of other features like automated testing and more. Take a look at Bitrise.io, definitely cool stuff. Also don’t forget to subscribe to get latest updates from my blog, follow me on Twitter, Facebook and G+