通过build configuration配置多环境
一个target
能够构建一个仅有的product
,也便是ipa
包。构建一个产品不仅仅需求源代码,还需求一系列的编译构建装备,比方build setting
,装备不同,终究出产出来的ipa包就不同。
在咱们设置build setting
的时分approve,是能够挑选build configr产品司理ation
的,如下图build options
中的debug informationAPP format
,对不同的configuration
能够设置装备不同的
值。
Build setting
里边是能够装备签名的,app id
的,app name
,appicon
,的,预处理宏界说的。意味着咱们能够经过指定不appointment同的config
就能够构建出不同appid和运用称谓,不同图标的approveipa
包。
Projeappreciatect->info->configurations
,此处有一个configurations
的菜单栏,默许分为debug
和release
D产品ebuxcode教程g
下面httpclient有又两层,榜首层级是projxcode10ecthttp 500
等级的,默许值是none
,子层级是target
等级的,默许值是Pod-xxx.debug
Rappointmentelease相同。
下面有一个加号,减号,能够用来增加或许删去config。咱们在此处挑选duplicate (复制)debug或许release 的装备。
比方xcode是什么咱们公司,需求打蒲公英的查验包,和企业包,假设咱们都打rxcode是什么软件elease包,那么就能够复制release来创建一个configuration。
edit scheme
->右侧菜单栏也有一个builappointmentd configurations
。是一个下拉挑选项,默许也是两个,debug
和release
。可见此处的configuration
便是来自于project->info->configurations
的。
留神
- 运用
fastlane
打包的时分,需求设置configuration
特点,不然的话一直打的是release
包。
desc "Description oappreciatef what the lane does"
lane :dis do
gym(
scheme:'scheme',
export_method: 'app-store',
configuration: 'Release',
export_options:{
provisioningProfiles:{
"bundle_id" => "pp文件名"
}
}
)
end
鼓捣了一appointment上午,总算成功的打出了企业包,查验包,但是不知道为何releashttp 404e
包却设备不上了。
Why?
是装备有问题吗approve?
试了下xcode是什么软件将打出的ipa包上传蒲公英,显现只允许经过appstore
下载,经过扫码能够下载,但是无法设备。
提示
无法设备application此App,因为无法验证Xcode其完整性。
查验设备曾经打的上传appstore
的release
包,也是不能够设备的,估测因为挑选的是发布证产品设计专业书,或许只能够经过appstore
设备把。xcode下载
tips
Build setting
中有一个预处理指令,咱们能够在这里增加,一些宏界说
eg。
运用这些预界说的宏界说,咱们能够很便利的在代码中做一些环境装备
#ifdef DEBUG
#define kBaseURL @"http://www.debug.com"
#elif ENTERPRISEHTTP
#define kBXcodeaseURL @"http://www.enterprise.com"
#elif PGYER
#defappearine kBaseURL @"http://wapplicationww.pgyer.applicationcom"
#else
#define kxcode中文BaseURL @"http://www.rele产品司理ase.com"
#endif
参阅文章
Xcode多种Build Configuration装备运用 – 简书