File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,4 +42,5 @@ cat "$HOME/.android/avd/${AVD_NAME}.avd/config.ini"
4242 -wipe-data \
4343 -gpu swiftshader_indirect \
4444 -read-only \
45- -no-metrics &
45+ -no-metrics \
46+ -dns-server 10.0.2.2 &
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ adb shell "iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT
3232# Forwards requests on a specific host port to a different port on a device.
3333adb forward tcp:1212 tcp:1212
3434
35+ # Print DNS configuration for easier CI debugging.
36+ adb shell getprop net.dns1 || true
37+ adb shell getprop net.dns2 || true
38+
3539# Check that the emulator has internet connection.
3640for attempt in {1..5}; do
3741 if adb shell " ping -c 1 www.google.com" ; then
@@ -46,5 +50,21 @@ for attempt in {1..5}; do
4650 sleep 2
4751done
4852
53+ # Check that Android emulator can resolve FlowCrypt test domains.
54+ # Host-side dnsmasq resolving is not enough: the emulator has its own DNS configuration.
55+ for attempt in {1..5}; do
56+ if adb shell " ping -c 1 fes.flowcrypt.test" ; then
57+ break
58+ fi
59+
60+ if [[ " $attempt " -eq 5 ]]; then
61+ echo " Emulator can't resolve fes.flowcrypt.test"
62+ echo " Make sure ci-setup-and-run-emulator.sh starts emulator with: -dns-server 10.0.2.2"
63+ exit 1
64+ fi
65+
66+ sleep 2
67+ done
68+
4969echo " Emulator is ready"
50- set +o xtrace
70+ set +o xtrace
You can’t perform that action at this time.
0 commit comments