Class: Fastlane::Actions::CaptureAndroidScreenshotsAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/capture_android_screenshots.rb

Direct Known Subclasses

ScreengrabAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



31
32
33
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 31

def self.author
  ['asfalcone', 'i2amsam', 'mfurtak']
end

.available_optionsObject



26
27
28
29
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 26

def self.available_options
  require 'screengrab'
  Screengrab::Options.available_options
end

.categoryObject



52
53
54
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 52

def self.category
  :screenshots
end

.descriptionObject



22
23
24
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 22

def self.description
  'Automated localized screenshots of your Android app (via _screengrab_)'
end

.example_codeObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 39

def self.example_code
  [
    'capture_android_screenshots',
    'screengrab # alias for "capture_android_screenshots"',
    'capture_android_screenshots(
      locales: ["en-US", "fr-FR", "ja-JP"],
      clear_previous_screenshots: true,
      app_apk_path: "build/outputs/apk/example-debug.apk",
      tests_apk_path: "build/outputs/apk/example-debug-androidTest-unaligned.apk"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



35
36
37
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 35

def self.is_supported?(platform)
  platform == :android
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'fastlane/lib/fastlane/actions/capture_android_screenshots.rb', line 8

def self.run(params)
  require 'screengrab'

  Screengrab.config = params
  Screengrab.android_environment = Screengrab::AndroidEnvironment.new(params[:android_home],
                                                                      params[:build_tools_version])
  Screengrab::DependencyChecker.check(Screengrab.android_environment)
  Screengrab::Runner.new.run

  Actions.lane_context[SharedValues::SCREENGRAB_OUTPUT_DIRECTORY] = File.expand_path(params[:output_directory])

  true
end