What is the actual right way to use tasks?

If only the app-debug.apk file is to be copied to the desktop and renamed, then see also my solution, which I listed on December 14, 2024 in my post “Android Studio: Automatic copying of the build apk file to the desktop”.