Use builtin wait for emulator script per the docs