Problem running android emulator from IntelliJ

Hi, I am trying to emulate an android device to test my app in IntelliJ using the command sudo ionic cordova emulate android. I keep getting the following error:

(node:2808) UnhandledPromiseRejectionWarning: CordovaError: No emulator images (avds) found.

Does anyone know how to fix this? The emulator images should exist because I am able to access them from terminal.