#Fake app android how to
Refer to my sample implementation to find out how to accomplish this. You may need to use a custom Executor when invoking methods of AppUpdateManager for the integration test to be executed synchronously.
#Fake app android update
While blue rectangles are methods that are available in the FakeAppUpdateManager that we can use to simulate user and network behavior during the update process. Green rectangles represent methods that are available in a regular AppUpdateManager class. To understand this invocation order easier, I’ve prepared the diagram below. Īs FakeAppUpdateManager tries to simulate the flow of the in-app update process, the order of method invocation is important. However, if we look at the documentation of the methods in FakeAppUpdateManager, most of them have some preconditions, e.g.: downloadStarts void downloadStarts () Simulates the download starting. This class is provided by the Google Play core library to make testing edge cases of in-app updates easier.įull documentation of FakeAppUpdateManager class can be found here: FakeAppUpdateManagerįakeAppUpdateManager, as its name suggests, is a fake class with methods that we can invoke to simulate user and network behavior during the in-app update process, like userRejectsUpdate or downloadFails. In this post, I will talk about how we can utilize FakeAppUpdateManager to write integration tests for this in-app update process and simulate edge cases that are difficult to reproduce. This is where integration tests can help us. We also need to be very careful not to accidentally release a test version of our app.
![fake app android fake app android](https://androidwidgetcenter.com/wp-content/uploads/2016/04/Fake-Call-Apps-on-Android-300x196.jpg)
However, this is very time consuming and not scalable as we will need to upload multiple versions of our app to test failure and cancellation cases.
![fake app android fake app android](https://cdn.ilovefreesoftware.com/wp-content/uploads/2015/07/Fake-Call-2.png)
From there, we can validate that the update prompt is triggered from within the older version of our app that supports in-app updates, download the update, and ensure that it is installed correctly.
![fake app android fake app android](https://www.nowsecure.com/wp-content/uploads/2019/04/infographic-fake-mobile-app-960x3362.png)
One way to test that the update flow is triggered correctly is by uploading a newer version of our app to the Play Store. How can we test that the update flow is behaving as we want? Let’s assume that we have implemented the in-app updates of our app according to the official documentation.