Some result for manual start AVD and getting the root on Android 7+ (under Win10):
1) Start the emulator AVD manually from folder SDK\tools (SDK - folder where the Android SDK is installed):
emulator.exe -avd 6in_Phone_Platform_28_google_apis -verbose -writable-system -selinux disabled
where "6in_Phone_Platform_28_google_apis" = AVD's name from SDK\B4AEmulator folder
2) ADB commands (from SDK\platform-tools):
adb start-server
adb -s emulator-5554 root
adb -s emulator-5554 remount
where "emulator-5554" = started emulator's instance name
3) Get and unpack SuperSU files set (
https://download.chainfire.eu/696/supersu/) into a folder.
4) Next .bat file script, that should be saved to the folder of SuperSU and started:
set adb=adb -e
set arch=x64
%adb% install common/Superuser.apk
%adb% push %arch%/su /system/bin/su
%adb% shell chmod 0755 /system/bin/su
%adb% push %arch%/su /system/xbin/su
%adb% shell chmod 0755 /system/xbin/su
%adb% shell su --install
%adb% shell "su --daemon&"
%adb% shell setenforce 0
exit /b
where
"set adb=adb -e" - for the single emulator (should be edited for the emulator instance, if not single device connected).
"set arch=x64" - architecture of the AVD you start
---------------------
I have tested with API28 AVD (google api !), any help to automate all this to start an AVD by a single .bat file is very appreciated.