Skip to main content

xcrun simctl - like ADB but for the other guys

So I'm definitely not an iOS guy. I barely have the bandwidth to keep tabs on the latest and greatest features of the consumer-facing stuff. Keeping in touch with the developer/tester tools is hard too. So it shouldn't be a surprise that I'm just now finding out about xcrun simctl

If you're an Android guy and you're familiar with ADB, this is a LOT like that. In fact, after looking through the documentation on xcrun simctl and reading up on it on StackOverflow, it occurred to me that it is finally possible to do what I do on Android with my favorite script ever but on iOS devices/simulators instead. For reference, here's my blog post about that script.

The bottom line is that as a tester who regularly uses multiple devices concurrently, the shell script in conjunction with TextExpander is a massive time and mental-space saver for me, making me a whole lot faster and more effective at my job. If you're an iOS tester or you know someone who is, do them a favor and point them at that. If you're an iOS developer and you want to build a highly testable app, consider how powerful custom URI handling along with "xcrun simctl openurl" will be for your project.

Short. Sweet.

In completely non-iOS news, my blog post on using the Factory Pattern for addressing system UI fragmentation in your UiAutomator tests is forthcoming. I've got quite a bit of sample code to put together since I'll be publishing a whole test project, some build/deploy/run scripts, screenshots galore, and all that work takes time that is in short supply these days. Please bear with me. I hope it will turn out as awesome as it seems like it is in my head.

Comments

  1. Okay, let me be clear: I know that xcrun simctl didn't break completely new ground on iOS. It DOES simplify what used to be a fairly unwieldy nightmare though. One area I'd love to see them improve is in making the output more script-friendly. "xcrun simctl list" returns a bloated and unwieldy blob of crap compared to "adb devices". Still though, it is fairly obvious that the new hotness is an improvement and I look forward to any progress Apple makes in that area.

    ReplyDelete
  2. Personally I use libimobiledevice for iDevice scripting:

    http://technotesonthego.blogspot.com/2013/10/install-libimobiledevice-on-mac-os-x.html

    ReplyDelete

Post a Comment

Popular posts from this blog

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…

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…

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…