Skip to main content

Posts

Showing posts with the label command line

A marshmallow shaped problem in my screenshot empire

"Never without my permission" ~ Leeloo (translated) android.permission.WRITE_EXTERNAL_STORAGE As a tester, you probably have a favorite app, maybe a favorite feature, possibly even a favorite bug. But you probably don't have a favorite permission. I've been taking advantage of it for years to do things like gather code coverage on non-rooted devices, logcat output from an entire test run, and probably my favorite usage is screenshots triggered when tests fail. Yep, that little permission has been a big pal of mine for a while. So it should be no surprise that I felt a little betrayed when I recently discovered a problem with it on devices running Android 6.0 aka "Marshmallow". Among the many changes brought about by the 6.0 release was a long-overdue overhaul to Android's permission scheme, notably, from an all-or-nothing approval of permissions at install-time model from Android 1.0-5.1.1 to the more nuanced permissions requested when requ...

My Favorite Script - Being Lazy for Fun and Profit

Success is a journey, not a destination. So stop running. As a tester, one of my most repeated routines includes the following: downloading a new build from our CI server uninstalling the build from my test devices (note the plural) launching the app for a specific set of tests or investigations.  This happens many times a day, each day, all year. This routine also has many variations based on whether I just want to clear app data and relaunch it, whether I have a different method to launch the app in mind (different starting activity, different intent extras, etc). On top of all of this, there are details about the build which are relevant to any resultant actions I take in our task/bug tracking suite such as build number, device information, etc. This kind of jumble is cumbersome and time-consuming to manage manually. The whole reason to manage all of that process and information is to maintain a consistent practice of reliable reproducible tests and rich environment an...

Android "L" and UiAutomator command line shenanigans

Wow! It has been a long time since I've updated this blog; so long, in fact, that I a whole new version of Android has been announced (okay maybe 2 or 3). Like many of you, I was paying very close attention to the live streamed sessions at this year's Google I/O. At first I thought L contained nothing new for my QA interests but upon further digging I found a few tiny gems: "You can execute shell commands from your instrumentation test with the new android.app.UiAutomation.executeShellCommand(). The command execution is similar to running adb shell from a host connected to the device. This allows you to use shell based tools such as dumpsys, am, content, and pm." From the API Overview document for Android "L" Developer Preview Oh that's nice.  I guess that means I don't need these anymore: -     public static void runShellCommandStringArray(String[] command) throws IOException {        try {.. -   ...