1
我需要在模拟器中截取警报框的截图。我只是获取背景图像而不是弹出框/警告框。如何在calabash android中设置SCRENSHOT_VIA_USB = true。
我不知道该设置SCREENSHOT_VIA_USB = true。
有人可以帮助我吗?
我需要在模拟器中截取警报框的截图。我只是获取背景图像而不是弹出框/警告框。如何在calabash android中设置SCRENSHOT_VIA_USB = true。
我不知道该设置SCREENSHOT_VIA_USB = true。
有人可以帮助我吗?
if ENV["SCREENSHOT_VIA_USB"] == "true"
device_args = "-s #{@serial}" if @serial
screenshot_cmd = "java -jar #{File.join(File.dirname(__FILE__), 'lib', 'screenShotTaker.jar')} #{path} #{device_args}"
log screenshot_cmd
raise "Could not take screenshot" unless system(screenshot_cmd)
else
begin
res = http("/screenshot")
rescue EOFError
raise "Could not take screenshot. App is most likely not running anymore."
end
File.open(path, 'wb') do |f|
f.write res
end
end
SCREENSHOT_VIA_USB是一个环境VAR,请尝试:
export SCREENSHOT_VIA_USB=true