<commit_before>[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
# Toggle WiFi

Switch the state of the wifi service
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## Example Usage

```java
// Java
driver.toggleWifi();

```

```python
# Python
driver.toggle_wifi()

```

```javascript
// Javascript
// webdriver.io example
driver.toggleWiFi();

// wd example
await driver.toggleWiFi();

```

```ruby
# Ruby
# ruby_lib example
toggle_wifi

# ruby_lib_core example
@driver.toggle_wifi

```

```php
# PHP
// TODO

```

```csharp
// C#
// TODO

```


[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## Support

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)<commit_msg>docs: Update generated docs [ci skip] (#13934)<commit_after>[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
# Toggle WiFi

Switch the state of the WiFi service
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## Example Usage

```java
// Java
driver.toggleWifi();

```

```python
# Python
driver.toggle_wifi()

```

```javascript
// Javascript
// webdriver.io example
driver.toggleWiFi();

// wd example
await driver.toggleWiFi();

```

```ruby
# Ruby
# ruby_lib example
toggle_wifi

# ruby_lib_core example
@driver.toggle_wifi

```

```php
# PHP
// TODO

```

```csharp
// C#
// TODO

```

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## Description

Switch the state of the WiFi service.
Since Android Q, a method to change the WiFi service state has been restricted. [#12327](https://github.com/appium/appium/issues/12327) Please toggle the state via UI instead of this method. The UI flow depends on devices. Please make sure to encode the correct UI flow on your target device under test.


[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## Support

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
{'fraction_non_alphanumeric': 0.13202042304886943, 'fraction_numerical': 0.005470459518599562, 'mean_word_length': 3.9602169981916817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1361384', 'n_tokens_mistral': 922, 'n_tokens_neox': 843, 'n_words': 296}