emulator-commandline documentation
For first download Android Studio.
For start emulator
sudo ~/Library/Android/sdk/emulator/emulator -avd <your_avd_name> -writable-system -netdelay none -netspeed full
For find
<your_avd_name>
typesudo ~/Library/Android/sdk/emulator/emulator -list-avds
cd ~/Library/Android/sdk/platform-tools
./adb root
./adb remount
./adb pull /system/etc/hosts hosts
vim hosts
Example
127.0.0.1 localhost
::1 ip6-localhost
10.0.2.2 example.com
Change hosts
file. We need to use the IP address where our local server is running. Finally we need to update this file on the Android system
./adb push hosts /etc/hosts
./adb push hosts /etc/system/hosts
./adb push hosts /system/etc/hosts
Push your certificates to device (also you can drag and drop them, they will dropped in same folder)
> ./adb push <root_cert_path> /sdcard/Download
> ./adb push <local_cert_path> /sdcard/Download
For me <root_cert_path>
is
./adb push ~/Library/Application\ Support/mkcert/rootCA.pem /sdcard/Download
And <local_cert_path>
is
./adb push ~/cert/local.stage307.tech+7.pem /sdcard/Download
Then open Android Settings
and type to seach field Advanced Wi-Fi
and go to. Next tap to Install certificates
and install them (type any name in dialog).