Install Xcode Template with Ease.
- to install in
User Custom Path
swift install_template.swift
- to install in
Xcode application Path
sudo swift install_template.swift
Copy & Paste command, or followed guide bellow.
And don't forget to replace [TemplateName] with your real template name.
[ File Template ]
- to install in
User Custom Path
.
mkdir -p $HOME"/Library/Developer/Xcode/Templates/File Templates/Custom/[TemplateName].xctemplate/" && \
cp -R ./[TemplateName].xctemplate $HOME"/Library/Developer/Xcode/Templates/File Templates/Custom/"
or
copy [TemplateName].xctemplate
manually to $HOME"/Library/Developer/Xcode/Templates/File Templates/Custom"
Directory (File Templates/Custom directory may not exist. It's default)
- to install in
Xcode Application Path
tempDir=`xcode-select -p`"/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source/" && \
sudo mkdir -p $tempDir/[TemplateName].xctemplate/ && \
sudo cp -R ./[TemplateName].xctemplate $tempDir
or
Go to Application directory, select 'Show Package Contents' menu of Xcode application icon. Then browse to: "Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source/"
. and add [TemplateName].xctemplate
to the directory.
[ Project Template ]
- to install in
User Custom Path
.
mkdir -p $HOME"/Library/Developer/Xcode/Templates/Project Templates/Custom/[TemplateName].xctemplate/" && \
cp -R ./[TemplateName].xctemplate $HOME"/Library/Developer/Xcode/Templates/Project Templates/Custom/"
or
copy [TemplateName].xctemplate
manually to $HOME"/Library/Developer/Xcode/Templates/Project Templates/Custom"
Directory (Project Templates/Custom directory may not exist. It's default)
- to install in
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 ./[TemplateName].xctemplate $tempDir
or
Go to Application directory, select 'Show Package Contents' menu of Xcode application icon. Then browse to: "Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application"
. and add [TemplateName].xctemplate
to the directory.
Done. Now you can find your custom template in Xcode.
Congratulations! 🎉🎉
Do you want to create custom template? Do this.
sudo swift install_template.swift -g file
sudo swift install_template.swift -g project
These commands provide base template you can start with.
- Get base template
- Edit
- Install
👌👌
※ Base file template is equal to Xcode Swift template.
※ Base project template is eqaul to Xcode Single View Application template.
You must change Identifier
of your custom project template before install it to custom or xcode application path
Add sudo
like install_template if you want to remove a template within xcode application path.
swift remove_template.swift
Just delete your custom template from the path that you have installed
- Documentation for TemplateInfo.plist
- Add more templates
Issues, Pull Requests and adding your custom template are always welcome.
Xcode Template Helper is under the MIT license. See LICENSE for details.