A command line interface to make a project for iOS Single View App.
brew install manicmaniac/tap/xcnew
Firstly you need to setup local repository.
git clone https://github.com/manicmaniac/ports.git
Then add the repository to MacPorts sources.
sudo ruby -pi -e 'puts "file:https://#{Dir.pwd}/ports" if /^rsync:/' /opt/local/etc/macports/sources.conf
Now you can install xcnew from ports.
sudo port install xcnew
Make sure you set a developer directory to Xcode.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Then download the latest package.
curl -LO https://github.com/manicmaniac/releases/latest/download/xcnew.pkg
And install it to /usr/local/bin/xcnew
.
sudo installer -pkg xcnew.pkg -target /
git clone https://github.com/manicmaniac/xcnew.git
sudo make -C xcnew install
You can change the install location by setting $PREFIX
environment variable.
sudo make -C xcnew install PREFIX="/opt/local"
xcnew - A command line interface to make a project for iOS Single View App.
Usage: xcnew [-h|v] [-i <ORG_ID>] [-tcCosS] <PRODUCT_NAME> [OUTPUT_DIR]
Options:
-h, --help Show help and exit
-v, --version Show version and exit
-i <ORG_ID>, --organization-identifier <ORG_ID>
Specify organization's identifier
-t, --has-tests Enable unit and UI tests
-c, --use-core-data Enable Core Data template
-C, --use-cloud-kit Enable Core Data with CloudKit template (overrides -c option)
-o, --objc Use Objective-C instead of Swift (overridden by -s and -S options)
-s, --swift-ui Use Swift UI instead of Storyboard
-S, --swift-ui-lifecycle Use Swift UI lifecycle (overrides -s option)
Arguments:
<PRODUCT_NAME> Required TARGET_NAME of project.pbxproj
[OUTPUT_DIR] Optional directory name of the project
Xcode >= 12.5 && Xcode <= 14.2.0
.
Just by reverse engineering and utilizing Xcode private frameworks, IDEFoundation
and Xcode3Core
.
Simply too difficult to implement this kind of magic in Swift.
This program is distributed under the MIT license. See LICENSE for the detail.