process killer
An open source app for quickly and easily testing Android state restoration.
Why we built it.
Android state restoration has always been a core behavior and critical feature of Android apps, but the tools for testing it have typically been difficult to access or simply inadequate. The two most common ways to do so are to simply rotate a device or to use the well-known "Don't Keep Activities" developer option. Neither of these, however, actually kills the app's process, which leaves an entire class of state restoration bugs untested.
Process Killer is an easy-to-use app that fills in this gap. Because it can be downloaded from Google Play and does not require developer options to be enabled, it can be used by anyone looking to test an app, not just developers.
How it works.
At its core, Process Killer relies on a single call to the operating system to "kill" a
running process: ActivityManager.killBackgroundProcesses(packageName)
. This
disposes of the process in the same way the OS would when background resources need to
be reclaimed and it then places the associated app in a state in which it will be
"restored" when the user returns to it. This call can be made by any app by adding a
single permission: android.permission.KILL_BACKGROUND_PROCESSES
.
The real heavy-lifting done by the Process Killer app, though, is when it actually
manages which apps are displayed. By making use of UsageStatsManager
and managing
the appropriate permissions, Process Killer surfaces only the most relevant apps ordered
by how recently they were used to maximize testing efficiency.
After selecting an app to "kill" it, Process Killer then uses all the relevant package information it already has on hand to provide a button that will take you back to the killed app where you can immediately check its behavior under state restoration. This once cumbersome testing process is now reduced to just two clicks!
Check out the project on GitHub for more details.
How to use it.
Anyone can download the app from the Google Play Store . Then, to test state restoration by "killing" an app's process, simply open Process Killer, find the desired app from the list of recently running apps, and select it. It's that simple.
Built by Livefront.
Livefront is a digital product consultancy. We're trusted by some of the world's most admired companies to drive strategy, design, and engineering for their core digital experiences. They partner with us to move faster, think bigger, and design products people love.
Learn more