Sign iOS dylib before building
Asked Answered
H

1

2

I have a C++ library in my hands that needs to be compiled in a form of .dylib for iOS. I have used iOS-cmake and that tool has built a library and created Xcode solution where I can find the library in targets section.

So I open Xcode solution, choose the target and hit Build which results in an error:

Signing for "my_library" requires a development team. Select a development team in the Signing & Capabilities editor.

The problem here is that library targets in Xcode doesn't have Signing option. Target config contains only these tabs:

enter image description here

So my question is - how to get around that? Can I sign a library target using Run Script?

Please advise me how to approach this task. Thank you in advance!

Harlamert answered 18/5, 2021 at 7:32 Comment(2)
I have the same blocker. Found any solution?Ineffectual
Have you checked: #39524648? This seems to be for an older version but should ideally translate well.Steapsin
A
0

There are multiple ways to solve this problem.

  1. You sign the library manually everytime after building the library with iOS-cmake using codesign command by providing appropriate signing identity. This involves lot of manual work, so I would prefer you to go with approach 2
  2. You can automatically sign all the included libraries using run script by adding below command codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" "$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/<library_name>" Here signing identity can be either "$EXPANDED_CODE_SIGN_IDENTITY" or "$CODE_SIGN_IDENTITY", it depends on your workspace structure if you are using cocoapods or not

The idea in the second approach is, xcode (xcodebuild) provides few environment variables while building the project, so we try to leverage the same signing identity which was used for signing the application to sign the library

Ansermet answered 12/7, 2021 at 3:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.