Hi there,
I am trying to notarize my macOS app. My app is embedded with some licensed libraries.
I studied document about how to notarize an app and followed steps, my app can be uploaded to Apple notarize services and exported to use, but when I run my app it crashed. Under Xcode it shows
dyld: Library not loaded: libMotionEngine-bundle.3.dylib
Referenced from: /Users/kensington/Library/Developer/Xcode/DerivedData/KensingtonWorks-dekfhdrucwmhfogmapgkwzsawyfm/Build/Products/Debug/KensingtonWorks for Ultimate Presenter.app/Contents/MacOS/KensingtonWorks for Ultimate Presenter
Reason: image not found
I've tried several way to run my app successfully including make libraries Required/Optional under Linked Frameworks and Libraries and add my libraries to Embedded Binaries, unfortunately all failed. List conditions and environments below:
Xcode version: 10.3 / 11
macOS: 10.14.5/10.14.6
Libraries signed: No
Runtime Hardened chosen: Allow DYLD Environment Variables & Disable Library Validation
Below is piece of my library information:
Load command 8
cmd LC_VERSION_MIN_MACOSX
cmdsize 16
version 10.11
sdk 10.11
Load command 9
cmd LC_SOURCE_VERSION
cmdsize 16
version 0.0
Load command 10
cmd LC_LOAD_DYLIB
cmdsize 56
name libMotionEngine-core.3.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 3.1.4
compatibility version 3.0.0
Load command 11
cmd LC_LOAD_DYLIB
cmdsize 48
name /usr/lib/libc++.1.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 120.1.0
compatibility version 1.0.0
Load command 12
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libSystem.B.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 1226.10.1
compatibility version 1.0.0
Load command 13
cmd LC_FUNCTION_STARTS
cmdsize 16
dataoff 54872
datasize 320
Load command 14
cmd LC_DATA_IN_CODE
cmdsize 16
dataoff 55192
datasize 0
Load command 15
cmd LC_CODE_SIGNATURE
cmdsize 16
dataoff 84352
datasize 19696
Appreciate any suggestion/opinions!
On the library front, you wrote:
they are located in
, I don't have source code/usr/local/bin
I recommend that you raise this issue with the library’s vendor. Installing libraries globally like this is problematic on a modern Mac because of library validation. The library has to be signed by someone, either you or the vendor:
If you sign it, only your apps will be able to load it, in which case you don’t want it installed in
. Ideally you’d move it to/usr/local/bin
within your app but, even if you don’t do that, you need to put it inContents/Frameworks/
so that you don’t conflict with other folks using the same library./usr/local/MyProductName/bin
If the vendor signs it, apps with library validation enabled won’t be able to load it.
Unless the library is doing something particularly wacky, it should be feasible to move it to
Contents/Frameworks/
. You may be able to do that yourself using
install_name_tool
but I think you’d be better off working with the vendor to come up with an authorised solution.
With regards your HID problem, it’s likely you’re hitting one of the new restrictions around input monitoring. WWDC 2019 Session 701 Advances in macOS Security has the details.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"