简体   繁体   English

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

[英]Calling Snapshot from the command line (FastLane Tools > Snapshot)

I am using Snapshot from the FastLane suite.我正在使用FastLane套件中的快照

For my purposes I am calling the various tools from scripts and pass in the appropriate environment variables I am using as the inputs.出于我的目的,我从脚本调用各种工具并传入我用作输入的适当环境变量。 I am having trouble passing in the devices parameter as well as the languages parameter.我在传递devices参数和languages参数时遇到问题。

Example:例子:

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'])

The above results in an error when setting devices parameter.以上导致设置devices参数时出错。

How do I pass these arrays to this tool?如何将这些 arrays 传递给此工具?

You can't pass the devices / languages to snapshot using the command line. 您无法使用命令行将设备/语言传递给snapshot Instead add the languages and devices to your Snapfile or Fastfile 而是将语言和设备添加到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"

Note: You can Pass Other Options as well same way such like languages注意:您也可以传递其他选项,例如语言

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM