[Xcode] Xcode Code Snippets : Sync on your devices

less than 1 minute read

Create a Snippet on Xcode

  • Create

xcode-code-snippet

  • Edit (Command + Shift + L)

xcode-code-snippet

Sync the code snippets using the iCloud Drive

  • Code snippets path
/Users/{USERNAME}/Library/Developer/Xcode/UserData/CodeSnippets/
  • Copy the code snippets to the iCloud Drive
$ mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/XcodeUserData

$ mv -v /Users/{USERNAME}/Library/Developer/Xcode/UserData/CodeSnippets ~/Library/Mobile\ Documents/com~apple~CloudDocs/XcodeUserData
  • Link the code snippets with your devices
$ rm /Users/{USERNAME}/Library/Developer/Xcode/UserData/CodeSnippets

$ ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/XcodeUserData/CodeSnippets /Users/{USERNAME}/Library/Developer/Xcode/UserData/

Reference

Leave a comment