default_platform(:ios) platform :ios do desc "Ad_Hoc IPA" ##options代表参数集合 lane :adhoc do |options| time = Time.new.strftime("%Y%m%d") version = get_version_number build_app(workspace: "yourproject.xcworkspace", scheme: options[:scheme], include_bitcode: false, include_symbols: false, output_directory: "./fastlane/output_directory", export_method: "ad-hoc") end end
Xcode打开项目,将项目改造成多Scheme项目,并将Scheme的”share”选项勾选上 1.添加scheme 2.添加configurations 3.编辑对应scheme的各个build configuration 4 为每个Configurations编辑不同BundleID和预处理宏 e.g. DEVELOPMENT=1 5.在管理项目接口域名处根据configurations的预处理宏设置不同的环境
配置好证书及各个configurations下的描述文件,实现不同环境下本地打包
1 2
$ cd <project path> $ fastlane adhoc <your-project-scheme> ## 等待结束后即可在./fastlane/output_directory目录下找到IPA