Adjusting Network Connection
The Selenium Mobile JSON Wire Protocol Specification supports an API for getting and setting the network connection for a device. The API works through a bitmask, assigning an integer to each possible state://网络连接方式:数据、wifi、飞行模式。
Value (Alias) | Data | Wifi | Airplane Mode |
---|---|---|---|
0 (None) | 0 | 0 | 0 |
1 (Airplane Mode) | 0 | 0 | 1 |
2 (Wifi only) | 0 | 1 | 0 |
4 (Data only) | 1 | 0 | 0 |
6 (All network on) | 1 | 1 | 0 |
iOS
Unfortunately, at the moment Appium does not support the Selenium network connection API for iOS.//iOS系统不支持这个API。
Android
Choose the setting you would like to use, and then send the correct bitmask from the table above.//安卓支持这个API。