Best way to distribute Android builds through a private channel - android

My app is now in the alpha status and I would like to distribute it to a few people (QA, alpha testers...) without making the app public. I know, that google play offers a private channel to distribute apps in alpha/beta state to some people, but according to the website it takes a few hours until the application is available. However, I would like to have it available for users as soon as a new build is ready and uploaded. I thought about setting up a private android repository (e.q f-droid), but unfortunately I could not find anything in the documentation about securing the android repository - I want it to be protected somehow (key, password...).
Another possibility would be to set up a web-server and host the different build versions on that server. Then the testers have to navigate to that site and download the appropriate build version. However, from the usability point of view it isn't that nice - user have to download the version manually and install it afterwards. Also for the QA guys it would be nicer, if it is easier to switch between different android builds.
How would you solve this problem? Is there already any software out there, that is suitable for that task?
Any help is really appreciated.

I know Google says it can take a few hours, in my experience, it happens very quickly, a few minutes at most. I don't know if there are times when it takes longer.

I thought about setting up a private android repository (e.q f-droid), but unfortunately I could not find anything in the documentation about securing the android repository - I want it to be protected somehow (key, password...).
While perhaps not in the docs, F-Droid does support HTTP Authentication on its repositories. For example, if using Apache you can add a relevant .htpasswd and .htaccess file in the webroot. This will result in the webserver sending back a 401 and asking the client to authenticate. F-Droid responds by prompting with a username/password dialog.

I would suggest using Crashlytics. Crashlytics is now integrated in Fabric.
Crashlytics allows you to distrubute beta versions of your app. Testers only have to install the install the Crashlytics app, and enable installing apps from different sources. You specify which users can test the app by emailadress.
The app allows testers to switch between any version of your app, and install any possible other apps they are invited for.
You can also integrate Crashlytics in your app. If you do you get notified of errors that occured complete with stacktraces, and additional information about the device. This makes bugfixing easier.

Related

Is there any way to automate the building of Android and iOS app and release to Google Play and App Store?

I was wondering if there is any way to automate the building of apk and ipa file and publish them into Google Play or App Store?
The idea is customer will be able to change some image and content from website console then build the apk or ipa with their own changes and publish the app into Google Play or App Store by their own from the website console.
So my question is, is there any tools or techniques that can be used to build the apk or ipa from website where by customer click event, that tool or technique will perform the build using the modified source code saved in the server and also publish the app using necessary process including app signing.
I am asking this because I found some app builder websites are providing this kind of service where customer can publish their app by their own.
I have searched the web for this, and did not find anything to try.
Yes, there are services for building & releasing apps automatically. A build server using the right tools can build your app and be responsible for signing & publishing to the stores. This takes a bit of time to setup properly, but once setup it shouldn't be much of a hassle.
Have a look at Fastlane, their service should match your needs for mobile apps and it widely adopted as a deployment solution. You can have a look at their doc on how to set it up yourself.
As to wether or not this is the proper solution for you remains discussable. If all your clients wish to do is update images & simple content, you're much better off with a CMS. This would allow your client to update all the content while the app is live. That way, you wouldn't have to push an update to the store just to change an image, and the app users won't have to update everytime (which you can never guarantee).

Hacked android application - how to find the source site or market?

I have 500k active users. My application has been probably hacked. How do I know that? My production versions are 3.x.y But I can see in Firebase statistics that 1% (about a few thousand) users use version 4.0.0. I have never released app with that version. Probably somebody just changed app version and I assume ad ids. He didn't even remove Firebase analytics so I can see that the hacked app is live. I use standard ProGuard obfuscation but as we can see it didn't help.
The question is how to find the place (site, market,..) from where hacked application is downloaded?
If you are fine to update your app, then I would first change my app to read getInstallerpackageName from PackageManager, and then record it via Firebase analytics.
If the result of this is com.android.vending it was installed from Google Play, otherwise it will be the program that installed your app. If this is another app store then great, you have found it.
If the result is something like a web browser then it is harder as the user got the app from a website. Then your best option is Google searching. The normally easiest way is include your app name and the word "APK". This tends to find most sites serving your app. You could even search for your app name, "APK" and "4.0.0" as many website list the version code on the page.

Distribute Android apps within organization

I have to distribute Android apps within my organization. I have a google developer account. Below it tells to login to the admin console to enable private channel.
https://support.google.com/a/answer/2494992?hl=en
Problem -it does not sign me in as Google help states that
my.account#company.com, doesn't have an administrator but is instead managed by Google.
Requirement - So how can i get the administrator account.
Any help will be appreciated.
Regards
You can provide the .apk files directly to your organization.
Either you can allow to download a signed .apk file through a web site which will launch the install procedure or you can make an app market which provides a list of .apk files and installs them automatically, as Amazon's App Shop.
I'm not sure if Google account allows you to share app locally. But we use Hockeyapp to do the same. It works great. You can even integrate it to your app and upload the crashes too. Many other features. Take a look at this to know other solutions. It supports iOS as well as Android and offers a good user experience.
But you've to pay a bit for it. CashAnalytics is free. Do small research for yourself.
I have used crashlytics for this purpose in my last project.
It works great for beta distribution in development phase.
Also, it's crash reporting is excellent to guide you to the source code line causing crashes.

Android app upgrade without market

I am going to have a alpha release of my app, which is not yet on the market. I want to have the app APK link sent out to friends via email so they can download it from my site CDN.
One question here: if I want to give them updates, what will be a good way? Can I download the new APK within the app, and somehow install the APK to replace the old one without anything to do with the market? So my friends can have the app upgraded while it is still in alpha release?
When I did it, I used Zubhium -- they were a web service with a small API that you could install into your app, giving you a mini "app store"-style backend and handling distribution for you. It would host and distribute your APK, connect up to their server when the app launched, check for updates, invalidate old versions, gather crash logs for you, etc. It was very good.
Zubhium are now https://www.vessel.io -- I presume they still have the above features as part of their now-much-bigger service, but when I checked you had to give them a credit card number even to sign up for the free plan, so I've not played with it.
A friend of mine uses http://testflightapp.com for iOS, and it looks like they have an Android version now, so that's certainly worth checking out. A quick search also shows up http://applover.me. #Janusz recommends http://hockeyapp.net/features in his comment.
As #Nanne points out in his answer, the Play Store itself now lets you distribute to limited alpha- and beta-test groups. That looks like it has fairly minimal features compared to the third-party services (no A/B testing, etc.), but will be familiar and free. And it doesn't need an extra SDK rolled into your app.
So, my general answer is that there's more than one professional beta-testing API/service that you could use, that they're generally very useful, quite easy to roll into your app, solve all the problems you're anticipating and more, and often have a free plan to get started. I'd recommend picking one of them rather than trying to roll your own solution.
If you want this only to be able to release your app in Alpha, and maybe later in beta, take a look at the android market again.
Check out this link: https://support.google.com/googleplay/android-developer/answer/3131213?hl=en
It boils down to the fact that you can have an Alpha-test, and a beta test, each with selected users. You can upload your app as normal, so you'll have updates via the market, but not everyone can download your app.
For the beta at least, you can select a community that is the source of your users, so all that are in that community could be testers.
This is the best method for testing I believe.

How to upload an APK from Jenkins/Hudson to Play Store?

I implemented a continuous integration pipeline using Jenkins, but as final step I want Jenkins to deploy/upload the signed APK file to Google Play Store and AndroidPit. I looked for Jenkins/Hudson plugins but only found two: one for Appaloosa and one for Zubhium.
I have a working developer account both on Google Play and on AndroidPit and can manually upload the APK that Jenkins produces. But my question is: Does anybody know a way to teach Jenkins (e.g. via a shell script?) to upload the APK to the mentioned app stores?
There is a Google Play Android Publisher plugin for Jenkins which uses the Google Play Publishing API, announced at Google I/O 2014.
Google has also released Java and Python libraries to help make use of the API.
For more info on the API, see also:
http://android-developers.blogspot.com/2014/07/grow-with-google-play-scaled-publishing.html
I can talk only for Google's Play Store. There is a way, but be warned, it isn't beautiful, you have to code your solution. I am right now writing a Bachelor Thesis to solve this problem - "Continuous Delivery for Android Applications". My solution is mine, this means I don't raise a claim to have the perfect solution, but I can say it is quite working prototype.
I found out the following:
The first Solution is none. Google offers an Play Store API, but it lacks to upload stuff. Seems that they were already thinking about to make such an API, but it only offers In-App billing control
The 2nd solution is to use Apache HttpComponents Library, which lets you implement your own Client for the Google Play Developer Console, but HttpClient lacks a JavaScript Interpreter... Several ways to implement or add one. But of course, not the easiest way.
The 3rd Solution I am working on, is to use Selenium Web Browser Automation Framework. So basically I create PageObjects from those Play Store Pages and dialogues. After that you can create some Factory to maintain "pathes" of controlling these PageObjects.
Using them you have two options as far as I can see, for instance the WebDriver Objects which uses an "invisible" browser process like FF or Chrome and another I use is ChromeDriver which uses a visible Browser process, to perform the User actions. And don't forget to have Exception Handlers, which scans the Webpage for appearing errors, while in use.
There are a lot of pitfalls, due to possible changes in the Design from Google, which lets your Software break. But there are also some ways to handle that. =) And create an XML containing all valueable information about an app, which comes in handy, when continueing to the next step.
You can create a Maven Plugin. This you can load into your Continuous Integration Server. I hope I could help you a bit.
Since Google Play released the upload API, a plugin has been made:
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=73533143
I haven't tried it yet, but looks like it's exactly what we were looking for.
There are other plugins that claim to do the same (thanks #mdt)
https://github.com/DavidHamm/google-play-publisher 404-this page does not exist
https://github.com/orrc/google-play-android-publisher-plugin
I believe it is not included in the PlayStore API currently to reduce stress on the system and to avoid abuse.
I believe we may see this in the gradle plugin and in the IDE in the future.
While we wait for google decide to open up the API, here is a solution, that is so sill, that i just had to propose it:
If you have a GUI, use GUI automation for the last step.
Google Play Android Publisher plugin for Jenkins is a good one. However, it doesn't support uploading descriptions and screenshots (at least for now).
I found decent Gradle plugin, called Gradle Play Publisher. It supports uploading apk, updating Metadata, and uploading screenshots. And it only needs a few steps to setup.
First go to Google Play Console in a browser, open the page for your app, and look for the option to allow a new email address to upload APKs. If it's not there, it probably means you are not the administrator of that Play Store account and you need to ask the person who is the administrator to add it for you (on a per-app basis). To find out what email address to add, go to Google Developer Service Accounts and create a JSON key for any of your existing Google developer service accounts, or create a new service account with a JSON key. Note the email address associated with the service account for which you have created (or will create) the JSON key. It will most likely be something at gserviceaccount.com. This is the email address that must be given permission to upload APKs by someone who has admin access to your Play account.
After that has been done, download Madison Dickson's updated version of Marta Rodriguez's script via wget https://gist.githubusercontent.com/mix3d/665f4ab329b4482297a2f425ebba402c/raw/0949385dd6c80d0701170746b1bd5fd479303412/basic_upload_apks_service_account.py and install dependencies via pip install google-api-python-client (or sudo pip install google-api-python-client as appropriate).
Then in the automated script you can use (for example) python basic_upload_apks_service_account.py -t beta -p org.example.MyApp -s JSON_file_I_made.json -a MyApp.apk (assuming your JSON file, your APK, and basic_upload_apks_service_account.py are all in the current directory and the pip install has been done on that machine or container).
I strongly recommend uploading to beta (hence -t beta in the above) rather than directly to production. Just in case something breaks and it somehow gets as far as the APK upload. I think the final press of "rollout to production" should always be done by a human. But if you really want to do that automatically as well, you can use -t production instead.

Categories

Resources