ios-control / ios-sim

Command-line application launcher for the iOS Simulator
Apache License 2.0
1.49k stars 253 forks source link

Remove unnecessary call to fixSimCtlList in showsdks #221

Closed kelvindart closed 7 years ago

kelvindart commented 7 years ago

At the moment, a call to

ios-sim showsdks

Fails to run with the error:

Cannot convert undefined or null to object

The call to fixSimCtlList(...) is unrequired. This references two properties in regards to the simulators: devicetypes and devices. We are concerned with the SDKs, not simulators at this point, so the call is unnecessary.

More details in the bug report: #220.

shazron commented 7 years ago

Ouch, my bad. I'm going to write unit tests first before pulling this in so this doesn't happen again...

kelvindart commented 7 years ago

@shazron - ha, I noticed you was working late that night fixing the Xcode 9 issues... it's permissible 😉

kelvindart commented 7 years ago

Btw, I haven't checked whether the other references to fixSimCtlList are valid. I will do so now.

kelvindart commented 7 years ago

@shazron - I have just checked, from what I can tell, the other calls are fine.

Ironically, the issue is because showsdks passes the runtimes filter to simctl via the options parameter. I was digging around in that repo, and as a result, when it runs xcrun simctl list runtimes --json, it removes every other key from the returned JSON object, I'm not sure where this changed.

Other calls to simctl do not specify a filter, so everything is returned.

However, I believe this to now be fine. I would assist with the unit tests but that is less my forte. 😅