First, make sure that the Intel HAXM is up to date. You update it by opening the SDK and selecting it in the list.
Then, on Mac, the Android SDK gets installed at: /Users/username/Library/Android/sdk/, therefore, you will need to run the script as sudo, as follows:
If all goes well, the script prints the message: “Silent installation Pass!”
Then, restart Android Studio and run your app with the desired AVD.