Official Apple guide is here
In Xcode schemes are used to modify the way a app is run or tested. You can add actions in form of shell scripts and email actions, before and/or after different phases of app like compilation, run, test, profiling etc. See Fig 1. Additionally you can pass custom arguments to your app, change the environment variables etc. You can explore things yourself by expanding the arrow and clicking on different sections.
There are times when a scheme gets corrupted due to things like renaming an app or sometimes schemes changes automatically while opening Xcode project. The best thing to correct such errors is to create a new scheme.
Note# Some apps throws error on AppNameTest target which it should not throw as AppNameTest Target is not usable in most of the apps. To remove that error go to edit scheme > build > build and uncheck the Run column under AppNameTest column. (Fig 5)