def recreate_user_schemes(visible = true)
      schemes_dir = XCScheme.user_data_dir(path)
      FileUtils.rm_rf(schemes_dir)
      FileUtils.mkdir_p(schemes_dir)

      xcschememanagement = {}
      xcschememanagement['SchemeUserState'] = {}
      xcschememanagement['SuppressBuildableAutocreation'] = {}

      targets.each do |target|
        scheme = XCScheme.new

        test_target = target if target.respond_to?(:test_target_type?) && target.test_target_type?
        launch_target = target.respond_to?(:launchable_target_type?) && target.launchable_target_type?
        scheme.configure_with_targets(target, test_target, :launch_target => launch_target)

        yield scheme, target if block_given?
        scheme.save_as(path, target.name, false)
        xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"] = {}
        xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"]['isShown'] = visible
      end

      xcschememanagement_path = schemes_dir + 'xcschememanagement.plist'
      Plist.write_to_path(xcschememanagement, xcschememanagement_path)
    end
def recreate_user_schemes(visible = true)
      schemes_dir = XCScheme.user_data_dir(path)
      FileUtils.rm_rf(schemes_dir)
      FileUtils.mkdir_p(schemes_dir)

      xcschememanagement = {}
      xcschememanagement['SchemeUserState'] = {}
      xcschememanagement['SuppressBuildableAutocreation'] = {}

      targets.each do |target|
        scheme = XCScheme.new

        test_target = target if target.respond_to?(:test_target_type?) && target.test_target_type?
        launch_target = target.respond_to?(:launchable_target_type?) && target.launchable_target_type?
        scheme.configure_with_targets(target, test_target, :launch_target => launch_target)

        yield scheme, target if block_given?
        scheme.save_as(path, target.name, false)
        xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"] = {}
        xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"]['isShown'] = visible
      end

      xcschememanagement_path = schemes_dir + 'xcschememanagement.plist'
      Plist.write_to_path(xcschememanagement, xcschememanagement_path)
    end
Recreates the user schemes of the project from scratch (removes the
 folder) and optionally hides them.

 @param  [Bool] visible
         Whether the schemes should be visible or hidden.

 @return [void]