Can't deploy framework to /Library/Frameworks

I'm trying to deploy a framework to /Library/Frameworks but I'm not sure if I'm dealing with a permissions issue or build configuration issue, or something else.


In the framework target's Deployment section I've set:

Deployment Location: Yes

DSTROOT: /

INSTALL_PATH: /Library/Frameworks

Skip Install: No


I get the following error when building for running:


SymLink /Library/Frameworks/MyKit.framework/Versions/Current A (in target 'MyKit' from project 'MyKit')

cd /Users/rayascott/Developer/bitbucket/MyApp/MyAppSpace/Projects/MyKit

/bin/ln -sfh A /Library/Frameworks/MyKit.framework/Versions/Current


error: unable to create symlink at '/Library/Frameworks/MyKit.framework/Versions/Current' (in target 'MyKit' from project 'MyKit')


Nothing is deployed to /Library/Frameworks/.


I've given Xcode full disk access, but I'm guess that's not enough for it to access system folders. Am I better off with a zsh script and sudo from the command line to deploy this? I do really need to place it there, as I have a priviledged helper tool that needs to access this framework.


On a side note: how would a user of my app be able to deploy this framework to /Library/Frameworks if they aren't an Administrator? Would I then have to deploy to ~/Library/Frameworks? But I see that's discouraged. How does everyone else get this working in for a deployed release build? Thanks.

Accepted Reply

Ideally, you would just embed such frameworks inside your app. If you are developing a framework along with an app, you can configure an Xcode workspace that contains both the app and the framework. Xcode will know how to properly sync them together. The framework project and the app project need to by side-by-side. If you are just trying to deploy a project, you would create an installer package. When you install it, as root, it will be able to write to /Library/Frameworks.

Replies

Ideally, you would just embed such frameworks inside your app. If you are developing a framework along with an app, you can configure an Xcode workspace that contains both the app and the framework. Xcode will know how to properly sync them together. The framework project and the app project need to by side-by-side. If you are just trying to deploy a project, you would create an installer package. When you install it, as root, it will be able to write to /Library/Frameworks.

I've got a Workspace with multiple projects, app targets and frameworks, all side-by-side and working correctly, except for this target. My workspace builds a bunch of products that work together with XPC, so one of those build targets isn't a traditional bundle, it's just a binary, that's deployed to /Library/PrivilegedHelperTools so embedding isn't an option for this target.


Thanks, I'll have a look at installer pacakges, that might answer the questions I have. For now I think I'll just sudo copy it. I was just hoping Xcode was privileged enough to install into a location that's recommended for framework deployment, but I guess not.