running screengrab
joreilly opened this issue · comments
Is it only possible to use gradle_task
and shell_task
when using this? Would be great for example to be able to run screengrab
.
Hello,
I have never used screengrab
but I've just checked GitRepo of this tool. I will take a closer look at it tomorrow, yet I am quite sure that it should work.
You can start other fastlane
lanes with usage of this tool. So for example you could try something like this:
lane :assemble_apk_and_grab_screenshots do
gradle(task: "assembleDebug assembleAndroidTest")
Action.sh("screengrab")
end
lane :grab_screenshots do
automated_test_emulator_run(
AVD_setup_path: "fastlane/MyConfigs/AVD_ConfigForScreengrab.json",
shell_task: "fastlane assemble_apk_and_grab_screenshots"
)
end
- So
assemble_apk_and_grab_screenshots
lane builds your .apk and android-test.apk to be ready forscreengrab
. - You wrap this lane into
shell task
. - Plugin will start AVDs according to your JSON config. Wait for AVD to fully launch. And then run
fastlane assemble_apk_and_grab_screenshots
. - Your AVDs will simply wait for *.apks to be built and then
screengrab
will launch. It should use currently available devices - AVDs which were launched by plugin and wait forshell task
to finish. - After
shell task
finishes it's job AVDs are killed and deleted.
Thanks @FisherKK for the quick response! Will try that out. BTW am using screengrab from fastlane (such as below)....but same approach will work of course.
lane :screenshots do |options|
gradle(task: 'clean')
gradle(
task: "assembleDebug assembleDebugAndroidTest",
properties: {
....
}
)
screengrab(
locales: ['en-US'],
clear_previous_screenshots: true,
app_package_name: package_name,
use_tests_in_packages: ['com.company.package.screenshots'],
app_apk_path: "app/build/outputs/apk/app-debug.apk",
tests_apk_path: "app/build/outputs/apk/app-debug-androidTest.apk"
)
end
Sure :) No problem!
I hope it will work.