Updated script to handle situations where the iOS Simulator menu does not have a "versions" menu for each device (usually occurs if Xcode only has simulators installed for a single OS version).