- Install Android Studio
- Add android to PATH in your
.bash_profileor.zshrcfile:
export ANDROID_SDK=$HOME/Library/Android/sdkexport PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATHexport PATH=${PATH}:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
- In AVD manager: Create a test device without the (Google API) Play Services
- Choose a new device in "Select Hardware". Click next.
- In "System Image" click on "x86 Images". Choose a version without "(Google APIs)" which you probably have to download on the left.
- In your terminal window type:
emulator -writable-system -avd <your-device-name>
- The emulator should now open a phone.
- Open another terminal window(!). Then type and hit enter:
adb root
- It should say: "restarting adbd as root" or "running as root"
- Type and hit enter:
adb remount
- It should say: "remount succeeded"
- Type and hit enter:
adb push Desktop/hosts /system/etc/
- (Or use any path where your hosts file is.)
- Validate by going to the shell and looking at the hosts file:
- Type and hit enter:
adb shell - Your are now in the shell.
- Type and hit enter:
cat system/etc/hosts - You should now see the new hosts file.
- Shut down the emulated phone.
- Launch the phone again with:
emulator -writable-system -avd <your-device-name> - Google something like "cats" to see if you're connected to the internet.
- Type into the browser bar:
https://dev.blahblah.com - Follow the sign in flow.
adb -s emulator-5554 emu kill