エミュレーターのアラート ボックスのスクリーンショットを撮る必要があります。ポップアップ/アラートボックスではなく、背景画像を取得しているだけです。
この 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 は環境変数です。試してください:
export SCREENSHOT_VIA_USB=true