can't archive xcode

JavaScript
Archive Menu Option Grayed Out
If you can't create an archive in Xcode, usually it's because
you have the destination set to the simulator. 
Source

Also in JavaScript: