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
Support Custom SimDeviceSets #41
Conversation
tests red? |
644a56d
to
ffe4f4f
Compare
The test is failing on pre-Xcode 7. I've updated the tests to take this into account and skip in the Custom Device Set case. We can get probably get this working for Xcode 6 by injecting and swizzling the Simulator app process (which we can't do for Xcode 7 because |
ahh, this lgtm then I'm happy to pass on Xcode 6 support as long as we can get as far back as iOS 7 running under Xcode 7. (which should be possible if we copy the simulator SDKs over) |
@@ -48,7 +55,7 @@ - (instancetype)copyWithZone:(NSZone *)zone | |||
|
|||
- (NSUInteger)hash | |||
{ | |||
return self.simulatorApplication.hash | self.namePrefix.hash | self.bucketID | self.options; | |||
return self.simulatorApplication.hash | self.deviceSetPath.hash | self.namePrefix.hash | self.bucketID | self.options; |
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.
Interesting. I usually do [_ns_object_1 hash] ^ [_ns_object_2 hash]
.
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.
xor
makes a lot more sense I think. Will do this everywhere for all the hashes we have.
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.
Actually [_ns_object_1 hash] ^ [_ns_object_2 hash]
will always be zero if the two objects are equal. I wouldn't recommend that in general because someone could easily exploit that to slow things down (probably not in this specific case though). But multiply the second hash by an arbitrary factor before XORing and it becomes pretty good.
Doing plain [_ns_object_1 hash] | [_ns_object_2 hash]
will skew things toward the higher numbers (because bits can never return to zero). So hashes will tend to clash more than using XOR, especially if you are ORing a lot of them.
Added some comments =) Feel free to ignore because they are mostly nits and I don't know what is preferred style here. |
ffe4f4f
to
fa286ba
Compare
Support Custom SimDeviceSets
It's possible to change
Simulator.app
to use a different device set by passing-DeviceSetPath
as an arg to the launchedSimulator
. This will be vastly preferable to using Prefixes to isolate simulators between processes.cc @mmmulani @ExtremeMan