I'm running an Android API 23 x86 emulator from SDK on my MacBook. When I switch WiFi network the Android emulator loses all connections to the internet or intranet.
Every time I switch my WiFi network I need to reboot my emulator to reset the network of the virtual Android device.
Is there an option to reinitialise the network connection of the emulator without rebooting?
Then run one of the available emulators with the command, “emulator -avd DEVICE_NAME”, followed by the argument “-dns-server 8.8. 8.8”. This will launch the emulator and overwrite the default DNS server address, replacing it with the address of the primary DNS server for Google DNS.
You can set on/off AirPlane mode from the command line:
adb shell settings put global airplane_mode_on 1 && adb shell settings put global airplane_mode_on 0
Note - also try this from ADB shell (Depends on your pc tcp drivers):
settings put global airplane_mode_on 1 && am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true && settings put global airplane_mode_on 0 && am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
By doing so you re-initialize TelephonyManager
and refresh the device modem drivers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With