Enabling malloc debug in Android Studio project

Does anyone know how to enable the malloc debug library using an Android Studio project? I’ve read the documentation about wrap.sh but the description doesn’t work with my project structure. Some simple clear steps would be great.