Add a keyboard shortcut to Swift package command plugins

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From ๐ฉ๐ช and happily living in ๐บ๐ธ
In this blog post I will explain how you can define a keyboard shortcut to quickly trigger a Swift package command plugin in Xcode 14.

If you are unfamiliar with Swift package plugins and their recent Xcode integration, I recommend reading the following article.
Unfortunately, it is not possible to define a key binding from the Xcode preference ๐


I created a feedback item for Apple .. maybe this functionality will get added in the future. But there is a workaround!
A big shoutout and thanks to Martin Fiebig who explained this workaround to me ๐
You can bind any menu command via your Mac's System Preferences. Select Keyboard -> Shortcuts -> App Shortcuts and add a new item.
IMPORTANT: The menu title needs to be an exact match!


You will see the shortcut in Xcode once you added the app shortcut.

And here is the proof that it works ๐




