diff --git a/lib/gym/detect_values.rb b/lib/gym/detect_values.rb
index <HASH>..<HASH> 100644
--- a/lib/gym/detect_values.rb
+++ b/lib/gym/detect_values.rb
@@ -24,6 +24,8 @@ module Gym
         config.load_configuration_file(Gym.gymfile_name)
       end
 
+      config[:use_legacy_build_api] = true if Xcode.pre_7?
+
       detect_scheme
       detect_platform # we can only do that *after* we have the scheme
       detect_configuration
diff --git a/lib/gym/generators/package_command_generator.rb b/lib/gym/generators/package_command_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/gym/generators/package_command_generator.rb
+++ b/lib/gym/generators/package_command_generator.rb
@@ -26,7 +26,7 @@ module Gym
 
       # The generator we need to use for the currently used Xcode version
       def generator
-        if Xcode.pre_7? or Gym.config[:use_legacy_build_api]
+        if Gym.config[:use_legacy_build_api]
           PackageCommandGeneratorLegacy
         else
           PackageCommandGeneratorXcode7
Automatic setting of legacy_build_api when using an old version of Xcode