twostraws / ControlRoom

A macOS app to control the Xcode Simulator.
MIT License
5.78k stars 304 forks source link

Show OS version in the list of simulators #12

Closed vinayjn closed 4 years ago

twostraws commented 4 years ago

This is a really great change – thank you! The regex seems very precise, so I'm wondering if it really adds anything other than just using replacingOccurrences to strip out the prefix, replacing "OS-" with "OS ", then replacing any dashes with dots? We could then flatten the data to a string, which would remove Constants.swift, Extensions.swift, and OSInfo.

vinayjn commented 4 years ago

@twostraws the idea behind using different files was to remove hardcoded values from logical components. I liked the idea of directly flattening the regex data into a consumable os version string. I'll make the change. 👍

vinayjn commented 4 years ago

@twostraws have a look at the updated code.

davedelong commented 4 years ago

This is a great first implementation, thanks!

simctl has a way to get more information about those identifiers be running simctl list runtimes -j. That will dump out some data of the available runtimes with all of this nicely parsed already.

However, there might be some times where we still need to parse the identifier directly and we could fall back to the RegEx.

davedelong commented 4 years ago

FYI @vinayjn - when #19 gets merged, the SimCtl.Simulator type will have a new runtimeTypeIdentifier string that can be used to match things up a bit more easily.

vinayjn commented 4 years ago

@davedelong thanks for the update, I have made the required changes. Please have a look. Thanks

twostraws commented 4 years ago

Thank you very much – this is a great change, and you put in lots of extra work to make it right 👍