How to install just Swift and one library/package

I wrote an Automator script to analyze PDFs for the company Support staff. The script calls /usr/bin/swift for execution. It requires importing Foundation and PDFKit.

I shutter to force them to install Xcode as it consumes so much file space.

Is it possible to just linstall Swift (and I’ve seen links saying this is possible) and then to install PDFKit?

You may be able to do what you want by installing the Command Line Tools package from Apple. PDFKit itself is a framework included with the system, so I think your tools should be able to use automatically, though I've never tried.

1 Like

Why not just create an app?

1 Like

Thanks for the suggestion! I’ll try it.

Because of corporates concern it could get compromised. I’d have to get it into the App Store of go through hoops to get it properly signed.

I didn’t ever explore that given all the hoops I go through to download and run 3rd party apps myself.

You can notarise your own apps without having to go through the App Store.

That way the app is cryptographically signed so cannot be altered without macOS catching it.

1 Like

You don't have to get it into the App Store, you are allowed to distribute apps outside of the App Store. Developer ID signing is a next-next-finish process, nothing complicated.

It's harder to compromise an app than a script or a cli tool. With proper MDM setup, non-developers probably wouldn't even be able to run a random script without any signature.

2 Likes

Ok - never did that so fear of unknown. But I will definitely delve into this.