Search code examples
xcodemacossteamworks-api

Can't get Xcode to bundle libsteam_api.dylib with a build


I've put libsteam_api.dylib in the project folder. I've dragged it into the 'frameworks' folder in the project, and added it to the target. It shows up in the list of linked libraries

When I build and run, I get a "Library not loaded" error, and libsteam_api.dylib is nowhere to be found in the application bundle.

If I then manually copy the library into the MacOS folder of the bundle alongside the executable, it runs fine, but I don't want to have to keep doing that for every build

How do I get Xcode to include the library alongside the executable?


Solution

  • Add a Copy Files build phase to your target, copying the dylib into the Frameworks folder of the app package.