UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Sherlock turbocharges your iOS simulator

Inspect and adjust any app in real time

Paul Hudson       @twostraws

There aren’t many times outside of WWDC where Apple developers see a new tool and immediately think “I need that in my life.” Sherlock by Inspired Code is one such tool: it injects itself into the iOS Simulator so that it can monitor views and adjust them in real time.

If you aren’t already thinking you need that, let me rephrase what I just said: you can inspect any app in the simulator, including system apps, see how they were built, and dynamically change large parts of them. Want to adjust the way image views fit their images, how text is aligned, or what background color is used? Sherlock does all those things and more – you just select the thing you want to change and click away until you’re happy.

When working with one of your own apps, Sherlock provides an unparalleled ability to experiment: navigate your way through your view hierarchy, select something you want to work with, then adjust any number of settings right from a macOS window. And when you want to compare your changes to the code, there’s even a “Jump to File” button that takes you straight there.

Even more impressively, you can attach a resizable screen to any app, allowing you instantly flick between various common iOS device sizes: iPhone 5, 6, and X are all available. Selecting a size immediately updates the layout to how it would look on the new device – it’s not just stretched to fit.

Right now the app is available as a free beta, so there really is no reason not to give it a try. In the future it would be great to see even more view properties exposed, and in particular the ability to visualize and dynamically adjust Auto Layout constraints would be particularly useful. Of course, it’s hard to be too demanding – Sherlock only just launched, so for it to be so impressive out of the box is quite remarkable.

For more information visit https://sherlock.inspiredcode.io or follow @getsherlockapp on Twitter.

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Bonus: Interview with the creators

Sherlock is being developed by Samuel Stone and Jake Lawson, and Sam was kind enough to take the time to answer a few questions about their motivations and plans, and even a little about it works.

Hacking with Swift: What was your inspiration for creating Sherlock?

Samuel Stone: Primarily, the amount of time we were wasting.

We both work on pretty large apps with a lot of nested screens, and a fairly involved process to onboard a new device, so we were burning a lot of time testing out design tweaks, rebuilding every time and then having to switch between simulators to confirm that the layout worked on all device types.

Similarly, we’d often find ourselves working on unfamiliar screens, wanting to know what UIViews and UIViewControllers we were actually looking at, and having to pause and unpause the app to confirm in Xcode’s visual debugger was frustrating.

 

HWS: Are there more features you're working on for the next release?

SS: Our focus at the moment is on making the existing features work as well as possible. Right now, that includes expanding the range of inspectable properties and making the Jump to File feature faster and more reliable for larger codebases.

Longer term, we’ve got a lot of ideas for exciting new features, such as a way to undo changes, or to have changes automatically reflected in your storyboards, but which ones actually make it into the app will depend on whether we can get them working in a reliable and consistent way.

 

HWS: The question many people will be asking is “how does it work?” What can you tell us?

SS: The Objective-C runtime and a lot of black magic.

Sherlock works in much the same way as Reveal or Xcode’s own visual debugger works - it loads a library into the target app to expose a way for other processes to interact with it.

It also uses some extra magic to inject itself without requiring any configuration by making use of the same sort of techniques that Xcode itself uses to speak to the Simulators.

 

HWS: Given its history in the Apple world, why did you choose the name “Sherlock”?

SS: Because we think it’s super smart, and using Sherlock is like having a detective for your app!

Regarding the history of the name, we knew a lot of people would comment on it, but that just made us like it even more.

And in the end, if Apple does decide to sherlock Sherlock, that’s not the worst thing that could happen. They’re the best positioned people to build something like this, so if they did it would be a big win for iOS developers in general.

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.