Post

Replies

Boosts

Views

Activity

Xcode 13 App + command line tool problems
I am attempting to add a command-line tool I wrote to bundle into a macOS app's Resources folder but I can't seem to get everything working together quite right. Initially I added the command line tool as an additional target in the macOS app Xcode project. This worked well for development, but when I archived the built app, I no longer had the normal app distribution options because the archive included the command-line tool product. So I thought "no problem, I really want this tool separated out as its own project anyway" so I created a swift package with an executable target. I was able to add the package to my app project, and select it as a build dependency, but I could not select the executable target in the Copy Bundle Resources or Copy Files build phase. When I manually added the executable built from the swift package, I could no longer notarize the app because the tool wasn't built with hardened runtime. So I created a new command-line tool Xcode project, copied the files, and added the project to the main app's workspace. I can select the subproject's target as a dependency. I could not select anything from that subproject for the Copy Bundle Resources phase, but I was able to select the target when I added a Copy Files build phase. However, what gets archived is both the app and a separate copy of the command line tool, so in the Organizer I don't have the option to "Distribute App". For now I manually added the built command line tool to the app project. This sucks but less than having to dig up a notarization script and updating it to handle manual notarization. But it this seems like something Xcode should handle properly so I must be missing something. Jim
1
0
1.4k
Sep ’21