My pod fails to lint with Xcode and CP 1.1 RC2. It is preventing me from pushing to trunk.
I am using a Gemfile now to specify the version of CP to use. It is set to 1.1.0.rc.2 and I am using Xcode 8.0 with macOS Sierra. I use the following command which result in an error.
bundle exec pod lib lint --no-clean
Previous to Xcode 8 I was using Xcode 7.3.1 and CP 1.0 and linting was successful for multiple recent releases.
ERROR | [iOS] unknown: Encountered an unknown error (Invalid OSios, valid values are watchos) during validation.
This pod supports iOS and macOS. There is no target or line in the podspec for watchOS. When I use the --no-clean switch and open the generated workspace Xcode is unable to build the project. I see the following errors when building for device.
Bundle identifier is missing. App doesn't have a bundle identifier for the Debug build configuration. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
The build is successful is the Simulator is selected.
This is the error which looks similar to other errors I've seen with recently reported issues and PRs but I've not been able to use the same fixes and there does not appear to be another CP release to try.
CocoaPods : 1.1.0.rc.2
Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
RubyGems : 2.0.14.1
Host : Mac OS X 10.12 (16A323)
Xcode : 8.0 (8A218a)
Git : git version 2.8.4 (Apple Git-73)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ b7ed57af95970baa4c282016a835a29fdaa82a99
Executable Path: /Users/brennan/.gem/bin/pod
cocoapods-deintegrate : 1.0.1
cocoapods-keys : 1.7.0
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.0.0
cocoapods-try : 1.1.0
target 'StravaDemo' do
use_frameworks!
platform :ios, '9.0'
# Pods for StravaDemo
target 'StravaDemoTests' do
inherit! :search_paths
# Pods for testing
pod 'Swifter', '~> 1.2'
end
end
target 'StravaKit-iOS' do
use_frameworks!
platform :ios, '9.0'
# Pods for StravaKit-iOS
target 'StravaKitTests-iOS' do
use_frameworks!
inherit! :search_paths
# Pods for testing
pod 'Swifter', '~> 1.2'
end
end
target 'StravaKit-Mac' do
use_frameworks!
platform :osx, '10.11'
# Pods for StravaKit-Mac
target 'StravaKitTests-Mac' do
use_frameworks!
inherit! :search_paths
# Pods for testing
pod 'Swifter', '~> 1.2'
end
end
Feels a lot like https://github.com/CocoaPods/CocoaPods/issues/5878
I agree. Can you verify which simulators you have installed?
I did trim my list of Simulators to just serve my needs. The list has become quite long. Is there any particular Simulator CP uses which I should have installed?

I saw #5878 but I am not working with Apple TV and have multiple iOS Simulators installed.
I tried adding simulators for watchOS and tvOS as well as a few iOS simulators but none of those attempts eliminated the errors.
I just cloned StravaKit, ran pod lib lint with 1.1.0.rc.2, and it passed validation. It seems like there's something different about your setup, but I don't know what that is. Here are the simulators I have installed (all iOS 10):

Based on the verbose output, mine validated using iPhone 5. I'm not sure why exactly. Could you start my installing the iPhone 5 sim, and then adding more from there if that doesn't work? Maybe we can track this down.
I wonder if a validator for sim platforms could be added to fourflusher for better error reporting here
@benasher44 Later I will try adding each of the simulators you have listed which I do not have installed and try each one. I will report back the details.
@benasher44 Can you share the results of this command?
xcrun simctl list
The identifiers could be helpful in ensuring I get the right one installed to satisfy four-flusher and CP. Mine is below.
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
Apple TV 1080p (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
== Runtimes ==
iOS 8.4 (8.4 - 12H141) (com.apple.CoreSimulator.SimRuntime.iOS-8-4)
iOS 9.0 (9.0 - 13A344) (com.apple.CoreSimulator.SimRuntime.iOS-9-0)
iOS 9.1 (9.1 - 13B143) (com.apple.CoreSimulator.SimRuntime.iOS-9-1)
iOS 9.3 (9.3 - 13E233) (com.apple.CoreSimulator.SimRuntime.iOS-9-3)
iOS 10.0 (10.0 - 14A345) (com.apple.CoreSimulator.SimRuntime.iOS-10-0)
tvOS 9.2 (9.2 - 13Y234) (com.apple.CoreSimulator.SimRuntime.tvOS-9-2)
tvOS 10.0 (10.0 - 14T328) (com.apple.CoreSimulator.SimRuntime.tvOS-10-0)
watchOS 2.2 (2.2 - 13V144) (com.apple.CoreSimulator.SimRuntime.watchOS-2-2)
watchOS 3.0 (3.0 - 14S326) (com.apple.CoreSimulator.SimRuntime.watchOS-3-0)
== Devices ==
-- iOS 8.4 --
iPhone 5 (8.4) (DF8EE88B-CC3B-4C33-AF7E-F0A37EA658FE) (Shutdown)
-- iOS 9.0 --
iPhone 6 (9.0) (CE71AC4A-0A5A-4E8A-AA52-0BC37C38E767) (Shutdown)
-- iOS 9.1 --
-- iOS 9.3 --
iPhone 6 (9.3) (01F86835-F256-4580-A795-18E05862CA1A) (Shutdown)
iPhone SE (9.3) (144D97A9-17AB-4BCB-A307-3338838EF18C) (Shutdown)
iPad 2 (9.3) (4D56FE3F-5182-4182-9271-73F4B669576B) (Shutdown)
-- iOS 10.0 --
iPhone 7 (10.0) (CEBEA01D-3F31-4982-AD3B-4F1407E18CE3) (Shutdown)
iPhone 7 (10.0) (80706B8D-3020-42ED-8DD0-65CF629322EE) (Shutdown)
iPhone SE (10.0) (1FDE2607-BA0D-4CA9-8194-DC7A7B851F61) (Shutdown)
-- tvOS 9.2 --
-- tvOS 10.0 --
Apple TV (10.0) (4B6B828E-FAFA-4D1A-B73F-22B047F5028B) (Shutdown)
-- watchOS 2.2 --
-- watchOS 3.0 --
Apple Watch (3.0) (AA9FE089-D39D-402A-96AA-2604A6E2CA83) (Shutdown)
Apple Watch Series 2 - 38mm (FF2126CE-1728-4F85-A456-8837BBCD6D82) (Shutdown)
Apple Watch Series 2 - 42mm (D37094CB-476F-4F94-9B77-419DFDE5789C) (Shutdown)
== Device Pairs ==
7DE144DE-AA9C-4E48-9F99-32AFD951038B (active, disconnected)
Watch: Apple Watch (3.0) (AA9FE089-D39D-402A-96AA-2604A6E2CA83) (Shutdown)
Phone: iPhone 7 (10.0) (80706B8D-3020-42ED-8DD0-65CF629322EE) (Shutdown)
71825791-DE41-462A-9826-E20DC4466E50 (active, disconnected)
Watch: Apple Watch Series 2 - 42mm (D37094CB-476F-4F94-9B77-419DFDE5789C) (Shutdown)
Phone: iPhone 7 (10.0) (CEBEA01D-3F31-4982-AD3B-4F1407E18CE3) (Shutdown)
I figured out what may be the cause. I removed all of the iOS Simulators after installing Xcode 8 since it looked like it was a bit garbled. With an empty list I manually added back just what I needed. I set the name to the device and iOS version, like iPhone 6 (9.3), to make it easier to run apps on the device and runtime I needed for testing. In fourflusher the xcrun simctl list command is used to get a list which is then processed using a regex and lines like the one below to extract the identifier.
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
Side by side with the custom name it is clear why the regex which is used is failing.
iPhone 6 (9.3)
This is why I believe the lint command was failing. With values like 9.3 and 10.0 which are not valid identifiers for xcodebuild the lint command could not work. It also explains the strange error which I found originates at the following line.
Now that I know how the internals of the lint command work I have a couple of workarounds.
Either of the following will correct the problem.
1) Do not use custom names for simulated devices
2) Do not use parentheses in custom names
Since Xcode allows for setting custom names for simulated devices the lint command should be more resilient to these custom names. Instead of using a regex on the output from the xcrun simctl list command it possible to add a -j switch to that command so that it outputs JSON data.
`xcrun simctl list -j
This JSON data lists devicetypes, runtimes, devices and pairs with the names and identifiers in separate properties so a regex would not be necessary. The runtimes appear to have all of the details that are needed to filter by device and runtime. It is possible to request just that section of data.
xcrun simctl list -j runtimes
From there it is possible to filter on the runtime version and OS to a list of usable simulators to get valid identifiers without using regex.
Perhaps fourflusher could be updated to use this JSON data and eliminate the regex on the raw text. I wish I could do more to help. I only know enough Ruby to read and barely understand it. Otherwise I would work out this bug fix and send a PR.
awesome find.
IIRC, the reason why I didn't use the JSON output of simctl in fourflusher was that it isn't supported in Xcode 6.x and I didn't want to have two different codepaths. Since 6.x isn't supported on 10.11 or 10.12, it might be time to cut it off, though and switch to a more robust solution for discovering simulators.
@brennanMKE it looks like you figured it out, but here's the output anyway:
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
Apple TV 1080p (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
== Runtimes ==
iOS 10.0 (10.0 - 14A345) (com.apple.CoreSimulator.SimRuntime.iOS-10-0)
tvOS 10.0 (10.0 - 14T328) (com.apple.CoreSimulator.SimRuntime.tvOS-10-0)
watchOS 3.0 (3.0 - 14S326) (com.apple.CoreSimulator.SimRuntime.watchOS-3-0)
== Devices ==
-- iOS 10.0 --
iPhone 5 (B7D21008-CC16-47D6-A9A9-885FE1FC47A8) (Shutdown)
iPhone 5s (38EAE7BD-90C3-4C3D-A672-3AF683EEC5A2) (Shutdown)
iPhone 6 (C40D496E-8762-40D5-9078-84A79FB100A7) (Shutdown)
iPhone 6 Plus (1C0E58C5-7C4F-4194-88C8-FA66C36B8893) (Shutdown)
iPhone 6s (7508B272-BF2E-4DE5-B3C9-66E59298901C) (Shutdown)
iPhone 6s Plus (057C56F2-417F-4ABE-94B6-21D4687D459C) (Shutdown)
iPhone 7 (53E2E441-7D60-44E7-AC36-85492423A71D) (Shutdown)
iPhone 7 Plus (7F565AE1-B338-45D0-A8A8-C87BBEC0F6E0) (Shutdown)
iPhone SE (49EBABE5-B1BF-4EB5-98C5-2DF8648A24D0) (Shutdown)
iPad Retina (B4EA8A90-4A71-488E-8165-E19C05AE8E8A) (Shutdown)
iPad Air (27C7FEC8-40A2-4BEE-8A19-95086DAC07F3) (Shutdown)
iPad Air 2 (D937A145-EE01-49F6-A828-A4DB802946D8) (Shutdown)
iPad Pro (9.7 inch) (4F661B02-2F8F-449F-8BA1-70E8C4535139) (Shutdown)
iPad Pro (12.9 inch) (9C48D93D-FADE-4BCF-894B-E0DE9E6C43C5) (Shutdown)
-- tvOS 10.0 --
Apple TV 1080p (12E58D8A-24EF-41D0-8819-6D10DF44556D) (Shutdown)
-- watchOS 3.0 --
Apple Watch - 38mm (FCA208DB-66E4-4B98-859B-0A1FB266E145) (Shutdown)
Apple Watch - 38mm (5F5CC28C-F920-492A-9D9C-A5967CDBB1CE) (Shutdown)
Apple Watch - 38mm (058CEFC2-1507-4757-870B-C99C2A22D805) (Shutdown)
Apple Watch - 38mm (9222BD17-0751-4514-B78A-32F1F4CA6817) (Shutdown)
Apple Watch - 38mm (A901FB82-2D0D-47BB-8CF8-49DBE3E30860) (Shutdown)
Apple Watch - 42mm (A70C6533-78ED-4C94-BFB3-8B62F28F94E1) (Shutdown)
Apple Watch - 42mm (1D75F324-AA48-40EF-BB6C-33534AF792D9) (Shutdown)
Apple Watch - 42mm (63E13D90-6E78-425E-923D-2A2FC1522488) (Shutdown)
Apple Watch - 42mm (B6D68AA6-60EA-4C74-B379-856A63999DB4) (Shutdown)
Apple Watch Series 2 - 38mm (9B4DAC1D-94E4-473C-9F6A-57E65B716E82) (Shutdown)
Apple Watch Series 2 - 42mm (81C16A1E-EA76-47D8-A8DC-143803C8914A) (Shutdown)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-9-3 --
iPhone 6 (8D598963-A8B5-441F-8471-4FB406F5DE82) (Shutdown) (unavailable, runtime profile not found)
== Device Pairs ==
01ADF060-F9C5-4E86-88AA-D4D6424A0416 (active, disconnected)
Watch: Apple Watch - 38mm (A901FB82-2D0D-47BB-8CF8-49DBE3E30860) (Shutdown)
Phone: iPhone 6 (C40D496E-8762-40D5-9078-84A79FB100A7) (Shutdown)
8B646B9E-B962-4FFC-8056-AC584ECDA30F (active, disconnected)
Watch: Apple Watch - 42mm (A70C6533-78ED-4C94-BFB3-8B62F28F94E1) (Shutdown)
Phone: iPhone 6 Plus (1C0E58C5-7C4F-4194-88C8-FA66C36B8893) (Shutdown)
4B12567E-FDB4-44D1-8739-7BDE2DBC43D5 (active, disconnected)
Watch: Apple Watch Series 2 - 38mm (9B4DAC1D-94E4-473C-9F6A-57E65B716E82) (Shutdown)
Phone: iPhone 7 (53E2E441-7D60-44E7-AC36-85492423A71D) (Shutdown)
CF29BED4-495A-4A1C-B864-CA6EA4BA91C6 (active, disconnected)
Watch: Apple Watch Series 2 - 42mm (81C16A1E-EA76-47D8-A8DC-143803C8914A) (Shutdown)
Phone: iPhone 7 Plus (7F565AE1-B338-45D0-A8A8-C87BBEC0F6E0) (Shutdown)
Let me know if there is anything I can do to help out. I expect I could pull an update from a branch and test out the changes. My Gemfile for the project is easy enough to point to what I will test.
I see some instances like the iPad Pro include enclosed parentheses which would be a problem with the regex. The switch to using JSON would likely make this code more future-proof. cc @benasher44
@brennanMKE my PR to switch to json output is up! If you could try with that branch of fourflusher, that'd be much appreciated!
I will check it out. Thanks for the fast work. :)
I tested it with the following Gemfile. I ran the command below with simulators names without the iOS version number in parentheses and then again after adding these values back in for the custom simulator names. Both times the command bundle exec pod lib lint was successful.
The update appears to have worked. I looked through your changes and the tests and see that it tests for iOS 9.3 and 11.0 with the test data to ensure the minimum version is enforced. If all tests pass I'd say this is good to go. Good work! 馃槂
sims = sims.select { |sim| sim.os_name == os && sim.compatible?(minimum_version) }
If that is filtering the input from xcrun simctl list -j devices to the minimum usable version then this appears to ready to go.
source 'https://rubygems.org'
gem 'fourflusher', :git => 'https://github.com/benasher44/fourflusher.git', :branch => 'basher_json'
gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', :tag => '1.1.0.rc.2'
gem 'cocoapods-keys'
gem 'xcpretty'
gem 'xcodeproj'
{
"devices" : {
"tvOS 9.2" : [
],
"iOS 9.1" : [
],
"iOS 9.0" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone 6 (9.0)",
"udid" : "CE71AC4A-0A5A-4E8A-AA52-0BC37C38E767"
}
],
"iOS 10.0" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone 7 (10.0)",
"udid" : "8B1F99C1-DDB6-46AE-9C1F-7D82B6141167"
},
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone SE (10.0)",
"udid" : "1FDE2607-BA0D-4CA9-8194-DC7A7B851F61"
},
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPad Retina (10.0)",
"udid" : "84CDA9E7-AC29-4F50-AC20-B45556D888F9"
}
],
"tvOS 10.0" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "Apple TV 1080p (10.0)",
"udid" : "4B6B828E-FAFA-4D1A-B73F-22B047F5028B"
}
],
"watchOS 2.2" : [
],
"watchOS 3.0" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "Apple Watch Series 2 - 38mm",
"udid" : "FF2126CE-1728-4F85-A456-8837BBCD6D82"
}
],
"iOS 8.4" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone 5 (8.4)",
"udid" : "DF8EE88B-CC3B-4C33-AF7E-F0A37EA658FE"
}
],
"iOS 9.3" : [
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone 6 (9.3)",
"udid" : "01F86835-F256-4580-A795-18E05862CA1A"
},
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPhone SE (9.3)",
"udid" : "144D97A9-17AB-4BCB-A307-3338838EF18C"
},
{
"state" : "Shutdown",
"availability" : "(available)",
"name" : "iPad 2 (9.3)",
"udid" : "4D56FE3F-5182-4182-9271-73F4B669576B"
}
]
}
}
It looks like 4 tests are failing.
https://travis-ci.org/CocoaPods/fourflusher/builds/163746159
Huh interesting. They all pass locally. I'll have a look shortly.
Thanks for trying it out, and I'm glad it improved things!
@brennanMKE I've pushed a few more updates, and now Travis is green. Can you update and give it another try just to be safe?
I will try the next chance I get.
I've tested it with the latest changes on that branch. Linting passed successfully again with the custom names which include the parentheses.
Awesome thanks! Changes are now in CocoaPods master, so it'll all be available in the next release. Thanks for your help!
Thanks to you as well.
Most helpful comment
IIRC, the reason why I didn't use the JSON output of
simctlin fourflusher was that it isn't supported in Xcode 6.x and I didn't want to have two different codepaths. Since 6.x isn't supported on 10.11 or 10.12, it might be time to cut it off, though and switch to a more robust solution for discovering simulators.