Sha256: 3acd0cf480a315546ed1ac1404bcd3ff4139834ba6947407eb45b876fdd46ec9

Contents?: true

Size: 1.75 KB

Versions: 230

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

230 entries across 230 versions & 1 rubygems

Version Path
fastlane-2.27.0.beta.20170408010009 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.27.0.beta.20170407010056 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.26.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.26.0.beta.20170406010019 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.26.0.beta.20170405010026 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.26.0.beta.20170404010022 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0.beta.20170403010018 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0.beta.20170402010035 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0.beta.20170401010021 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0.beta.20170331010039 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.25.0.beta.20170330225747 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170330010023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170329010023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170328010037 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170327010009 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170326010023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.24.0.beta.20170325010032 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.23.0 fastlane/lib/fastlane/actions/adb_devices.rb