In OS X Yosemite, how to keep the app switcher (or dock) on my main display?
App Switcher is controlled by Dock. Whichever display the dock bar is on, so is App Switcher. This applescript is how I reset Dock bar to main display:

tell application "System Events"
    set screen edge of dock preferences to right
    set screen edge of dock preferences to bottom
end tell


If you run Dock unhidden/visible, most likely the Dock will make a flash appearance on the rightmost edge. To get rid of the flash:

tell application "System Events"

    set autohide of dock preferences to true
    delay 0.2
    set screen edge of dock preferences to right
    set screen edge of dock preferences to bottom
    set autohide of dock preferences to false

end tell


You can bind the script to a keyboard shortcut so it can be invoked quickly when necessary.

If you always have Dock hidden, you can put the script in a loop with a preferred amount of delay, and run it as a daemon. This way the daemon will periodically make sure the dock is in main display.