• Stars
    star
    484
  • Rank 90,298 (Top 2 %)
  • Language
    Swift
  • License
    GNU General Publi...
  • Created almost 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A macOS tool help you handling project.pbxproj files. Written in Swift 5!

Language Build Status GitHub release Twitter Follow

pbxprojHelper

pbxprojHelper is a GUI tool developed with Cocoa and Swift 5 for parsing and changing Xcode projects configuration. You can also use pbxproj as a command line tool in terminal.

Main Window

Languages

中文

Articles

pbxprojHelper--Xcode工程文件助手

Let's Talk About project.pbxproj

Installing pbxprojHelper

GitHub

You can clone the source code of pbxprojHelper, then compile and run it by Xcode.

You can also download pbxprojHelper.app and pbxproj tool with its latest Releases on GitHub.

App Store

Mac App Store link: (Only pbxprojHelper.app)

https://itunes.apple.com/cn/app/pbxprojhelper/id1160801848

Swift package manager

Add .Package(url: "https://github.com/yulingtianxia/pbxprojHelper.git", majorVersion: 1) to dependencies in your Package.swift.

Quickstart

Use pbxprojHelper (Native Cocoa UI App)

  1. Choose your project file by clicking "Select" button. Both .xcodeproj and .pbxproj file extensions are supported. The path of project file you selected will be displayed on the text field. The outline view shows data of project file.
  2. Choose configuration file by clicking "Choose JSON File". Configuration file contains changes you want to make to your project. You can create a configuration file with json format, or generate it using "JSON Configuration Generator" tool provided by pbxprojHelper. The outline view will refresh data after you choose a json file.
  3. Clicking "Apply" button will write changes made by json configuration to project file you selected.
  4. "Revert" button does a reverse operation of "Apply" button.

Use pbxproj (Command Line Tool)

You should move pbxproj to /usr/local/bin/, so you can execute pbxproj command conveniently in terminal.

Here is the Usage:

Usage: pbxproj [command_option] file
Command options are (-convert is the default):
-compare modified_file -o path          compare modified property list file with property list file and generate a json result at the given path
-apply json_file                        apply a json file on property list file
-revert                                 a json file on property list file
-recover                                recover a property list file from latest change
-convert                                rewrite a property list file in xml format

Outline View

The outline view shows entire data of project.pbxproj file. You can expand an item if it's type is collection(dictionary or array). For example, the value for key objects is an dictionary which contains 34 key-value pairs. You can expand objects to view its content. For key-value pairs of dictionary, the 1st/2nd column means "Key"/"Value". If the value is a collection(not String or Number.ect), the 2nd column shows a description of the collection; For elements of array, the 1st column means "Element", but the 2nd column contains nothing.

You can copy the text in outline view by just a click on the text. If you want to copy the whole keypath from root node, double click it.

Filter

You can filt the content of outline view by typing a string in the "Filter" Text Field. It's not case sensitive.

Project File Path

There is a pull-down menu which shows five latest used file paths when you click the path of your project file. So you can choose your project files in common use quickly.

JSON Configuration File

Configuration Rules

The configuration file contains a list of rules. Here is an example of configuration:

{
  "insert" : {
    "objects.A45A665D1D98286400DBED04.children" : [
      "a",
      "b",
      "c"
    ],
    "classes" : {
      "xixihaha": 5,
      "aaaaa" : "养小鱼"
    }
  },
  "remove" : {
    "objects.A45A666D1D98286400DBED04.buildSettings" : [
      "ALWAYS_SEARCH_USER_PATHS"
    ]
  },
  "modify" : {
    "archiveVersion" : "2"
  }
}

The root object must be a dictionary with 3 key-value pairs. You can "insert", "remove" and "modify" values through their key paths in project.pbxproj file.

There are two series of configuration rules in the newest configuration file: "forward" and "backward". They respectively corresponded to "Apply" and "Revert" Functions.

Insert

The example above inserts 3 elements("a","b","c") into the children array. Note that the keypath "objects.A45A665D1D98286400DBED04.children" must be valid. The value of "children" should be an array and the value of "classes" should be a dictionary. In a word, the type of incremental data should be same with original data in project.pbxproj file.

Remove

The example above removes a key-value pair whose key equals "ALWAYS_SEARCH_USER_PATHS" from a dictionary named buildSettings. The value of keypath should always be an array. This array contains keys/elements you want to removed from dictionary/array.

Modify

Modify the value of keypath, so easy.

Configuration Generator

Programmer is lazy. I can't stand wasting my time on writing json files, so I create the powerful tool called "JSON Configuration Generator":

JSON Configuration Generator Window

There are two ways to open the "Generator" window:

  1. Menu -> Window -> JSON Configuration Generator
  2. Key Equivament: ⇧⌘0

You can use it in an oversimplified and crude way. Just select two project files and json save path, then click the "Generate" button, and you will get a json file containing changes between modified and original project file.

Conversely, you can use this json file when you want to apply these changes to certain project file again. Please take care of this json file.

Backups

Each time you click "Apply" button on main window, pbxprojHelper will use original or last modified project file to create backup file with "backup" extension in "Documents" folder of sandbox first, and then apply changes on project file.

"Revert" button uses these backups to revert project file to the latest version.

Encoding

When generating project.pbxproj file with xml format, chinese characters will be translated to Unicode mathematical symbols. For example, "杨萧玉" in OpenStep style file will be converted to <string>&#26472;&#33831;&#29577;</string> in XML style. This is because Xcode will encode XML content(regarded as ASCII encoding) into Unicode again when convert XML project file to OpenStep project file.

LICENSE

These works are available under the GNU General Public License. See the LICENSE file for more info.

More Repositories

1

FishChat

Hook WeChat.app on non-jailbroken devices.
1,118
star
2

TBActionSheet

A Custom&Powerful Action Sheet For iOS. 一个 ActionSheet 满足所有样式!超高自由度的可定制!
Objective-C
950
star
3

BlockHook

Hook Objective-C blocks. A powerful AOP tool.
C
836
star
4

MessageThrottle

A lightweight Objective-C message throttle and debounce library.
Objective-C
823
star
5

AppOrderFiles

The easiest way to generate order files for Mach-O using Clang. Improving App Performance.
Objective-C
652
star
6

TBUIAutoTest

Generating UI test label automatically for iOS.
Objective-C
349
star
7

FuckFakeGitHubStars

GitHub 虚假 Star 净网行动
Python
265
star
8

Core-ML-Sample

A Demo using Vision Framework building on Core ML Framework
Swift
218
star
9

YXYDashLayer

Colorful Rounded Rect Dash Border
Objective-C
175
star
10

SimilarImageHunter

Mac 上寻找相似内容的图片工具
Objective-C
172
star
11

HardChoice

有时候作抉择真的很痛苦,Swift写的生活类APP
Swift
92
star
12

Spiral

A Game Developed with Swift and SpriteKit
Swift
88
star
13

AudioEmotion

Recognize Audio Emotion.
Python
86
star
14

BlockTracker

Tracking block args of Objective-C method based on BlockHook
Objective-C
78
star
15

PhotoAssessment

Photo Assessment using Core ML and Metal.
Objective-C
72
star
16

ColorAtom

用SpriteKit写的关于正能量的小游戏
Objective-C
49
star
17

Algorithm-Experiment

Algorithm experiment code written by Swift
Swift
46
star
18

Self-Sizing-CollectionView-Demo

This is the Demo showed in http://yulingtianxia.com/blog/2014/08/17/New-in-Table-and-Collection-Views/
Swift
35
star
19

YXYNumberAnimationLabel

一个数字动画Label
Objective-C
33
star
20

TFSHelper

Mac 上自动捕获并打开 TFS 链接的小工具
Swift
32
star
21

WebViewImageClick

看美图必备
Objective-C
27
star
22

ClassWrittenInSwift

Something for Class written in Swift.
Objective-C++
18
star
23

ImageMask

iOS刮刮卡的实现
Objective-C
17
star
24

javaQQ

用java写的QQ客户端,简单地聊天和发送文件功能
Java
14
star
25

DirtyWords-for-Xcode

Highlight dirty words in Xcode.
Swift
11
star
26

HandGestureCNN

Trainning Inception v3 model with Keras, and predict with MPS on iOS.
Swift
10
star
27

ChangYou

畅游室内导航
Java
7
star
28

Blog-Hexo-Source

My Blog Source
JavaScript
5
star
29

yulingtianxia.github.io

我的技术博客
HTML
5
star
30

MyCDDemo

Core Data Demo
Objective-C
4
star
31

Linger

临哥让我做的内部使用的 Mac 平台简易日志分析工具,不知道起啥名字好,就叫 Linger 吧
Objective-C
3
star
32

Pebble-MoHa

Pebble Watchface +1s
C
2
star
33

FavoriteGirls

Machine Learning Demo
Python
2
star
34

MyFirstGame

无聊写的小游戏
Objective-C
1
star
35

LeetCode

记录LeetCode刷题
C++
1
star