cocoapods can't find simulators, pod repo push fails
do below steps it solved my issue For XCode 10.X and 11.X
- sudo gem update cocoapods
If above will not work for your system, follow the below 3 steps, it will surely work
- sudo gem uninstall fourflusher
- sudo gem install fourflusher
- sudo gem update cocoapods
If you have Xcode 10.1 installed, _even if Xcode 10.0 is set as the default version of Xcode, the output from simctl
has a different format, specifically for availability. The rest of the fields appear to be the same, just not this one. You can see this JSON calling xcrun simctl list -j
. And Cocoapods do not update their wrapper to this format yet.
I prepared temporary step-to-spet Hotfix of this issue. It work`s for me.
In log find this line - ERROR | [iOS] unknown: Encountered an unknown error (Could not find a
iossimulator (valid values: ). Ensure that Xcode -> Window -> Devices has at least one
ios simulator listed or otherwise add one.
Under it you will see such line: /usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
.
- Copy name of this file and call:
sudo vi /usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
- Press
I
- In end of file find line with starts with
Simulator.new(device, os_name, os_version)
.... - Replace this line with
Simulator.new(device, os_name, os_version) if device['availability'] == '(available)' || device['isAvailable'] == 'YES'
- Press
:wq
pod trunk push YourLibrary.podspec
should work.
If something does not work, please reply.
or
The above solutions will work on a specific Xcode version. To get the solution that works with any Xcode version use the following. Rather than editing the file, you can copy entire content from https://github.com/CocoaPods/fourflusher/blob/master/lib/fourflusher/find.rb and replace.
I got this error after running the Xcode 10.2 beta. Unfortunately the previous answers didn't make the error go away. I don't know exactly what changed but I found a workaround to get it working:
- Find the
find.rb
offourflusher
, you can tell by the location on the error after running thepod trunk push
command. Something like:/usr/local/lib/ruby/gems/2.5.0/gems/fourflusher-2.0.1/lib/fourflusher/find.rb
- Go to the end of the file around
if device['availability'] == '(available)'
- Right below that make sure
os_name
andos_version
are set. If you look in the comment above it expects to split# Sample string: iOS 9.3
intoiOS
and9.3
. In my case they were empty or something else so I set them myself. - Also check the availability against true:
|| device['isAvailable'] == true
In the end that part looks like this:
if device['availability'] == '(available)' || device['isAvailable'] == true
os_name = "iOS"
os_version = "12.1"
Simulator.new(device, os_name, os_version)
end
THIS IS NOT A PERMANENT SOLUTION!!! It's just how I got it to work for now until what changed in the Xcode 10.2 beta is officially supported by cocoapods.
I noticed then when you run xcrun simctl list -j
on a mac that never installed the beta you have os names like com.apple.CoreSimulator.SimRuntime.iOS-12-1
and iOS 12.1
.
After installing the Xcode 10.2 I still see the com.apple.CoreSimulator.SimRuntime.iOS-12-1
but the iOS 12.1
one is gone. I'm assuming find.rb
used the the latter to find the os_name
and os_version
values.
This is why I set them myself.
Hope this helps other people, good luck!