Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export the CodeSnippets on Xcode10?

Tags:

xcode10

  • Firstly, I want to export the CodeSnippets to my other computer.
  • Secondly, I tried to copy the ~/Library/Developer/Xcode/userData/CodeSnippets directory to my other computer under the same directory,but it doesn't work.
  • Lastly, I used xcode10 to create a Code Snippet on my other computer, and go to ~/Library/Developer/Xcode/userData,but I didn't found CodeSnippets directory.
  • So,I don‘t how to do it?
like image 602
Corbin Avatar asked Jul 21 '26 16:07

Corbin


1 Answers

  • Lastly, I used xcode10 to create a Code Snippet on my other computer, and go to ~/Library/Developer/Xcode/userData,but I didn't found CodeSnippets directory.

The reason why you weren't able to locate CodeSnippets directory on your other computer might be due to the directory been hidden.

Import/Export Custom Snippets

We can find our custom code snippets at the path ~/Library/Developer/Xcode/UserData/CodeSnippets/.

Since Library is a hidden folder, we can either open this path with the terminal command:

open `~/Library/Developer/Xcode/UserData/CodeSnippets/`

Or you can let the Finder shows the hidden files with the terminal command:

defaults write com.apple.Finder AppleShowAllFiles true && killall Finder

If you want to hide again the hidden files:

defaults write com.apple.Finder AppleShowAllFiles false && killall Finder

Every time we add/remove files in this folder, we must restart Xcode.

like image 115
aashish tamsya Avatar answered Jul 26 '26 07:07

aashish tamsya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!