class Fastlane::Actions::StartAvdEmulatorAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 30
def self.authors
  ["Guillaume Elloy"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 40
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :name,
                            env_name: "START_ANDROID_EMULATOR_NAME",
                         description: "The name of the emulator to start",
                            optional: true,
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 26
def self.description
  "This plugin is listing available android avd emulators, allowing you to start the selected one."
end
details() click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 34
def self.details
  "Run the plugin to list all avd emulators available in your environment. "\
  "Select one to start it. "\
  "It is also possible to start one directly by specifying his name with the :name option."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 50
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/avd_emulator/actions/start_avd_emulator_action.rb, line 7
def self.run(params)
  Helper::StartAvdEmulatorHelper.check_for_environment_variable

  emulator_name = params[:name]
  emulator_list = Helper::StartAvdEmulatorHelper.get_emulator_list

  is_emulator_available = emulator_list.include? emulator_name
  if !emulator_name or !is_emulator_available
    if emulator_name and !is_emulator_available
      Helper::StartAvdEmulatorHelper.show_name_error(emulator_name)
    end
    emulator_name = Helper::StartAvdEmulatorHelper.show_emulator_selector(emulator_list)
  end

  Helper::StartAvdEmulatorHelper.start_emulator_in_background(emulator_name)
  Helper::StartAvdEmulatorHelper.show_waiting_message
  Helper::StartAvdEmulatorHelper.wait_for_emulator_to_be_started
end