jiangleligejiang / JNote

记录相关日常笔记
0 stars 0 forks source link

project.pbxproj文件探究 #53

Open jiangleligejiang opened 5 years ago

jiangleligejiang commented 5 years ago

参考资料

jiangleligejiang commented 5 years ago

project.pbxproj目录结构

1. rootObject:文件源头,指向Project Object

rootObject = A1F75A6423716DBB0046C72B /* Project object */;

2. Project object:对应编译工程的相关信息

/* Begin PBXProject section */
A1F75A6423716DBB0046C72B /* Project object */ = {
    isa = PBXProject;
    attributes = { /* 包含编译器的基本信息:版本和项目中的target */
        LastUpgradeCheck = 1110;
        ORGANIZATIONNAME = jams;
        TargetAttributes = {
            A1F75A6B23716DBB0046C72B = {
                CreatedOnToolsVersion = 11.1;
            };
            A1F75A8623716DBD0046C72B = {
                CreatedOnToolsVersion = 11.1;
                TestTargetID = A1F75A6B23716DBB0046C72B;
            };
            A1F75A9123716DBD0046C72B = {
                CreatedOnToolsVersion = 11.1;
                TestTargetID = A1F75A6B23716DBB0046C72B;
            };
        };
    };
    buildConfigurationList = A1F75A6723716DBB0046C72B /* Build configuration list for PBXProject "PbxProjDemo" */;
    compatibilityVersion = "Xcode 9.3"; /* x-code兼容版本 */
    developmentRegion = en;
    hasScannedForEncodings = 0;  /* 是否已经扫描文本编码信息 */
    knownRegions = (
        en,
        Base,
    );
    mainGroup = A1F75A6323716DBB0046C72B;  /* 文件组织形式,指向PBXGroup */
    productRefGroup = A1F75A6D23716DBB0046C72B /* Products */; /* 编译后输出的PBXGroup类型 */
    projectDirPath = ""; /* 项目路径 */
    projectRoot = ""; /* 项目根目录 */
    targets = (
        A1F75A6B23716DBB0046C72B /* PbxProjDemo */,
        A1F75A8623716DBD0046C72B /* PbxProjDemoTests */,
        A1F75A9123716DBD0046C72B /* PbxProjDemoUITests */,
    );
};
/* End PBXProject section */

3. XCConfigurationList:构造项目中对应的target的配置

image

/* Begin XCConfigurationList section */
A1F75A6723716DBB0046C72B /* Build configuration list for PBXProject "PbxProjDemo" */ = {
    isa = XCConfigurationList;
    buildConfigurations = (
        A1F75A9923716DBD0046C72B /* Debug */,
        A1F75A9A23716DBD0046C72B /* Release */,
    );
    defaultConfigurationIsVisible = 0;
    defaultConfigurationName = Release;
};
A1F75A9B23716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemo" */ = {
    isa = XCConfigurationList;
    buildConfigurations = (
        A1F75A9C23716DBD0046C72B /* Debug */,
        A1F75A9D23716DBD0046C72B /* Release */,
    );
    defaultConfigurationIsVisible = 0;
    defaultConfigurationName = Release;
};
A1F75A9E23716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemoTests" */ = {
    isa = XCConfigurationList;
    buildConfigurations = (
        A1F75A9F23716DBD0046C72B /* Debug */,
        A1F75AA023716DBD0046C72B /* Release */,
    );
    defaultConfigurationIsVisible = 0;
    defaultConfigurationName = Release;
};
A1F75AA123716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemoUITests" */ = {
    isa = XCConfigurationList;
    buildConfigurations = (
        A1F75AA223716DBD0046C72B /* Debug */,
        A1F75AA323716DBD0046C72B /* Release */,
    );
    defaultConfigurationIsVisible = 0;
    defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

4. XCBuildConfiguration:项目中具体target对应的配置信息

image

5. PBXGroup:文件组织目录结构

image

/* Begin PBXGroup section */
A1F75A6323716DBB0046C72B = {
    isa = PBXGroup;
    children = (
        A1F75A6E23716DBB0046C72B /* PbxProjDemo */,
        A1F75A8A23716DBD0046C72B /* PbxProjDemoTests */,
        A1F75A9523716DBD0046C72B /* PbxProjDemoUITests */,
        A1F75A6D23716DBB0046C72B /* Products */,
    );
    sourceTree = "<group>";
};
A1F75A6D23716DBB0046C72B /* Products */ = {
    isa = PBXGroup;
    children = (
        A1F75A6C23716DBB0046C72B /* PbxProjDemo.app */,
        A1F75A8723716DBD0046C72B /* PbxProjDemoTests.xctest */,
        A1F75A9223716DBD0046C72B /* PbxProjDemoUITests.xctest */,
    );
    name = Products;
    sourceTree = "<group>";
};
A1F75A6E23716DBB0046C72B /* PbxProjDemo */ = {
    isa = PBXGroup;
    children = (
        A1F75A6F23716DBB0046C72B /* AppDelegate.h */,
        A1F75A7023716DBB0046C72B /* AppDelegate.m */,
        A1F75A7223716DBB0046C72B /* SceneDelegate.h */,
        A1F75A7323716DBB0046C72B /* SceneDelegate.m */,
        A1F75A7523716DBB0046C72B /* ViewController.h */,
        A1F75A7623716DBB0046C72B /* ViewController.m */,
        A1F75A7823716DBB0046C72B /* Main.storyboard */,
        A1F75A7B23716DBD0046C72B /* Assets.xcassets */,
        A1F75A7D23716DBD0046C72B /* LaunchScreen.storyboard */,
        A1F75A8023716DBD0046C72B /* Info.plist */,
        A1F75A8123716DBD0046C72B /* main.m */,
    );
    path = PbxProjDemo;
    sourceTree = "<group>";
};
A1F75A8A23716DBD0046C72B /* PbxProjDemoTests */ = {
    isa = PBXGroup;
    children = (
        A1F75A8B23716DBD0046C72B /* PbxProjDemoTests.m */,
        A1F75A8D23716DBD0046C72B /* Info.plist */,
    );
    path = PbxProjDemoTests;
    sourceTree = "<group>";
};
A1F75A9523716DBD0046C72B /* PbxProjDemoUITests */ = {
    isa = PBXGroup;
    children = (
        A1F75A9623716DBD0046C72B /* PbxProjDemoUITests.m */,
        A1F75A9823716DBD0046C72B /* Info.plist */,
    );
    path = PbxProjDemoUITests;
    sourceTree = "<group>";
};
/* End PBXGroup section */

6. PBXFileReference:项目所引用的外部文件,包括源代码文件、资源文件等

/* Begin PBXFileReference section */
A1F75A6C23716DBB0046C72B /* PbxProjDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PbxProjDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
A1F75A6F23716DBB0046C72B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
A1F75A7023716DBB0046C72B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
A1F75A7223716DBB0046C72B /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
A1F75A7323716DBB0046C72B /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
A1F75A7523716DBB0046C72B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
A1F75A7623716DBB0046C72B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
A1F75A7923716DBB0046C72B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A1F75A7B23716DBD0046C72B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
A1F75A7E23716DBD0046C72B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
A1F75A8023716DBD0046C72B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A1F75A8123716DBD0046C72B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
A1F75A8723716DBD0046C72B /* PbxProjDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PbxProjDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A1F75A8B23716DBD0046C72B /* PbxProjDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PbxProjDemoTests.m; sourceTree = "<group>"; };
A1F75A8D23716DBD0046C72B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A1F75A9223716DBD0046C72B /* PbxProjDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PbxProjDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A1F75A9623716DBD0046C72B /* PbxProjDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PbxProjDemoUITests.m; sourceTree = "<group>"; };
A1F75A9823716DBD0046C72B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

7.PBXNativeTarget:对应于生成的可执行二进制程序或库文件的本地构建目标对象

/* Begin PBXNativeTarget section */
A1F75A6B23716DBB0046C72B /* PbxProjDemo */ = {
    isa = PBXNativeTarget;
    buildConfigurationList = A1F75A9B23716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemo" */;
    buildPhases = (
        A1F75A6823716DBB0046C72B /* Sources */,
        A1F75A6923716DBB0046C72B /* Frameworks */,
        A1F75A6A23716DBB0046C72B /* Resources */,
    );
    buildRules = (
    );
    dependencies = (
    );
    name = PbxProjDemo;
    productName = PbxProjDemo;
    productReference = A1F75A6C23716DBB0046C72B /* PbxProjDemo.app */;
    productType = "com.apple.product-type.application";
};
A1F75A8623716DBD0046C72B /* PbxProjDemoTests */ = {
    isa = PBXNativeTarget;
    buildConfigurationList = A1F75A9E23716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemoTests" */;
    buildPhases = (
        A1F75A8323716DBD0046C72B /* Sources */,
        A1F75A8423716DBD0046C72B /* Frameworks */,
        A1F75A8523716DBD0046C72B /* Resources */,
    );
    buildRules = (
    );
    dependencies = (
        A1F75A8923716DBD0046C72B /* PBXTargetDependency */,
    );
    name = PbxProjDemoTests;
    productName = PbxProjDemoTests;
    productReference = A1F75A8723716DBD0046C72B /* PbxProjDemoTests.xctest */;
    productType = "com.apple.product-type.bundle.unit-test";
};
A1F75A9123716DBD0046C72B /* PbxProjDemoUITests */ = {
    isa = PBXNativeTarget;
    buildConfigurationList = A1F75AA123716DBD0046C72B /* Build configuration list for PBXNativeTarget "PbxProjDemoUITests" */;
    buildPhases = (
        A1F75A8E23716DBD0046C72B /* Sources */,
        A1F75A8F23716DBD0046C72B /* Frameworks */,
        A1F75A9023716DBD0046C72B /* Resources */,
    );
    buildRules = (
    );
    dependencies = (
        A1F75A9423716DBD0046C72B /* PBXTargetDependency */,
    );
    name = PbxProjDemoUITests;
    productName = PbxProjDemoUITests;
    productReference = A1F75A9223716DBD0046C72B /* PbxProjDemoUITests.xctest */;
    productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

8.PBXSourcesBuildPhase:构建阶段需要复制的资源文件

/* Begin PBXSourcesBuildPhase section */
A1F75A6823716DBB0046C72B /* Sources */ = {
    isa = PBXSourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
        A1F75A7723716DBB0046C72B /* ViewController.m in Sources */,
        A1F75A7123716DBB0046C72B /* AppDelegate.m in Sources */,
        A1F75A8223716DBD0046C72B /* main.m in Sources */,
        A1F75A7423716DBB0046C72B /* SceneDelegate.m in Sources */,
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A8323716DBD0046C72B /* Sources */ = {
    isa = PBXSourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
        A1F75A8C23716DBD0046C72B /* PbxProjDemoTests.m in Sources */,
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A8E23716DBD0046C72B /* Sources */ = {
    isa = PBXSourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
        A1F75A9723716DBD0046C72B /* PbxProjDemoUITests.m in Sources */,
    );
    runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

9.PBXBuildFile:被PBXBuildPhrase等作为文件包含或被引用的资源

/* Begin PBXBuildFile section */
A1F75A7123716DBB0046C72B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A7023716DBB0046C72B /* AppDelegate.m */; };
A1F75A7423716DBB0046C72B /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A7323716DBB0046C72B /* SceneDelegate.m */; };
A1F75A7723716DBB0046C72B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A7623716DBB0046C72B /* ViewController.m */; };
A1F75A7A23716DBB0046C72B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1F75A7823716DBB0046C72B /* Main.storyboard */; };
A1F75A7C23716DBD0046C72B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1F75A7B23716DBD0046C72B /* Assets.xcassets */; };
A1F75A7F23716DBD0046C72B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A1F75A7D23716DBD0046C72B /* LaunchScreen.storyboard */; };
A1F75A8223716DBD0046C72B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A8123716DBD0046C72B /* main.m */; };
A1F75A8C23716DBD0046C72B /* PbxProjDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A8B23716DBD0046C72B /* PbxProjDemoTests.m */; };
A1F75A9723716DBD0046C72B /* PbxProjDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F75A9623716DBD0046C72B /* PbxProjDemoUITests.m */; };
/* End PBXBuildFile section */

10. PBXFrameworksBuildPhase:用于framework构建的链接阶段

/* Begin PBXFrameworksBuildPhase section */
A1F75A6923716DBB0046C72B /* Frameworks */ = {
    isa = PBXFrameworksBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A8423716DBD0046C72B /* Frameworks */ = {
    isa = PBXFrameworksBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A8F23716DBD0046C72B /* Frameworks */ = {
    isa = PBXFrameworksBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

11. PBXResourcesBuildPhase:构建阶段需要复制的资源文件

/* Begin PBXResourcesBuildPhase section */
A1F75A6A23716DBB0046C72B /* Resources */ = {
    isa = PBXResourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
        A1F75A7F23716DBD0046C72B /* LaunchScreen.storyboard in Resources */,
        A1F75A7C23716DBD0046C72B /* Assets.xcassets in Resources */,
        A1F75A7A23716DBB0046C72B /* Main.storyboard in Resources */,
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A8523716DBD0046C72B /* Resources */ = {
    isa = PBXResourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    runOnlyForDeploymentPostprocessing = 0;
};
A1F75A9023716DBD0046C72B /* Resources */ = {
    isa = PBXResourcesBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
jiangleligejiang commented 5 years ago

project.pbxproj文件目录流程

image