Skip to main content

Updating My Favorite Script

Since the last time I updated my blog, I've changed jobs and titles. While I still technically work in my new company's QA organization, my work is devoted more to app delivery than app testing. This doesn't mean I am not a tester anymore but that it consumes less of my time. It's no surprise therefore that I'm only NOW getting around to posting an update to my favorite script which I first shared 3 years ago here in this post.

3 years later and at least 3 years lazier, the ways I've modified the script are all designed to simplify it, make it more generic, and have it do more of the work for you. Instead of supplying a lot of configuration, it only concerns itself with the URL to the last successful build artifact of your build job. In this regard, I highly recommend NOT configuring your builds to name the files with dynamic data such as date, build number, git hash, etc. The filename is not something I'd consider a trustworthy source of build trivia even though it may be tempting to use it in that way. Besides, with a static link because the filename is consistent, you can do really awesome things more easily.

As it is basically an evolution of the script I've already written about, here's the list of changes:
  • Removed config file usage. Now the script only has a single dependency which you can edit in one line at the top of the file: APK_URL
  • Automatically handles multiple APKs in the directory (this is in case you want to use copies of the script for multiple APKs or just put the script in a generic working directory
  • Added pre-formatted JIRA template text file output for entering a new bug
  • Added pre-formatted JIRA template text file output for commenting on a bug you've worked on
  • Removed "clear" feature since many apps use the AccountManager API so an uninstall/reinstall is better most of the time
  • Automatically parses APK for launch activity to populate the launch command
  • Automatically handle case where no APK is available
  • Automatically handle case where no devices are available
The intended usage of the script is MOSTLY the same but in this case, you can better use it in situations where you may not have a TextExpander license. The pre-formatted JIRA comments are now baked into the script instead of into snippets in TextExpander, less flexible but faster to get new people started. Typical usage is when you're running a test pass or working on bugfix validations, you'd update the hardcoded APK_URL variable in the beginning of the file and run the script as new builds are available to test with. 

That's it. Sorry it's been over a year since my last posting. Life has been very busy. I've got a 7-month-old baby boy now, bringing the brood up to 3 delightful chaos machines. As I mentioned, I changed jobs. But I am definitely planning on updating more frequently. Expect the topics to shift slightly as my career has shifted slightly. Thanks for your time and see the GitHub gist below for the full details of the updated script.


  1. The like is wrong that behind the "here in this post" .

  2. Usually I never comment on blogs but yours is so convincing that I never stop myself to say something about it. keep updating regularly.
    spoken english classes in arumbakkam | spoken english classes in koyambedu | spoken english classes in chennai ayanavaram


Post a Comment

Popular posts from this blog

UiAutomator and Watchers: Adding Async Robustness to UI Automation

"I'm looking over your shoulder... only because I've got your back." ~ Stephen Colbert
After my recent UiAutomator review a user brought up an important question about the use of UiWatcher. The watchers serve as async guardians of the test flow, making sure the odd dialog window doesn't completely frustrate your tests. Having a tool that automatically watches your back when you're focused on the functional flow of your tests is awesome. 100% pure awesomesauce. Since the API documentation on watchers is scant and the UI Testing tutorial on the Android dev guide doesn't cover their use in depth, I figured I should add a post here that goes over a simple scenario demonstrating how to use this fundamentally important UI automation tool.

In my example code below, I'm using uiautomator to launch the API Demo app (meaning run this against an Emulator built in API level 17 - I used the Galaxy Nexus image included in the latest ADT and platform tools). The te…

Jenkins + Devices + AndroidJUnitRunner

New Android build system and test runner, same goose chase using undocumented features and hacks

As I've posted before, I am a big fan of Jenkins. It is extremely flexible, open source, and supported by a staggering array of plugins actively developed by engineers running over 100,000 instances of the server worldwide. With it's distributed node model, you can even build your own device cloud for hosting enterprise-scale automation, economizing hardware investments by sharing resources across multiple projects as well as speeding up automation by parallelizing test runs. I had been using a Jenkins-based system in the past to support instrumentation automation with Robotium quite happily. For the last couple years however, my work hasn't required that as much and I've found myself doing a lot more manual testing and using UiAutomator which didn't require a tight integration between the product codebase and the test code. As a result, I've been slow to adopt the…

Run-As Like the Wind: Getting private app data off non-rooted devices using adb run-as and a debuggable app

"You're some kind of big, fat, smart-bug aren't you?"
~Johnny Rico, Starship Troopers (1997) One of the most important things about writing bugs is making them descriptive but concise. Screenshots, video, debug logging, and hardware snapshots are all fairly standard or available to Android testers these days and can save you enormously on text when communicating what constitutes the bug. Sometimes though, the app gets into a weird state due to some transient data issue where you may not own the API or the complexity with forcing the app data into a certain state is prohibitively high. In those cases it is very handy to directly inspect the data the app has in its own directories.

Getting at this data is trivial on emulators and rooted devices but due to file system permissions, this data is otherwise completely private to the app itself. If you're like me, you tend to test using devices rather than emulators and you probably prefer not to root your devices since t…