-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Swift 2.3] Fix crash for looking up sim id on real device #61
[Swift 2.3] Fix crash for looking up sim id on real device #61
Conversation
Hold off on this...I thought it was the force unwrap causing the crash but it appears to be the |
Alright this is ready to go. I found a better API to get the ENV var for the simulator that won't crash if it doesn't exist. and I give a default "Unknown" value as the identifier because I tried the identifier passed in but it caused and infinite recursion :( |
Hi, this one looks just as good as the Swift 3 one, however it doesn't build because line length is now 162 instead of 160 (this is an issue coming from our swiftlint rules. 2 possible fixes: change the rule in .swiftlint.yml or split the statement over multiple lines (I'd prefer the latter). Other than that: 💯🎉🙏 :) |
case "i386", "x86_64": return Simulator(mapIdentifierToDevice(String(UTF8String: getenv("SIMULATOR_MODEL_IDENTIFIER"))!)) | ||
case "i386", "x86_64": return Simulator(mapIdentifierToDevice( | ||
NSProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? "iOS" | ||
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks weird here in the diff but it should look alright in Xcode
Looks like CI flaked out here as well? |
Perfect, thank you so much! :) |
This fixes a crash when trying to lookup a simulator identifier on a real device. Fixes Issue #60