I'm trying to create a Swift application programmatically from the "Command Line Tool" template, and I can't solve the error No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
.
Here are the steps I followed :
Base code
Create an "AppDelegate.swift" class, and delete the "main.swift" file.
Fill "AppDelegate.swift" with the following code:
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
}
}
Create and register an "Info.plist" property list
Create a new group named "Supporting Files", and add a new "Property List" named "Info.plist".
In "Info.plist", add a row with the key "Principal class", of type "String", and write "NSApplication" in the Value column.
Register this property list in your project: In "Build Settings", in the "Packaging" part, edit the "Info.plist file" row and write appName/Info.plist
(appName must be changed according to your Project name).
Is there another thing to do to register this Info.plist file ?