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

And then close and reopen the emulator with this command

emulator @TAB4 -dns-server

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


any suggestions, better solutions?

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

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

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