Sha256: 5b4aca03bcebe142075396906fd5756e5d53c9852a001ba3542f0b92da91aa4d

Contents?: true

Size: 1.82 KB

Versions: 20

Compression:

Stored size: 1.82 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 (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

20 entries across 20 versions & 1 rubygems

Version Path
fastlane-2.94.0.beta.20180425050017 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.94.0.beta.20180424050050 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180423050019 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180422050034 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180421050012 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180420050021 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180419050008 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180418050020 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.92.1 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.93.0.beta.20180417050013 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.92.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.92.0.beta.20180416050023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.92.0.beta.20180415050019 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.92.0.beta.20180414050023 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.91.0 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.91.0.beta.20180413050017 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180412050111 fastlane/lib/fastlane/actions/adb_devices.rb
fastlane-2.90.0.beta.20180411050056 fastlane/lib/fastlane/actions/adb_devices.rb