Easily install Xcode templates.
-
to install in the
User Custom Path
:./template_helper
-
to install in the
Xcode application Path
:sudo ./template_helper
Copy & Paste the command below, or follow the guide.
Remember to replace TemplateName
with the actual name of your template.
-
to install in the
User Custom Path
:mkdir -p $HOME"/Library/Developer/Xcode/Templates/File Templates/Custom/[TemplateName].xctemplate/" && \ cp -R ./Templates/[TemplateName].xctemplate $HOME"/Library/Developer/Xcode/Templates/File Templates/Custom/"
-
to install in the
Xcode Application Path
:tempDir=`xcode-select -p`"/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/MultiPlatform/Source/" && \ sudo mkdir -p $tempDir/[TemplateName].xctemplate/ && \ sudo cp -R ./Templates/[TemplateName].xctemplate $tempDir
-
to install in the
User Custom Path
:mkdir -p $HOME"/Library/Developer/Xcode/Templates/Project Templates/Custom/[TemplateName].xctemplate/" && \ cp -R ./Templates/[TemplateName].xctemplate $HOME"/Library/Developer/Xcode/Templates/Project Templates/Custom/"
-
to install in the
Xcode Application Path
:tempDir=`xcode-select -p`"/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application" && \ sudo mkdir -p $tempDir/[TemplateName].xctemplate/ && \ sudo cp -R ./Templates/[TemplateName].xctemplate $tempDir
Done. You can now find your custom template in Xcode.
Congratulations! 🎉🎉
Want to create a custom template?
Start with Xcode's default template as a base.
sudo ./template_helper -g file
sudo ./template_helper -g project
These commands will provide a base template to start from.
- Get the base template
- Edit
- Install your custom template
👌👌
※ The base file template is equivalent to the Swift File.xctemplate.
※ The base project template is equivalent to the App.xctemplate.
You must change the Identifier
of your custom project template before installing it to the custom or Xcode application path.
Simply add the -r
option at the end.
Add sudo
when you want to remove a template from the Xcode application path, just like the install process.
./template_helper -r
Simply delete your custom template from the installed path.
Issues, Pull Requests, and adding your custom templates are always welcome.
Xcode Template Helper is under the MIT license. See LICENSE for details.