diff --git a/lib/cocoapods/podfile.rb b/lib/cocoapods/podfile.rb index 5e9258ff1c..cd37f880d8 100644 --- a/lib/cocoapods/podfile.rb +++ b/lib/cocoapods/podfile.rb @@ -223,7 +223,13 @@ def platform(name, target = nil) when :ios target = '4.3' when :osx - target = '10.6' + # Get the current version of OS X if we can, otherwise default to 10.6 + begin + os_version = `sw_vers -productVersion`.chomp + target = os_version.split('.')[0, 2].join('.') + rescue + target = '10.6' + end else raise ::Pod::Podfile::Informative, "Unsupported platform: platform must be one of [:ios, :osx]" end