My Android emulator has no internet on a macOS tha...
# android
j
My Android emulator has no internet on a macOS that has internet. I have no idea how to investigate or what do do? Any idea? cause this is making me mad 🙂 Edit: after using Google DNS and wiping out the data and updating everything, the internet started to work again but I don't know why
f
Are you under a proxy or something similar?
j
Nope
f
Have you checked the cellular options in the 3 dots menu of emulator?
j
My home wifi has issues that I should probably fix. Is the Android emulator connecting to the internet directly via wifi or is it using the macOS internet connection?
Extended_controls_-_Pixel2_API_29_5556_and_Android_Emulator_-_Pixel2_API_29_5556_and_jmfayard_refreshVersions__Better_dependencies_management_with_Gradle__IntelliJ___Android_Studio_-_Mozilla_Firefox.png
a
You might have some DNS issues. Try to flush your DNS or assign custom DNS
👆 1
f
I have checked my emulator, and the wifi is disconnected, just using data
I think emulator use your OS internet connection by default
j
after using Google DNS and wiping out the data and updating everything, the internet started to work again but I don't know why
👍 1
the emulator is very slow though but I guess that's normal
w
I used to have this issue after setting up custom DNS servers on my mac. I had to either set up Google’s (or other) DNS servers explicitly in emulator settings, I recall running it with
emulator -avd Pixel_2_API_28 -dns-server 1.1.1.1
the emulator is very slow though but I guess that’s normal
Depending how slow, but I wouldn’t say it’s normal. Emulator is pretty fast now in all aspects
Make sure you have HAXM installed and that you enabled kernel extension in settings -> security after that (
kextstat | grep intel
in terminal yields two entries for me)
👍 1
a
I have a similar issue when connecting to my VPN while the emulator is running. Usually rebooting the emulator solves the issue 😅
j
Thanks for the tip,
$ kextstat
gives me intelhaxm. Any way it's quick enough that I can work with this
Copy code
172    0 0xffffff7f84fb3000 0x29000    0x29000    com.intel.kext.intelhaxm (7.5.1) D0CC7B8F-1F62-33B1-BE6B-B5573D2A607B <8 6 5 3 1>
👍 1
w
That should be fine then. You can also verify in AVD Manager that for that emulator you have hardware graphics emulation, perhaps multi-core CPU if your mac allows, and reasonable RAM. And use recommended images, it should be pretty fast (specifically later emulators, like API 28/29)
a
Nexus 6 has the hardware graphics option
m
I have this issue after the laptop was suspended. Restarting the emulator usually fixes it for me (wiping data is not needed)
s
That is quite common for android, I would recommend deleting that avd and creating a new one and don’t get too stuck trying to debug it’s not worth the stress!