Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

1.

In visual studio go to Tools -> Android -> Android adb command prompt

2. run command:
cd C:\Program Files (x86)\Android\android-sdk\emulator
this is to navigate to the emulator folder in android sdk
now the directory should be
C:\Program Files (x86)\Android\android-sdk\emulator>

3. run command:
emulator.exe -avd pixel_3a_xl_r_11_0_-_api_30 -writable-system
emulator.exe -avd nexus_10_r_11_0_-_api_30 -writable-system
emulator.exe -avd pixel_2_oreo_8_1_-_api_27 -writable-system
where nexus_6p_pie_9_0_-_api_28 is the name of the emulator in the Android device
manager (all lower case and replace space with underscores)
NOTE: make sure that the emulator has only Google APIs and NOT Google play store
otherwise it gives the error "not running as root. try "adb root" first."
-writable-system mode ensure that we open the emulator in write mode (otherwise it
is read only)

4. Open the system command prompt and navigate to the platform tools directory
run command:
cd C:\Program Files (x86)\Android\android-sdk\platform-tools
now the directory should be
C:\Program Files (x86)\Android\android-sdk\platform-tools>

5. run command:
adb root

6. run command:
adb remount
if you get failed with code 7 do NOT try "adb disable-verity" it destroys the
emulator in writable-system mode
create a new emulator with android version 27 OR LESSER and try the above steps
again.

7. even with the writable-system not working, start the emulator by


emulator.exe -avd nexus_6p_pie_9_0_-_api_28

8. run commands:
adb pull /system/etc/hosts

DO NOT go to the shell su mode because it doesn't help (DO NOT do the follwing
steps):
adb root
adb shell
su
mount -o remount,rw /sys
exit
adb root

9. the hosts file got pulled to location C:\Users\parig\AppData\Local\VirtualStore\


Program Files (x86)\Android\android-sdk\platform-tools as hosts

10. Open the hosts file and add the entry (give only spaces and not tabs in between
the IP and domain):
10.0.2.2 test.strdus.com
MAKE SURE TO ADD AN EXTRA NEW LINE AFTER THIS otherwise the android emulator cannot
read it.
ALSO USE ONLY SPACES AND NO TABS (UNIX LINE ENDINGS)
11. run commands:
adb push hosts /system/etc
to push the edited hosts file to the emulator

12. Now go to the browser in the emulator and try https://test.strds.com:5001


It should load the login page without giving a security warning

You might also like