{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/",
  "atlas": "https://www.pystone.net/?node=unity-xcode-ios-build-pipeline#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline.md",
  "context": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:unity-xcode-ios-build-pipeline",
  "slug": "unity-xcode-ios-build-pipeline",
  "title": "【CI】Unity-XCode-Build-iOS",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "【CI】Unity XCode Build iOS",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "2845115397877a0e3b1ff46e659acdeea765c029d791807d1e56e2c41e838cc5",
  "assets": [
    {
      "reference": "assets/0040 - 【CI】Unity-XCode-Build-iOS__截屏2021-08-02 下午5.45.07.png",
      "url": "/media/50dfff6a7f1c511e075b.png",
      "mediaType": "image/png",
      "contentHash": "50dfff6a7f1c511e075ba7a1a15861556995c5de0e8d4a4e3d997cdb47f4aabf",
      "byteLength": 341337,
      "width": 2096,
      "height": 910
    },
    {
      "reference": "assets/0040 - 【CI】Unity-XCode-Build-iOS__resource-002-f9205353f12f.png",
      "url": "/media/ba5ad14ecab0302efa3d.png",
      "mediaType": "image/png",
      "contentHash": "ba5ad14ecab0302efa3d03bed6bdc9938f764aae3b5f8f3b507ea20687095126",
      "byteLength": 698474,
      "width": 1166,
      "height": 1224
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "【CI】Unity-XCode-Build-iOS",
      "anchor": "ciunity-xcode-build-ios",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#ciunity-xcode-build-ios"
    },
    {
      "depth": 2,
      "text": "XCode工程相关知识",
      "anchor": "xcode工程相关知识",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode%E5%B7%A5%E7%A8%8B%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%86"
    },
    {
      "depth": 3,
      "text": "Xcode Concepts",
      "anchor": "xcode-concepts",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode-concepts"
    },
    {
      "depth": 4,
      "text": "Project",
      "anchor": "project",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#project"
    },
    {
      "depth": 4,
      "text": "Target",
      "anchor": "target",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#target"
    },
    {
      "depth": 4,
      "text": "Build Settings",
      "anchor": "build-settings",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#build-settings"
    },
    {
      "depth": 4,
      "text": "Scheme",
      "anchor": "scheme",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#scheme"
    },
    {
      "depth": 3,
      "text": "文件",
      "anchor": "文件",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E6%96%87%E4%BB%B6"
    },
    {
      "depth": 3,
      "text": "语言",
      "anchor": "语言",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%AF%AD%E8%A8%80"
    },
    {
      "depth": 3,
      "text": "证书相关",
      "anchor": "证书相关",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%AF%81%E4%B9%A6%E7%9B%B8%E5%85%B3"
    },
    {
      "depth": 2,
      "text": "XCode打包",
      "anchor": "xcode打包",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode%E6%89%93%E5%8C%85"
    },
    {
      "depth": 3,
      "text": "选择IOS版本",
      "anchor": "选择ios版本",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E9%80%89%E6%8B%A9ios%E7%89%88%E6%9C%AC"
    },
    {
      "depth": 3,
      "text": "证书与签名",
      "anchor": "证书与签名",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%AF%81%E4%B9%A6%E4%B8%8E%E7%AD%BE%E5%90%8D"
    },
    {
      "depth": 3,
      "text": "Xcode中的配置",
      "anchor": "xcode中的配置",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode%E4%B8%AD%E7%9A%84%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 3,
      "text": "总结",
      "anchor": "总结",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E6%80%BB%E7%BB%93"
    },
    {
      "depth": 3,
      "text": "命令行",
      "anchor": "命令行",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E5%91%BD%E4%BB%A4%E8%A1%8C"
    },
    {
      "depth": 2,
      "text": "Unity中的设置",
      "anchor": "unity中的设置",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#unity%E4%B8%AD%E7%9A%84%E8%AE%BE%E7%BD%AE"
    },
    {
      "depth": 2,
      "text": "Unity打IPA完整过程",
      "anchor": "unity打ipa完整过程",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#unity%E6%89%93ipa%E5%AE%8C%E6%95%B4%E8%BF%87%E7%A8%8B"
    },
    {
      "depth": 2,
      "text": "自动化",
      "anchor": "自动化",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%87%AA%E5%8A%A8%E5%8C%96"
    },
    {
      "depth": 3,
      "text": "Unity打包XCode工程",
      "anchor": "unity打包xcode工程",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#unity%E6%89%93%E5%8C%85xcode%E5%B7%A5%E7%A8%8B"
    },
    {
      "depth": 3,
      "text": "对XCode工程的签名（Signing）进行配置",
      "anchor": "对xcode工程的签名signing进行配置",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E5%AF%B9xcode%E5%B7%A5%E7%A8%8B%E7%9A%84%E7%AD%BE%E5%90%8Dsigning%E8%BF%9B%E8%A1%8C%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 3,
      "text": "XCode打包IPA",
      "anchor": "xcode打包ipa",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode%E6%89%93%E5%8C%85ipa"
    },
    {
      "depth": 4,
      "text": "XCode Build初次安装",
      "anchor": "xcode-build初次安装",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcode-build%E5%88%9D%E6%AC%A1%E5%AE%89%E8%A3%85"
    },
    {
      "depth": 4,
      "text": "证书与签名",
      "anchor": "证书与签名-1",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%AF%81%E4%B9%A6%E4%B8%8E%E7%AD%BE%E5%90%8D-1"
    },
    {
      "depth": 4,
      "text": "方法一：build & zip",
      "anchor": "方法一build-zip",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E6%96%B9%E6%B3%95%E4%B8%80build-zip"
    },
    {
      "depth": 5,
      "text": "xcconfig",
      "anchor": "xcconfig",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#xcconfig"
    },
    {
      "depth": 4,
      "text": "方法二：archive & export archive",
      "anchor": "方法二archive-export-archive",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E6%96%B9%E6%B3%95%E4%BA%8Carchive-export-archive"
    },
    {
      "depth": 5,
      "text": "Archive",
      "anchor": "archive",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#archive"
    },
    {
      "depth": 5,
      "text": "IPA Export (please note the export options plist)",
      "anchor": "ipa-export-please-note-the-export-options-plist",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#ipa-export-please-note-the-export-options-plist"
    },
    {
      "depth": 5,
      "text": "The Export Options Plist",
      "anchor": "the-export-options-plist",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#the-export-options-plist"
    },
    {
      "depth": 3,
      "text": "自动安装ipa",
      "anchor": "自动安装ipa",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E8%87%AA%E5%8A%A8%E5%AE%89%E8%A3%85ipa"
    },
    {
      "depth": 3,
      "text": "第三方SDK的集成",
      "anchor": "第三方sdk的集成",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E7%AC%AC%E4%B8%89%E6%96%B9sdk%E7%9A%84%E9%9B%86%E6%88%90"
    },
    {
      "depth": 2,
      "text": "坑点",
      "anchor": "坑点",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#%E5%9D%91%E7%82%B9"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/unity-xcode-ios-build-pipeline/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:software-engineering-and-quality",
      "title": "软件工程与质量保障",
      "url": "https://www.pystone.net/notes/software-engineering-and-quality/",
      "atlas": "https://www.pystone.net/?node=software-engineering-and-quality#knowledge-atlas",
      "label": "软件工程与质量保障",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "CI-CD与质量保障/CI-CD工具链中的“【CI】Unity-XCode-Build-iOS”导航项",
      "citation": "https://www.pystone.net/notes/software-engineering-and-quality/#ci-cd%E4%B8%8E%E8%B4%A8%E9%87%8F%E4%BF%9D%E9%9A%9Cci-cd%E5%B7%A5%E5%85%B7%E9%93%BE"
    }
  ],
  "contentMarkdown": "# 【CI】Unity-XCode-Build-iOS\n\n﻿# 【CI】Unity-XCode-Build-iOS\n\n> 创建时间：2021/7/29 19:09\n\n* XCode工程相关知识\n    * Xcode Concepts\n      * Project\n      * Target\n      * Build Settings\n      * Scheme\n    * 文件\n    * 语言\n    * 证书相关\n  * XCode打包\n    * 选择IOS版本\n    * 证书与签名\n    * Xcode中的配置\n    * 总结\n    * 命令行\n  * Unity中的设置\n  * Unity打IPA完整过程\n  * 自动化\n    * Unity打包XCode工程\n    * 对XCode工程的签名（Signing）进行配置\n    * XCode打包IPA\n      * XCode Build初次安装\n      * 证书与签名\n      * 方法一：build & zip\n        * xcconfig\n      * 方法二：archive & export archive\n        * Archive\n        * IPA Export (please note the export options plist)\n        * The Export Options Plist\n    * 自动安装ipa\n    * 第三方SDK的集成\n  * 坑点\n  * Ref\n\n## XCode工程相关知识\n\n### Xcode Concepts\n\n#### Project\n\nAn Xcode project is a repository for all the files, resources, and information required to build one or more software products.\n\nProject contains one or more targets.\n\n#### Target\n\n最小可编译单元，每一个 target 对应一个编译输出，这个输出可以是一个链接库，一个可执行文件或者一个资源包。\nA target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace.\n\nA target defines a single product; it organizes the inputs into the build system— **the source files** and **instructions for processing those source files** —required to build that product.\n\n#### Build Settings\n\nA **build setting** is a variable that contains information about how a particular aspect of a product’s build process should be performed.\n\nYou can specify build settings at the **project** or **target** level.\n\nA **build configuration** specifies **a set of build settings** used to build a **target's product** in a particular way.\n\nit is common to have **separate build configurations** for debug and release builds of a **product**.\n\n#### Scheme\n\nAn Xcode **scheme** defines a collection of **targets** to build, a **configuration** to use when building, and a collection of tests to execute.\n\n### 文件\n\nPlist file: Information Property List Files. a structured text file that contains essential configuration information for a bundled executable. (Unicode UTF-8, XML)\n\n### 语言\n\nOC（Objective-C）代码：Unity接入一些iOS原生的SDK需要使用。相关链接：https://blog.csdn.net/linxinfa/article/details/107375140\n\n### 证书相关\n\n证书概念与配置：https://zhuanlan.zhihu.com/p/69162456\n\nDeveloper证书\n\nAppID ＝ Bundle ID 用来在App Store上全球唯一标识每一个应用程序的。\n\n<1> Explicit App ID：填写一个精确的ID，如果需要做远程推送/游戏中心/内购等功能，必须填写准确的bundle ID。\n<2> Wildcard App ID：填写一个模糊的ID,如果不需要做远程推送/游戏中心/内购等功能，直接填写模糊的bundle ID即可，这样可以提升我们的开发效率。在开发中，为了保证方便，使用AppID时，可以使用通配符＊，替代所有的应用程序。\n\n推送证书（分为开发和发布两种，类型分别为APNs Development ios,APNs Distribution ios）,该证书在appID配置中创建生成，和开发者证书一样，安装到开发电脑上；\n\nProvisioning Profiles（PP文件）：件将appID,开发者证书，硬件Device绑定到一块儿，在开发者中心配置好后可以添加到Xcode上，也可以直接在Xcode上连接开发者中心生成，真机调试时需要在PP文件中添加真机的udid；\n\n## XCode打包\n\nDevelopment Deployment：https://wiki.genexus.com/commwiki/servlet/wiki?34616,HowTo%3A+Create+an+.ipa+file+from+XCode\n手动配置：https://blog.csdn.net/cyuyanenen/article/details/51925005\n\n> iTunes已经被Apple弃用，因此网上使用iTunes安装ipa的方法不可行。使用Xcode->window->Devices&Simulators 即可。\n\n### 选择IOS版本\n\niOS版本要 <= 目标设备的iOS版本。设备的iOS版本向下兼容app的目标iOS版本。\n\n![](assets/0040 - 【CI】Unity-XCode-Build-iOS__截屏2021-08-02 下午5.45.07.png)\n\n### 证书与签名\n\n用开发者帐号登陆开发者中心\n创建开发者证书\nappID\n添加调试真机(Devices)\n(在appID中开通推送服务)\n(在开通推送服务的选项下面创建推送证书)\n在PP文件中绑定所有信息\n\n命令行签名失败：https://medium.com/@ceyhunkeklik/how-to-fix-ios-application-code-signing-error-4818bd331327\n\n### Xcode中的配置\n\nAccounts配置：Xcode -> Preferences -> Accounts\n项目配置：选中项目，点击 Signing & Capabilities\nProduct Scheme配置（Archive等）：Product->Scheme->Edit Scheme\n\nSigning 配置方法：\n选中项目->BuildSettings->Signing中配置好即可。\n配置项：\n\n  * Code Signing Style(Manual, Automatic)\n  * Code Signing identity\n  * Development Team\n  * Provisioning Profile\n\n只要 Provisioning Profile与Development Team， Bundle ID, Code Signing identity相匹配即可。\n最终，这些设置都会存储在文件 XXX.xcodeproj->project.pbxproj当中。\n\n### 总结\n\nXcode中证书的配置关键就是两点：\n\n  * 登录加入了Developer Team的账号\n  * 选择Team，使用Profile将Certificates、Devices、AppID绑定到一起。\n\n配置Profile的方式有两种：\n\n  * Automatically manage signing: 自动管理profiles、app IDs, certificates\n  * 手动配置：要在Web上配置好，下载Profile。使用的profile要将合法的Certificates、Devices、AppID绑定到一起。\n\n使用证书的地方：\n\n  * 选中项目，点击 Signing & Capabilities，配置好签名（profile）才可以进行Archive。\n  * Distribute时，根据不同的Method of distribution，会需要不同的证书。\n\n总之，创建好账户、证书，配置好工程即可。\n\n  * 在线上的account中为Mac设备创建好证书，配置好device、app id。\n  * 在Xcode中登录账户，为工程的开发配置好profile，打包时设置好profile。\n\n### 命令行\n\nhttps://www.jianshu.com/p/08ddc8777c78\nhttps://www.cnblogs.com/zhou--fei/p/11371019.html\n\n最简单的，直接build，其他的按照默认配置来\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n## Unity中的设置\n\n## Unity打IPA完整过程\n\n需要设置的内容：\n\n![](assets/0040 - 【CI】Unity-XCode-Build-iOS__resource-002-f9205353f12f.png)\n\n## 自动化\n\n可参考的博客：\nhttps://www.testdevlab.com/blog/2019/07/xcode-provisioning-profile-automation-for-ci/\nhttps://medium.com/@marksiu/how-to-build-ios-project-with-command-82f20fda5ec5\n\n可参考的脚本：\nhttps://github.com/qiubaiying/iOSAutoArchiveScript/blob/master/iOSAutoArchiveScript/iOSAutoArchiveScript.sh\nhttps://www.jianshu.com/p/616b6247ef99\nhttps://github.com/webfrogs/xcode_shell/blob/master/ipa-build\n\n### Unity打包XCode工程\n\nShell脚本调用Unity进行打包，执行一些配置。\n\n坑点：‘UnityFramework/UnityFramework.h‘ file not found\n解决：https://blog.csdn.net/mango9126/article/details/114835717\n\n### 对XCode工程的签名（Signing）进行配置\n\n使用Unity脚本，利用`XUPorter` 和 `OnPostProcessBuild` 接口进行XCode项目的配置。\n\n关于Automatically manage signing: 使用Manual模式，可能会遇到各种问题，如Profile中不包含所选证书，Profile不支持In-App Purchase feature等。使用Automatically，会自动生成合适的Profile，只要选择合适的团队，创建好合适的证书，以上问题就不会存在了。\n\n### XCode打包IPA\n\nhttps://developer.apple.com/library/archive/technotes/tn2339/_index.html\n\n概念：\n\n**Build** : The compilation for your source code to execute the project\n**Archive** : As its name says, it is the overall package (that contains .app and other related files). From archive you can create .IPA file similar to .apk file (android) with that you can distribute your application.\n\n有两套方案：\n\n  1. 使用build命令，分别对各个target进行build，然后手动把Build结果压缩成ipa文件（ipa本质上就是 app文件的压缩文件 ）。\n优点：这样可以分别为每个target配置Build Settings（使用xcconfig，或者直接在命令行中指定）\n缺点：指令相对比较麻烦。\n\n  2. 使用xcodebuild直接进行archive，再exportArchive，导出成ipa。\n\n优点：xcodebuild提供API，指令比较简单\n缺点：需要预先把scheme配置好，设置签名、ProvisioningProfiles等。用命令行设置scheme不方便。\n\n#### XCode Build初次安装\n\n使用Shell命令调用XCode的`Command Line Tools`工具进行打包。\n\nError: tool 'xcodebuild' requires Xcode\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n#### 证书与签名\n\n需要unlock keychain，否则会签名失败：Command CodeSign failed with a nonzero exit code\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\nhttps://stackoverflow.com/questions/577750/running-xcodebuild-from-a-forked-terminal/12235462\n\n签名失败：\n\n  * https://medium.com/@ceyhunkeklik/how-to-fix-ios-application-code-signing-error-4818bd331327\n  * https://developer.apple.com/forums/thread/669328\n  * https://stackoverflow.com/questions/24023639/xcode-command-usr-bin-codesign-failed-with-exit-code-1-errsecinternalcomponen\n\n自动导入证书：https://zhuanlan.zhihu.com/p/400261513\n\n#### 方法一：build & zip\n\n* * *\n\nList infos:\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n* * *\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\nSYMROOT (Build Products Path) - The path at which all products will be placed when performing a build.\nBy default, this is set to $(PROJECT_DIR)/build.\n\n* * *\n\nzip app to ipa:\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n这步可以使用xcrun PackageApplication 来将app打包为ipa，但是这个命令在新版本中弃用了，所以不方便。\n\n##### xcconfig\n\nhttps://help.apple.com/xcode/mac/current/#/dev745c5c974\n\nA build configuration file doesn’t need to list all possible build settings. It only needs to include ones you want to customize.\n\nBUILD_SETTING_DECLARATION_NAME[CONDITIONAL=CONDITION_VALUE] = VALUE_DEFINITION\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\nimport build settings from other build configuration files:\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n#### 方法二：archive & export archive\n\n##### Archive\n\n使用workspace：\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n使用project：\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\nxcodebuild -scheme iOS DSTROOT=\"/Users/[redacted-user]/Desktop/ReleaseLocation\" archive\n\n##### IPA Export (please note the export options plist)\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n##### The Export Options Plist\n\nhttps://www.matrixprojects.net/p/xcodebuild-export-options-plist/\nhttps://medium.com/@marksiu/how-to-build-ios-project-with-command-82f20fda5ec5\n\nmethod：\n\n  * app-store\n  * enterprise\n  * ad-hoc\n  * development\n\n* * *\n\nManual Signing\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n* * *\n\n### 自动安装ipa\n\nhttps://github.com/ios-control/ios-deploy\n\n```csharp\nstring a = &quot;test&quot;;\nstring tmp = &quot;est&quot;;\nstring b = &quot;t&quot; + tmp;\nConsole.WriteLine(string .ReferenceEquals(str1, str2));\n\n```\n\n### 第三方SDK的集成\n\nMultiple commands produce\nhttps://try2explore.com/questions/10012314\n解决方案：\n\n  1. Remove files from Copy Bundle Resources\n使用C#脚本来修改\n\n  2. Change the build system to Legacy Build System\n\n-UseModernBuildSystem/UseNewBuildSystem=NO\n\n> 参数: 0 or NO 1 or YES\n\n* * *\n\nbitcode bundle could not be generated\nlinker command failed with exit code 1\n\nhttps://blog.csdn.net/qq_39108767/article/details/106688493\n\n1，让第三方库支持bitcode，（大多数情况下不太有效···）\n2，关闭bitcode，\"Build Setting\" => \"Build Options\" => \"Enable Bitcode\" => \"No\"。\n\n## 坑点\n\n证书不受信任：https://www.jianshu.com/p/af6acf3cd484\n\n## Ref\n\nhttps://blog.51cto.com/myselfdream/2493033\nhttps://blog.csdn.net/Superficialtise/article/details/79699813\nhttp://www.xuanyusong.com/archives/2720\nhttp://www.xuanyusong.com/archives/2734\nhttps://blog.csdn.net/ccf0703/article/details/7999112\nhttps://developer.apple.com/library/archive/featuredarticles/XcodeConcepts/Concept-Targets.html\n"
}
