Sha256: 989f672cef0ff87b562b59e28c558f7fec956782fd8c449c2fd9e7aa21451f4e

Contents?: true

Size: 1.75 KB

Versions: 354

Compression:

Stored size: 1.75 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."
        ].join("\n")
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :adb_path,
                                       env_name: "FL_ADB_PATH",
                                       description: "The path to your `adb` binary",
                                       is_string: true,
                                       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

354 entries across 354 versions & 1 rubygems

Version Path
fastlane-2.90.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180410050128 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180409050033 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180408050113 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180407050037 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180406050006 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180405050125 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180404050031 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180403050108 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180402050042 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180401050120 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180331050023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180330050046 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180329050050 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.89.0.beta.20180328050040 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.88.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.88.0.beta.20180327050037 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.88.0.beta.20180325050025 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.88.0.beta.20180324050059 fastlane/lib/fastlane/actions/adb_devices.rb