Open chockenberry opened 2 years ago
This isn't a duplicate of #21 since these are not the "built-in" simulators. It's interesting to note that the same xcrun
commands can be used both downloaded and built-in simulators (and may be easier to use in a sandbox).
I've indeed looked into this, and unfortunately there are two problems:
Simulator runtimes lives inside /Library/Developer/CoreSimulator/Images
- please note this is NOT a user ~/Library/Developer
folder that DevCleaner has access to. To write/delete files from this folder you need a root access, not only file access. There's also more to just delete files, some bookkeeping has to be done, which usually simctl
command do.
Ok, so why not run xcrun simct
as you noticed? Well, sandboxed apps can't run shell scripts (well, they can but within their sandbox), there's theoretical way for doing that, but that has to involve user manually install scripts that has to be installed (?)
The only real solution would be to have a non-AppStore and non-sandboxed version of DevCleaner, which I'm thinking more and more about. MAS is giving a lot, but also it's limiting the app like that.
Believe me, I understand the challenges of running scripts on behalf of the user:
https://www.objc.io/issues/14-mac/sandbox-scripting/
I wrote that article many years ago and have since had issues getting it through App Review. I don't think the second option is viable as a long-term solution. I also don't want any app to run with root access, so the first option is a non-starter.
So let's explore the Mac App Store:
Versus distribution on a website:
The biggest differentiator for me is collecting the money. On the Mac App Store, it took me 30 seconds to give you $10. If I had to do that on a website where I entered a credit card, that would be a barrier. If you built a Stripe/ApplePay integration into the app, that would be nearly as good as the Mac App Store.
I would also note that I always use the website version of the tools I need for development. I know it will be a better product in subtle ways. If you go the way of Panic, Bare Bones, GitHub, and Leitmotif, no developer will bat an eye.
Seems to me that DevCleaner needs to leave the Mac App Store.
I just discovered that xcrun simctl
is just a frontend for a binary located in /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
. If you make user select the Xcode.app folder and save it as a security scoped bookmark, you may be able to launch that script on behalf of the user.
Still, much easier to make the app work outside a sandbox.
Yeah, but even if I could run it from the app (I'm not sure if sandboxed apps can ran other programs at all? Even if they have access to binary), it'll still be sandboxed within DevCleaner sandbox and not running on the real filesystem.
So yeah, working outside the sandbox is probably the way to evolve the app, and I'm mentally prepared for that, and I'll start working on it when I'll have some time.
Beginning with Xcode 14, separate SDK runtimes are downloadable for tvOS and watchOS. The disk images for these SDK runtimes are stored in /Library/Developer/CoreSimulator/Images and are quite large (typically 3-4 GB in size).
These images are mounted at /Library/Developer/CoreSimulator/Volumes. You can see them in Disk Utility under "Disk Images".
The downloads can be managed in Xcode's preferences in the Platforms panel. The same information can be viewed on the command line with:
(Add
-v
to get a more verbose listing.)The platform downloads can be deleted with:
Since DevCleaner's job is to get rid huge amounts of Xcode stuff you don't need anymore, it seems like this would be a good thing to support in the app.