How to create or define a new target in a custom Xcode project template
TL;DR: What XML snippets do I add to my TemplateInfo.plist files, to create a second compiler target when creating a new Xcode project?
While working on my own Xcode project template, I’m trying to have KIF integration testing working in a ‘out of the box’ sort of way. KIF requires you to duplicate your regular target and then modify some properties. This is normally done manually, but it both takes time and leaves a margin for error, while it’s so mundane it could be automated.
For clarity, I’m looking to create the second target in this screenshot automatically:
I got quite far with the whole template customization, but I just can’t figure out how to create another target, even though the templates create one for unit testing if you hit that checkbox. How does Apple do that?
Have a look at the template project over at my github repository. If you want to see what I’m doing with KIF (even though for the answer of this question this is should not be necessary), have a look at the plist in the KIF Integrations.xctemplate folder.
- didRegisterForRemoteNotificationsWithDeviceToken never called on specific device
- Can somebody give a snippet of “append if not exists” method in swift array?
- iOS: Pulsing red double-height status bar
- Xcode 7.0.1 - Invalid Swift Support - The SwiftSupport folder is missing.
- Decompilation possibilities in iOS and how to prevent them
- UITableView deleteRowsAtIndexPath crash when delete last record
Solutions Collect From Internet About “How to create or define a new target in a custom Xcode project template”
If I understand your question correctly…
To duplicate the Build Target automatically without manually creating a new one and setting it up select the one you want to duplicate and press CMD+D
(Instructions on how to do the same things but with (the more likely) build schemes (for future users who wonder to this question) are below:
In xCode click Product (top bar… across from File, Edit, View, etc.) and then at the bottom of the drop-down menu click “New Scheme”.
To duplicate your scheme (like you suggested) click “Edit Scheme” instead of “New Scheme” then click “Duplicate Scheme”
- iOS unique user identifier
- Under iOS 7, how do I hide and show status bar on the fly (whenever I want to)
- How to compare two case insensitive strings?
- How to adjust your scrollview for the keyboard in swift 3+
- getting data from plist to NSMutableArray and writing the NSMutableArray to same plist iPhone
- AnyObject to Array?
- iOS AdMob memory leak?
- iOS App Won't start on Testflight Ad Hoc Distribution
- How to clear NSLog output from code?
- iOS SDK – Image masking
- Why does UITextField lock up when setting itself to delegate
- Build lags for a full minute on “Performing Install Actions”
- How to check if a view controller can perform a segue
- Do I still need an Entitlements.plist file for an ad-hoc build?
- Where to get iOS system symbols for other iOS versions