Add dynamic library to a target framework as part of the build process in XCode

206 views Asked by At

I've got a workspace project with an app target and a framework target.

Inside of the framework target, I've got a dynamic library and its headers. The dynamic library is embed and sign. Everything works fine.

Now, we want to make the process of updating the dynamic library a bit better, so instead of keeping the dynamic library on the project, we want to download it from artifactory.

So as part of the build process we want to:

  • Download the dynamic library
  • Sign the dynamic library
  • Added it to the target.

I've created a script in Build Phases with the following ( note that instead of downloading the dynamic library I'm coping it from a local directory for now ):

cp "/Users/myuser/Desktop/temp/Frameworks/mydynamicLib.dylib" "$DERIVED_FILE_DIR/mydynamicLib.dylib"
DESTINATION="$DERIVED_FILE_DIR/mydynamicLib.dylib"

if [ ! -d $DESTINATION ]; then
    codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements $DESTINATION
fi

Also the Output Files field has the following file: $(DERIVED_FILE_DIR)/mydynamicLib.dylib

The dynamic library is in the Derived file folder an for the logs it seems to be signed but when I build my framework, it simply can't find the symbols of the library.

Any ideas?

0

There are 0 answers