Method: Appium::Core::Ios::Xcuitest::Device#battery_info

Defined in:
lib/appium_lib_core/ios/xcuitest/device.rb

#battery_infoHash

Get battery information.

Examples:


@driver.battery_info #=> { state: :full, level: 0.7 }

Returns:

  • (Hash)

    Return battery level and battery state from the target real device. (Simulator has no battery.) developer.apple.com/documentation/uikit/uidevice/ ‘s batteryLevel and batteryState. Battery level in range [0.0, 1.0], where 1.0 means 100% charge. -1 is returned if the actual value cannot be retrieved from the system. Battery state. The following symbols are possible :unplugged, :charging, :full

Since:

  • Appium 1.6.0



# File 'lib/appium_lib_core/ios/xcuitest/device.rb', line 154