Add Android emulator parameters to ionic cordova emulate command

For some reason the Android emulator does not rout to my local machine properly. As a work around I have to use the following commands to get live reload functionality in the emulator.

ionic cordova emulate android --target=TAB4 --livereload --address=my-local-domain.com

And then close and reopen the emulator with this command

emulator @TAB4 -dns-server 192.168.100.114

Does anyone know how to add the “-dns-server 192.168.100.114” parameter to the original command so that I don’t have to close and reopen the emulator to get live reload to work properly?

Thanks

any suggestions, better solutions?

According to the cordova and ionic documentation you can use the following command

ionic cordova run android -- -- -dns-server 8.8.8.8

Note that double dashes repeated because ionic additional parameters will be passed to cordova and them it will passed to the emulator.

See more details in the docs bellow


https://cordova.apache.org/docs/en/latest/reference/cordova-cli/