从命令行调用快照(FastLane 工具 > 快照)

Calling Snapshot from the command line (FastLane Tools > Snapshot)

我正在使用 Snapshot from the FastLane 套件。

出于我的目的,我从脚本调用各种工具并传入我用作输入的适当环境变量。我在传递 devices 参数和 languages 参数时遇到问题。

示例:

snapshot \
--workspace "MyWorkspace.xcworkspace" \
--scheme "MyScheme" \
--output_directory "MyOutputDirectory" \
--clear_previous_screenshots \
--stop_after_first_error \
--devices (['iPhone 4s', 'iPhone 5', 'iPhone 6', 'iPhone 6 Plus'])

以上设置devices参数时出现错误。

如何将这些数组传递给此工具?

您无法使用命令行将设备/语言传递给 snapshot。而是将语言和设备添加到您的 SnapfileFastfile

I know its too late but I want to add here that you can pass devices from command line in following way

add option to your lane which you gonna access from commandLine

lane :screenshots do |options|
     capture_screenshots(scheme:"QuickgetUITests",devices:options[:devices]) 
end

then pass argument like below from command line

fastlane screenshots devices:"iPhone 8"

注意:您也可以传递其他选项,例如语言