It can sometimes be useful or even necessary to browse the sandbox of an application that's running in a simulator. Finding the application's sandbox isn't trivial, though. Xcode nor the simulator offer this type of functionality.
Finding the application's sandbox is cumbersome and the location of the sandbox usually changes with every major release of Apple's developer tools. It's possible to find the sandbox if you know where to look.
It's unfortunate Xcode or the simulator doesn't make this easier. For years I've been using SimPholders to make this task less frustrating.
Because SimPholders tends to break with every major release of Apple's developer tools, I switch to OpenSim from time to time.
OpenSim is an open source alternative to SimPholders written in Swift and created by Sheng Luo. You can install OpenSim through Homebrew, but I prefer cloning the GitHub repository and building the application from source. We are developers. Right?
Installation
The installation is easy. Clone the repository and open the project. Build the application to install it.
git clone git@github.com:luosheng/OpenSim.git
I recommend creating a release build if you plan to use OpenSim in your workflow. That's more convenient.
Exploring Simulators
Like SimPholders, OpenSim is easy to use and provides the functionality that's missing from Xcode and the simulator. OpenSim shows up as a menu bar item in the top right. When you click the menu bar item, it lists the simulators that have applications installed.
Under the hood, OpenSim uses Xcode's command line tools to fetch the list of simulators. This may cause issues if you have multiple versions of Xcode installed on your development machine. You can use the xcode-select
command to manage the active developer directory for Xcode. You can also make this change in Xcode's preferences under the Locations tab.
The most useful feature of OpenSim is the ability to open the sandbox of an application in Finder. Choose the simulator you're interested in, select the application, and click Reveal Sandbox in Finder.
OpenSim also offers shortcuts for copying the path of the sandbox to the clipboard, opening the sandbox in terminal, or removing the application from the selected simulator. OpenSim also works seamlessly with iTerm if you have it installed.
It's Not Perfect
I'm glad SimPholders and OpenSim are available, but they offer features that should be built into Xcode or the simulator. It's unclear why Apple hasn't made it easier to explore the sandbox of applications that are installed in a simulator.
OpenSim is the application I use, but there are other open source initiatives available, such as simsim.