[英]Xcode : build two apps in same target (with the same plist)
Now I have 3 targets in my iOS application so I build 3 apps (3 ipa). 现在,我的iOS应用程序中有3个目标,因此我构建了3个应用程序(3个IPA)。 But I want to keep only 3 target but I want to generate 6 apps (6 ipa). 但是我只想保留3个目标,但我想生成6个应用程序(6个IPA)。
On each target I want to create an app and a pilot app. 在每个目标上,我想创建一个应用程序和一个试用应用程序。 I really want to keep only 1 plist for app and pilot app. 我真的只想为应用程式和试验性应用程式保留1个清单。 Only differences with app and pilot app are : 与app和试用版app的唯一区别是:
It's important to keep the same plist for each target (a target is equivalent to en environment TEST, INT and PROD). 对于每个目标,保持相同的plist很重要(一个目标等效于环境TEST,INT和PROD)。 Because if I duplicate my target in two target (PROD and PROD PILOT for example) it will be more difficult to maintain thes application because if a day I want to change something in plist I will do the same in PILOT target plist. 因为如果我将目标复制到两个目标(例如PROD和PROD PILOT)中,将很难维护该应用程序,因为如果一天我想更改plist中的某些内容,我将在PILOT目标plist中执行相同的操作。 So you understand it can create differences if I forget to dusplicate my changements. 因此,您知道,如果我忘记重复更改,它会带来差异。
Finally it will be great if I can build the app and the pilot app just in 1 build and generate 2 Archives in one time also. 最后,如果我可以一次构建该应用程序和试用应用程序,并且一次生成2个存档,那将是很棒的。
Is it possible ? 可能吗 ? And have you ideas for the realisation ? 您有实现的想法吗?
Me I have just fews ideas like : 我,我只有一些想法,例如:
Thanks 谢谢
在项目设置下,对于每个目标,请在“构建设置”->“打包”下查看,尝试将所有info.plist文件设置为指向同一文件而不是其各自的版本。
If it is testing purpose, Try changing Bundle identifier in Project settings and change Product Name in build settings and take archive files. 如果是出于测试目的,请尝试在“项目”设置中更改“捆绑包”标识符,并在构建设置中更改“产品名称”,并获取存档文件。 It will be deployed as separate app in device. 它将作为单独的应用程序部署在设备中。
Thanks Fonix ! 谢谢Fonix!
My solution use your advice. 我的解决方案使用您的建议。 I duplicated my 3 targets but an app target and its pilot version are linked to the same plist file. 我复制了3个目标,但将一个应用目标及其试用版链接到同一plist文件。 Moreover, I had a preprocessor macro "PILOTE=1" in each pilote version. 此外,在每个试用版本中都有一个预处理程序宏“ PILOTE = 1”。 Finally I declare a string in user-defined to define my icon ("ICON -> icon.png or icon-pilote.png) and I declare in CFBundleIcon item0 -> ${ICON}). 最后,我在用户定义中声明一个字符串以定义我的图标(“ ICON-> icon.png或icon-pilote.png”),并在CFBundleIcon item0-> $ {ICON}中声明)。
And to add part of code I juste declare the code difference in : 并添加部分代码,我只是在中声明代码差异:
#IFDEF PILOTE #IFDEF飞行员
//Code Pilot version //代码试用版
#ELSE #其他
//Code standard version //代码标准版
#ENDIF #万一
Is it a nice choice for my needs ? 这是我需要的不错选择吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.