Sha256: 6f71c75986d9e91695f8b45c9abba6fc3ae860d2f7702861f398db10710b2e35

Contents?: true

Size: 1.73 KB

Versions: 66

Compression:

Stored size: 1.73 KB

Contents

module Fastlane
  module Actions
    module SharedValues
    end

    class AdbDevicesAction < Action
      def self.run(params)
        adb = Helper::AdbHelper.new(adb_path: params[:adb_path])
        result = adb.load_all_devices
        return result
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Get an array of Connected android device serials"
      end

      def self.details
        "Fetches device list via adb, e.g. run an adb command on all connected devices."
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :adb_path,
                                       env_name: "FL_ADB_PATH",
                                       description: "The path to your `adb` binary (can be left blank if the ANDROID_SDK_ROOT environment variable is set)",
                                       optional: true,
                                       default_value: "adb")
        ]
      end

      def self.output
      end

      def self.example_code
        [
          'adb_devices.each do |device|
            model = adb(command: "shell getprop ro.product.model",
                        serial: device.serial).strip

            puts "Model #{model} is connected"
          end'
        ]
      end

      def self.sample_return_value
        []
      end

      def self.category
        :misc
      end

      def self.return_value
        "Returns an array of all currently connected android devices"
      end

      def self.authors
        ["hjanuschka"]
      end

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

Version data entries

66 entries across 66 versions & 4 rubygems

Version Path
fastlane-2.225.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.224.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.223.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.223.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.222.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.221.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.221.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.220.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.219.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.218.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-security-patched-2.216.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.217.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.216.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.215.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.215.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-mercafacil-2.214.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.214.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.213.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.212.2 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane_pricing_fix-2.212.1 fastlane/lib/fastlane/actions/adb_devices.rb