jenkins 如何使用fastlane为模拟器构建iOS应用程序?

niwlg2el  于 2023-10-17  发布在  Jenkins
关注(0)|答案(1)|浏览(150)

出于自动化测试的目的,我试图通过jenkins job为 * 模拟器 * 使用fastlane build_app脚本构建iOS应用程序。
我目前遇到的两个问题是:
1.我不知道如何直接从build命令获取.app file
1.当我创建.ipa文件时,我通过提取.ipa得到.app file,但不知何故,.app不会在我的模拟器上打开(模拟器是对应的)
我使用的车道看起来如下->

lane :app_for_simulator do
    match(type: "development")
    build_app(
      scheme: "MyApp",
      export_method: "development",
      configuration: "Debug",
      destination: "platform=iOS Simulator,name=iPhone 11,OS=13.1",
      output_name: "MyApp.ipa"
    )
  end

有没有人遇到过类似的问题,并设法解决?
我看了看其他的主题,但没有找到答案。Thanks in advance

xkftehaa

xkftehaa1#

这是我们用途:

xcodebuild(
  {
    clean: true,
    build: true,
    workspace: "./MyApp.xcworkspace",
    output_name: "MyApp.ipa",
    scheme: "MyApp",
    sdk: "iphonesimulator",
    destination: "platform=iOS Simulator,name=iPhone 5s",
    xcargs: "ONLY_ACTIVE_ARCH=NO"
  }
)

# after the build we copy the MyApp.app from the build products
xcodebuild_dir = File.absolute_path("../MyApp/build/Build/Products/SimulatorBuild-iphonesimulator")
Actions.sh("ditto \"#{xcodebuild_dir}/MyApp.app\" \"MyApp.app\"")

相关问题