I'm working on fastlane and want to start 3 emulators [phone, tab7, tab10] and take screenshots on them.
How do I create a script to create and start emulators via fastlane or commandline
I'm working on fastlane and want to start 3 emulators [phone, tab7, tab10] and take screenshots on them.
How do I create a script to create and start emulators via fastlane or commandline
You will need a script which does the following:
Then you call the script for your three different screen sizes.
Some more details:
To start the emulator use the program
emulatorwhich is located underandroid-sdk/emulator/emulator. I had problems withandroid-sdk/tools/emulatorso be sure to use the right one. The call can look like this:emulator @'your_emulator_name_variable' &The
&is important when you are using a shell script to continue after the call.You can call
adb shell getprop sys.boot_completedto see if the emulator has booted already. Do this in a loop until it returns1Call fastlane screengrab and append the specific type flag:
--specific-type 'device_type_variable'with
'device_type_variable'equals tophone,sevenInchortenInch. According to the emulator you started.Call
adb emulator-5554 emu killto shut down you emulator. If it uses another, non standard port, adjust accordingly.Now you can call this script with the two variables
your_emulator_name_variableanddevice_type_variablefor each of your emulator.Hope this helps.