Add a keyboard shortcut to Swift package command plugins

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 馃槉

About the author
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 馃嚭馃嚫
Comments
Join the discussionNo comments yet. Be the first to comment.



