3

The Android Virtual Device is connected by defualt to a wifi network called "AndroidWifi". I am working with an app that expects to be connected to a wifi network with a particular name.

How can I change the name of the wifi network from "AndroidWifi"?

Mark Omo
  • 898
  • 2
  • 12
  • 26
  • AndroidWifi is a simulated access point by the avd so far i dont think there is any way to change this name. – ivan Nov 15 '19 at 23:49

3 Answers3

2

Try something more pragmatic:

String getExpectedId() {
    String ssid = this.getResources().getString(R.string.default_ssid);
    if(Build.FINGERPRINT.contains("generic")) {ssid = "AndroidWifi";}
    return ssid;
}

because you won't change the SSID (service set identifier) of the emulator's WiFi.


Despite there's adb commands alike svc wifi enable and svc wifi disable, the password for the default network likely is unknown in /data/misc/wifi/wpa_supplicant.conf; see Connecting to WiFi using adb shell. Since the emulator is rooted, one can generally configure any network alike that, while it is accessible (which the regular WiFi, which is exists in reality, obviously isn't). I think the first one approach is better, because editing emulator images isn't too portable.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0

AVD manager doesn't provide any ways to customize the simulated Wi-Fi access point AndroidWifi .

You may have to disable it and use another wifi simulator such as this one. It does need the Xposed framework in order to function. Here is how you can configure it.

Bertram Gilfoyle
  • 9,899
  • 6
  • 42
  • 67
0

You can modify the hostapd.conf file in your device (/data/vendor/wifi/hostapd/hostapd.conf). It will allow you to set ssid (ssid=) or even to set a password (wpa_passphrase). You will need a root access to do that.

More details at https://wiki.gentoo.org/wiki/Hostapd#WiFi_Technology

mast313
  • 11
  • 1