I'd like to cut off emulator's internet while keeping wifi and mobile data enabled so I can run some automated tests covering this case without having to turn off the internet manually.
While running an emulator on the PC it gets its internet access through the host PC, I'm interested in whether there's an adb
command that would let me disable (and re-enable mid-test, potentially multiple times) the internet access the emulator is getting from the host PC while keeping wifi and mobile data enabled?
I've been using svc wifi/data enable/disable
to enable and disable wifi and mobile data repectively.
This could be a duplicate of Can I truly enable and disable network access mid-test? but taking into account that it's almost 10 years old something might have changed in the meantime.