Sha256: 248c56a9800638a00f68f118e6417556405920c9115b21a2549109d3bd891202

Contents?: true

Size: 1.79 KB

Versions: 458

Compression:

Stored size: 1.79 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)",
                                       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

458 entries across 458 versions & 2 rubygems

Version Path
fastlane-2.184.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.184.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.183.2 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.183.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.183.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.182.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.181.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.180.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.180.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.179.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.178.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.177.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.176.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.175.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.174.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.173.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.172.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.171.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.170.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.169.0 fastlane/lib/fastlane/actions/adb_devices.rb