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 emulator which is located under android-sdk/emulator/emulator. I had problems with android-sdk/tools/emulator so 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_completed to see if the emulator has booted already. Do this in a loop until it returns 1
Call fastlane screengrab and append the specific type flag:
--specific-type 'device_type_variable'
with 'device_type_variable' equals to phone, sevenInch or tenInch. According to the emulator you started.
Call adb emulator-5554 emu kill to 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_variable and device_type_variable for each of your emulator.
Hope this helps.