Skip to content

Commit 8dce773

Browse files
saikrishna321SrinivasanTargetKazuCocoasemantic-release-bot
authored
feat: Added support for fetching batteryInformation from shim service (#2592)
* Added support for fetching batteryInformation from shim service Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * Fix linting Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * Address review comments Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * ci: add explicit write permission (#2593) * ci: add proper permissions * chore: Bump remote debugger * chore(release): 9.9.2 [skip ci] ## [9.9.2](v9.9.1...v9.9.2) (2025-07-03) ### Miscellaneous Chores * Bump remote debugger ([edab935](edab935)) * Fix build error Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * Addressed review comments Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * move battery info from shim inside advance node in the response Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * Fix review comments Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> * Update types.ts * Fix appium-ios-remotexpc version Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> --------- Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com> Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com> Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
1 parent adf3996 commit 8dce773

File tree

7 files changed

+520
-7
lines changed

7 files changed

+520
-7
lines changed

docs/reference/execute-methods.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,15 +484,34 @@ Reads the battery information from the device under test. This endpoint only ret
484484

485485
#### Returned Result
486486

487-
The actual battery info map, which consists of the following entries:
487+
The returned object always includes at least the following entries:
488488

489-
- level: Battery level in range [0.0, 1.0], where 1.0 means 100% charge.
490-
- state: Battery state as an integer number. The following values are possible:
489+
- `level`: Battery level in range [0.0, 1.0], where 1.0 means 100% charge.
490+
- `state`: Battery state as an integer number. The following values are possible:
491491
* UIDeviceBatteryStateUnknown = 0
492492
* UIDeviceBatteryStateUnplugged = 1 // on battery, discharging
493493
* UIDeviceBatteryStateCharging = 2 // plugged in, less than 100%
494494
* UIDeviceBatteryStateFull = 3 // plugged in, at 100%
495495

496+
On iOS 18 and newer real devices, the returned object may also include many additional advanced battery information fields, such as capacity, health metrics, temperature, and more. For a full list of possible advanced fields, see the [BatteryInfo](../../lib/commands/advanced-battery-types.ts).
497+
498+
The returned object is a superset of the basic battery info, and may look like:
499+
500+
```json
501+
{
502+
"level": 0.85,
503+
"state": 2,
504+
"advanced": {
505+
"AbsoluteCapacity": 1234,
506+
"CycleCount": 456,
507+
"Temperature": 29.5,
508+
"...": "other advanced fields"
509+
}
510+
}
511+
```
512+
513+
If advanced fields are not available (e.g., on older iOS versions or simulators), only `level` and `state` will be present.
514+
496515
### mobile: deviceInfo
497516

498517
Returns the miscellaneous information about the device under test.
@@ -1777,7 +1796,7 @@ The above three extensions are available since the driver version 4.9.0.
17771796

17781797
You can create a condition on a connected device to test your app under adverse conditions, such as poor network connectivity or thermal constraints.
17791798

1780-
When you start a device condition, the operating system on the device behaves as if its environment has changed. The device condition remains active until you stop the device condition or disconnect the device. For example, you can start a device condition, run your app, monitor your apps energy usage, and then stop the condition.
1799+
When you start a device condition, the operating system on the device behaves as if its environment has changed. The device condition remains active until you stop the device condition or disconnect the device. For example, you can start a device condition, run your app, monitor your app's energy usage, and then stop the condition.
17811800

17821801
Reference: [Test under adverse device conditions (iOS)](https://help.apple.com/xcode/mac/current/#/dev308429d42)
17831802

0 commit comments

Comments
 (0)