Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Emulator: Setting cellular signal strength to "none" still allows network traffic to go through

I am trying to simulate poor network connectivity.

I set Android Studio's emulator Cellular to Signal strength = None, but it is still allowing network traffic to go through (I am making successful HTTP requests using Okhttp after setting "None" in the emulator)

Is this a bug?

enter image description here

like image 408
tenprint Avatar asked Mar 17 '18 16:03

tenprint


People also ask

How do I disable Internet on emulator?

You can disable the Internet connection by pressing F8 in any Android emulator. It is a toggle button, so if it doesn't have Internet connection then it will start the Internet connection and if it already has an Internet connection then it will dis-connect it. No you are not late..

How do I enable Internet on Android emulator?

Go to your Android\Sdk\emulator folder and open command prompt. Type emulator -list-avds to see available emulator names. Type emulator -avd name-of-your-device -netdelay none -netspeed full -dns-server 8.8. 8.8 command and press enter.

Can Android emulator work offline?

Sure, you can use android emulator offline. Almost all the features are included in the emulator to be used offline. You'll just need to go online when you want internet connectivity in the Apps you are testing on your emulator.


2 Answers

It seems to be a bug - I also stumbled upon the problem and found this bug-report: https://issuetracker.google.com/issues/136937549 Interestingly switching to roaming there switches off the network for me (what I mainly needed - maybe it helps you too) Otherwise staring the issue can help getting a fix sooner as google then knows it is annoying to devs.

like image 78
ligi Avatar answered Sep 26 '22 08:09

ligi


You may need to set 'Network type'. I think this is a bug... so confused about it.I mean 'how Cellular data works without signal strength???'

like image 20
clzd0792 Avatar answered Sep 25 '22 08:09

clzd0792