Class: Fastlane::Actions::AndroidCreateAvdAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidCreateAvdAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
83 84 85 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 83 def self. ['Automattic'] end |
.available_options ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 42 def self. [ FastlaneCore::ConfigItem.new(key: :device_model, env_name: 'FL_ANDROID_CREATE_AVD_DEVICE_MODEL', description: 'The device model code to use to create the AVD. Valid values can be found using `avdmanager list devices`', type: String, optional: false), FastlaneCore::ConfigItem.new(key: :api_level, env_name: 'FL_ANDROID_CREATE_AVD_API_LEVEL', description: 'The API level to use to install the necessary system-image and create the AVD', type: Integer, optional: false), FastlaneCore::ConfigItem.new(key: :avd_name, env_name: 'FL_ANDROID_CREATE_AVD_AVD_NAME', description: 'The name to give to the created AVD. If not provided, will be derived from device model and API level', type: String, optional: true, default_value: nil), FastlaneCore::ConfigItem.new(key: :sdcard, env_name: 'FL_ANDROID_CREATE_AVD_SDCARD', description: 'The size of the SD card to use for the AVD', type: String, optional: true, default_value: '512M'), FastlaneCore::ConfigItem.new(key: :system_image, env_name: 'FL_ANDROID_CREATE_AVD_SYSTEM_IMAGE', description: 'The system image to use (as used/listed by `sdkmanager`). Defaults to the appropriate system image given the API level requested and the current machine\'s architecture', type: String, optional: true, default_value_dynamic: true, default_value: nil), ] end |
.description ⇒ Object
31 32 33 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 31 def self.description 'Creates a new Android Virtual Device (AVD) for a specific device model and API level' end |
.details ⇒ Object
35 36 37 38 39 40 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 35 def self.details <<~DESC Creates a new Android Virtual Device (AVD) for a specific device model and API level. By default, it also installs the necessary system image (using `sdkmanager`) if needed before creating the AVD DESC end |
.is_supported?(platform) ⇒ Boolean
87 88 89 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 87 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
76 77 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 76 def self.output end |
.return_value ⇒ Object
79 80 81 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 79 def self.return_value 'Returns the name of the created AVD' end |
.run(params) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb', line 6 def self.run(params) device_model = params[:device_model] api_level = params[:api_level] avd_name = params[:avd_name] sdcard = params[:sdcard] helper = Fastlane::Helper::Android::EmulatorHelper.new # Ensure we have the system image needed for creating the AVD with this API level system_image = params[:system_image] || helper.install_system_image(api: api_level) # Create the AVD for device, API and system image we need helper.create_avd( api: api_level, device: device_model, system_image: system_image, name: avd_name, sdcard: sdcard ) end |