Skip to content

A swift module to manipulate Xcode projects(project.pbxproj),written in swift

License

Notifications You must be signed in to change notification settings

0x973/XcodeManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XcodeManager

Build Status Carthage compatible Platform

The better way to manage the Xcode project file (project.pbxproj) in swift. This swift module lets you automate the modification process.

Requirements

  • macOS 10.12+
  • Xcode 8+

Integration

Swift Package Manager

.package(url: "https://github.com/0x973/XcodeManager.git", from: "0.2.0")

Carthage

You can use Carthage to install XcodeManager by adding it to your Cartfile:

github "0x973/XcodeManager" ~> 0.2.0

Usage

  1. import module.
import XcodeManager
  1. Initialize the Xcode project file.
var project = try? XcodeManager(projectFile: "../.../xxx.xcodeproj", printLog: true)
  1. How to add static library in Xcode project?
project.linkStaticLibrary("../.../test.a")
  1. How to add framework in Xcode project?
project.linkFramework("../.../test.framework")
  1. How to add resources folder in Xcode project?
project.addFolder("../.../test/")
  1. How to add a single resources file in Xcode project?
project.addFile("../.../test.txt")
  1. How to modify the product name (display name)?
project.setProductName("TestProduct")
  1. How to modify the Bundle Identifier?
project.setBundleId("cn.x0x01.TestProduct")
  1. How to add new value?
project.setLibrarySearchPathValue("$(PROJECT_DIR)/TestProduct/Folder")
  1. How to add new value?
project.setFrameworkSearchPathValue("$(PROJECT_DIR)/TestProduct/Folder")
  1. How to control the CodeSignStyle(manual OR automatic)?
project.setCodeSignStyle(type: .automatic)
project.setCodeSignStyle(type: .manual)
  1. Complete modification? Write to a .pbxproj file!
let isSaveSuccess = try? project.save()
if (isSaveSuccess) {
	print("Done!")
}

About

A swift module to manipulate Xcode projects(project.pbxproj),written in swift

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages