Posts

Post marked as unsolved
1.8k Views

Failed to create temporary staging dir

When running unit tests for a second+ time, we often run into:"Failed to create temporary staging dir in <PATH_TO_SIMULATOR>/data/Library/Caches/com.apple.mobile.installd.staging"If we delete derived data, it always works the first run, but then fails on subsequent runs.Something in Xcode is deleting the directory it needs. Has anyone else seen this and found a solution?
Asked
by stevebay.
Last updated .
Post marked as solved
84 Views

Failure to code sign with automatic signing

Feedback: FB7675243 Hi! We have had an issue since Xcode 11.3 with automatic signing when building to a device. I have detailed the issue in the above feedback, but I would love some help in resolving this issue. TLDR: When building to device, engineers receive a "communications" error or a "forbidden for security purposes" error. We have a very old app prefix id and the message seems to indicate that this might be part of the problem. I can have an engineer try to build to "generic device" with Xcode 11.2 and the code signing will pass, and then they can resume with Xcode 11.5, but this is not a long-term solution. Thanks for any help! Steve
Asked
by stevebay.
Last updated .
Post marked as unsolved
602 Views

NumberFormatter padding differently in 13.1?

Here is some sample code that behaves differently under iOS 12 and earlier vs 13.1/13.2b. Previously, we would get "EUR100.00" but now we get "EUR 100.00" where the space is a non-breaking space.Why was this changed? How can we get consistent behavior from NumberFormatter? let numberFormatter = NumberFormatter() let currencyID = "EUR" let locale = Locale(identifier: "en_US") numberFormatter.formatterBehavior = .behavior10_4 numberFormatter.generatesDecimalNumbers = true numberFormatter.minimumFractionDigits = 2 numberFormatter.maximumFractionDigits = 2 numberFormatter.currencyCode = currencyID numberFormatter.locale = locale numberFormatter.numberStyle = .currency let symbol = "EUR" numberFormatter.currencySymbol = symbol numberFormatter.internationalCurrencySymbol = symbol let number = NSDecimalNumber(integerLiteral: 100) let result = numberFormatter.string(from: number) print("\(String(describing: result))")
Asked
by stevebay.
Last updated .
Post marked as unsolved
4.4k Views

Missing code coverage with Xcode 10

We are switching to Xcode 10 and are noticing some issues with Xcode 10's code coverage. Entire swaths of code are getting no coverage. So far I have noticed* Computed vars* class functions in extensions* guard statements in extensionsFor example:import UIKit extension Date { func dayNumberOfWeek() -> Int? { return Calendar.current.dateComponents([.weekday], from: self).weekday } } extension UIView { // Testing with this function compiled will cause no code coverage // for steveWasHereHelper to be generated. // // However, if I comment out steveWasHere, then code coverage for // steveWasHereHelper is generated, despite that this function is also // called by wyattWasHere @discardableResult public class func steveWasHere(value: Int) -> Bool { return self.steveWasHereHelper(value: value) } // The usage of Date here is to try and rule out compiler optimization @discardableResult public class func steveWasHereHelper(value: Int) -> Bool { let d = Date().dayNumberOfWeek() let testValue = value + d! if testValue >= 42 { return true } return false } fileprivate class func neverCalled() { print("This is never called") } // steveWasHereHelper is also called here @discardableResult public class func wyattWasHere(value: Int) -> Bool { return self.steveWasHereHelper(value: value) } }In this example, steveWasHereHelper will not get any coverage. It won't be green, it won't be red, its as if the code is not called. If I remove all tests EXCEPT for the direct test of steveWasHereHelper, it still gets no coverage.HOWEVER, if I then comment out steveWasHere, THEN steveWasHereHelper shows coverage.I have opened a Radar with Apple on this issue (45468318) but I was wondering if anyone else has seen this (This is not the only example of issues with code coverage in Xcode 10) and if there is a workaround.I have also tested this in 10.1b3, getting the same results.self. was added to the function calls just to see if it had any impact.Narrator: It didn't
Asked
by stevebay.
Last updated .