Reputation: 744
I am developing an app in swift, on macOS Mojave with Xcode 10, which has been running fine during development.
As I am preparing for deployment I discovered that running the app on another machine results in an immediate crash. Running from the terminal produces a single line message “Killed:9”. If I start it from lldb, the app runs fine. If I switch off it’s entitlements in Xcode (sandbox and keychain sharing) then it runs fine.
I created another simple test app with the same entitlements and that runs fine from the command line.
I have been through my project settings and scoured the internet, but can’t work out what I am missing.
Any ideas folks ?
Upvotes: 3
Views: 1504
Reputation: 744
After exploring all sorts of different avenues, it turns out the problem was to do with code signing.
I had an embedded dynamic library which expected to be in /usr/local/lib
This was fixed this by a run script build phase to change the name of the library to @rpath/lib...
in each of the frameworks that used it with install_name_tool
.
This worked fine while debugging, but for release Xcode was signing the libraries during the copy phase, and the install_name_tool
script was corrupting the libraries signature.
I tried various ways to resign the library and/or app after this run script phase, but nothing worked. Finally I had to fix the library itself before building the rest of the app, and do away with the install_name_tool
script which was breaking the signature. The app was finally able to run again from a release build.
Upvotes: 2