default_platform(:ios) platform :ios do desc "编译iOS项目并生成IPA" lane :build do # 清理之前的构建 clear_derived_data # 配置项目信息 project_name = "MiMoLive.xcworkspace" # 替换为你的项目名称 scheme_name = "MiMoLive" # 替换为你的Scheme名称 output_directory = "./build" # 输出目录 # 创建输出目录 sh "mkdir -p #{output_directory}" # 编译项目 gym( project: project_name, scheme: scheme_name, clean: true, configuration: "Release", output_directory: output_directory, output_name: "MiMoLive", # 生成的IPA名称 export_method: "ad-hoc", # 导出方式:app-store, ad-hoc, enterprise, development export_options: { provisioningProfiles: { "com.jiehe.mimo.debugs" => "/var/jenkins_home/iOS Files/DebugsProfile.mobileprovision" # 替换为你的Bundle ID和描述文件名称 } } ) # 输出构建结果路径 UI.message("IPA文件已生成: #{output_directory}") end end