Post

Replies

Boosts

Views

Activity

XCTestCase performance measurement has no results on M1
I want to test app launch performance in my project. Therefore I tried to use performance test with measure func and XCTApplicationLaunchMetric. But after test completion there is no any result with average time. Here is a test example: func testLaunchPerformance() throws {         if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {             // This measures how long it takes to launch your application.             measure(metrics: [XCTApplicationLaunchMetric()]) {                 XCUIApplication().launch()             }         }     } But when I create a new empty project and add the same performance test – it works and shows app launch results. 1st image is a real project test – there is no test result. and the 2nd image is a demo empty project test – it has performance result diagram. I am running test on MacBook with M1 Pro chip. However, when my colleague is running the same performance test on our real project with Intel based MacBook Pro – all is fine, it shows app launch results correctly as my demo project. I have no idea how it can be fixed, because it seems that it depends on M1 chip 🤷🏻‍♂️. May be somebody have a solution?
1
2
1.2k
Jun ’22
Debugging Resources
General: DevForums tags: Debugging, LLDB, Graphical Debugger Xcode > Debugging documentation Diagnosing memory, thread, and crash issues early documentation Diagnosing issues using crash reports and device logs documentation Choosing a Network Debugging Tool documentation Testing a release build documentation Isolating Code Signing Problems from Build Problems DevForums post What is an exception? DevForums post Language Exception from RCTFatal DevForums post Standard Memory Debugging Tools DevForums post Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem DevForums post Posting a Crash Report DevForums post Creating a test project DevForums post Implementing Your Own Crash Reporter DevForums post Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
3.1k
Jun ’22
Xcode Cloud is unable to connect to the repository
Hello, I am trying out Xcode Cloud for the first time. I could connect to Github in the initial setup and had a few failed builds (package resolution error), which I resolved fairly quickly. Now whenever I am trying to build, I get the following error: Xcode Cloud is unable to connect to the repository “<respository-name>”. Reconnect the repository to resume builds. I am unable to remove the connection from settings as well because it's stuck in a loading state. Is there a way to fix this?
14
4
9k
Jun ’22
Xcode Cloud - slow test-without-building step
Hi, I'm currently researching if we are able to migrate to Xcode Cloud in our project. I encountered one issue. I run unit tests on Xcode Cloud and I see that they finish in ~150 seconds, but the whole step takes ~530s and there is no information in logs why. I even run the same command on my local computer and it doesn't take that long. Any ideas? Any way to optimize it? Also one more thing: it looks like Xcode Cloud is not running on M1 machines. Do you know guys if there are plans for Xcode Cloud to take advantage of M1/M2?
2
0
1.6k
Jun ’22
Xcode's Vim Mode - further development?
It was fantastic news to hear, last year, that Xcode was getting a Vim mode. Apple's implementation of it was a great first step, but it was missing a bunch of key features. Most importantly the dot command (and by, extension, macros) and creating marks in files, which are functions that I use/rely on on a daily basis. I thought I would finally be able to stop having to self-sign Xcode (which causes problems) in order to use XVim2 plugin, but no such luck. Will these features get added in for Xcode 14 (they don't seem to be in the beta) or are they far out on the roadmap?
11
13
5.7k
Jun ’22
Xcode "Issue Navigator" shows stale errors and warnings
For as long as I've used Xcode, the Issue navigator shows stale errors and warnings even after the build is completely building and executing. It would be nice to have a way to retain file warnings without having to set "warnings as errors", but here the problems have already been fixed. Also need a "Reveal in Report Navigator" since half the time these errors/warnings lack 90% of the info needed to actually fix them. There's already a "Reveal in Project Navigator" that is almost never needed.
4
2
2.5k
Jun ’22
One embedded framework takes forever to sign when uploading
Hello, I have an iOS app with a lot of embedded frameworks. It works well when I start it from Xcode, it works well once it is on the AppStore or in TestFlight. My only problem is when uploading it using Xcode 13. At the "Processing symbols for ....framework" stage, when reaching a specific framework, it keeps going forever (I've tried letting it run for a night, and it did not move). I can upload with Xcode 12 without problems, but not with any version of Xcode 13 or 14. Since it keeps going forever, I do not have an error message that could help me in identifying the issue. The issue seems to be with a specific framework, but I cannot identify anything that this framework has that is different from the other frameworks (they've all been compiled from C code, using a Makefile and the same CFLAGS and LDFLAGS options). I couldn't find any similar issues on the forum. Do any of you guys have a suggestion on how to fix the issue?
2
0
1.1k
Jul ’22
App crashes when trying to run widget extension - M1 Mac with Rosetta
I have a Xcode project with a widget extension, Xcode, simulator and terminal are running with Rosetta (I can't change this). When I build and run the main project, the widget does not get loaded on the widgets list, when running the widget scheme on Xcode the app crashes when loading the application on simulator. Same happens on device. Macs with Intel silicon run it okay. Xcode without rosetta is also okay. Xcode log window shows the following message: SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}." UserInfo={NSLocalizedDescription=Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}., NSUnderlyingError=0x600001106010 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}}} Domain: DTXMessage Code: 1 User Info: {     DVTErrorCreationDateKey = "2022-07-06 14:45:31 +0000"; } -- System Information macOS Version 12.2.1 (Build 21D62) Xcode 13.2.1 (19586) (Build 13C100) Timestamp: 2022-07-06T15:45:31+01:00 Console shows the following message: libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_FRAMEWORK_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_LIBRARY_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSXPCDistantObject ___nsx_pingHost:]: unrecognized selector sent to instance 0x600003948aa0' _LSContextInitReturningError() failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf6701f12 bb1a56bb bba5f39f 3f7801a6 ... f9fe6ee0 ef307d24 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x9da4b2b1 56f7ac19 1a99bc21 b7ec95c2 ... c4004d14 03ef83dc }} terminating with uncaught exception of type NSException CoreSimulator 783.5 - Device: iPhone SE (2nd generation) (E360DB1E-33FF-45A4-926C-A6093DFB3699) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone SE (2nd generation)
1
0
1.4k
Jul ’22
accept incoming network connections in simulator - xcode 13.4.1
Does anyone know how to rid of this message? It is happening every time I build a project using the simulator with the following versions: xCode 13.4.1 mac Monterey 12.4. I didn't see this behavior in Xcode's previous versions. The issue seems to be because it is adding a new application every time I build the project into the firewall app list. (image below) Any tips on how to fix this?
5
5
2.5k
Jul ’22
Bug Reporting: How and Why?
I file a lot of bug reports. I also ask a lot of third-party developers to file bug reports about problems they see. This post is my attempt at collecting together some hints and tips about Apple’s bug reporting process. To file a bug report, use Feedback Assistant. To file an enhancement request, use Feedback Assistant. In the “What type of issue are you reporting?” popup, choose Suggestion. If you’re filing a bug against an API, choose Developer Technologies & SDKs at the top level. The technologies popup should then list familiar items, from Accelerate Framework to XPC. If you can’t find the correct item, select “Something else not on this list”. Feedback Assistant is both a website and an app. For details on how to access the app, see Opening the app on the Developer > Bug Reporting page. For lots of great hints and tips about filing bugs, see File effective bug reports. I may repeat some of the info covered by that article, but only where I think it’s particularly important. After filing a bug report, please include the bug number in your DevForums post. Feedback Assistant shows the bug number in both the bug list and the bug detail view. Bug numbers start with FB and continue with a sequence of digits. For example, a recent bug report posted here on DevForums was FB11357055. Including the FB prefix avoids any confusion as to what type of bug number this is. Occasionally you’ll see other types of bug numbers. In release notes they are just in parens, so (99071807), and in DTS documents they have an r. prefix, so (r. 99071807). These are Radar numbers. Radar is the internal bug system here at Apple. Other developers can’t see your bug report. However, posting the bug number is still important for a couple of reasons: It allows Apple folks to quickly track down your issue. If another developer wants to file a related bug, they can reference your bug number in their bug report. You can share bug reports with other members of your team. For details on how to do that, see Collaborating with your team on the Developer > Bug Reporting page. Otherwise you can’t see a bug report filed by another developer, or one filed internally at Apple. One option here is to file your own bug and request that it be marked as a duplicate of the original bug. You’ll then be notified when the original bug is closed. The File effective bug reports article discusses the importance of including a sysdiagnose log with your bug report. I have a few additional tips: Include a sysdiagnose log from the machine that’s having the problem. Sometimes I see folks with an iOS problem include a sysdiagnose log for their development Mac )-: Include a sysdiagnose log even if you attach a test project that reproduces the problem. The contents of the log help with screening, making sure that your bug gets to the right person quickly. And that person will be very grateful to have your test project! If multiple machines are involved — for example, you’re reporting a Handoff problem — include a sysdiagnose log from each machine. Trigger the sysdiagnose log as soon as possible after you see the problem. The sooner you trigger the log, the more likely it is to capture relevant info. If the problem is hard to reproduce, see Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem for hints on how to capture an actionable sysdiagnose log. If you install a debug profile, install it before you reproduce the problem. These profiles typically enable more logging, and you want that logging to be active at the time of the problem. Most profiles activate immediately but some require that you restart. Follow the instructions that came with the profile. When reproducing the problem, make a rough note of the time and include that in your bug report. This doesn’t have to be super precise. Just note down the time, with seconds, shortly after you reproduce the problem. If the bug involves a crash, reproduce the crash outside of Xcode and then take your sysdiagnose log. This means running your code as the user would, so running an app from the Finder on macOS, running an app from the Home screen on iOS, and so on. If you reproduce the crash inside Xcode, the Xcode debugger catches the crash and prevents the system from generating a crash report to include in the sysdiagnose log. File focused bug reports. Imagine you’re seeing two problems, A and B, related to the same API. Don’t file a single bug that covers both A and B. Rather, file separate bugs for A and B. Feel free to reference your A bug in your B bug, and vice versa. Finally, some personal notes: DevForums is not an official support channel. Mentioning a problem here is not the same as filing a bug about it. That’s true even if you’re discussing your issue with an Apple person. Apple is a big company, and it’s very unlikely that the person you’re talking to is directly responsible for fixing your bug. Historically I used to post a lot of Radar links, of the forms rdar:nnn, where nnn includes the bug number. I no longer use these links because I’ve found that they confuses folks. They click the link and wonder why it does nothing. If you post an FB number here, DevForums automatically turns it into a link. However, that link is only useful to you. Other folks can’t access the bug via that link. I’ve filed a bug against DevForums requesting that it only generate this link for the bug’s originator (r. 92946014). In the meantime, I work around this by putting FB numbers in code style, which disables this link generation. If you want to share bug information outside of DevForums, one popular option is Open Radar (https://openradar.appspot.com/). Apple uses a lot of open source and many open source projects maintain their own bug tracker. Two big examples are Swift and WebKit. If your bug originates in such an open source project, consider filing it in the project’s bug tracker. You can then go on to submit a pull request with the fix (-: Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Revision History 2024-03-07 Made minor editorial changes. 2023-10-26 Added a link to Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem. Added a recommendation to file focused bug reports. 2023-06-28 Updated the advice on how to file an API-level bug based on recent changes to Feedback Assistant. Corrected some link titles. 2023-03-21 Added a bunch of bullets to the personal notes section. 2023-03-13 Extended the discussion of seeing other folks’ bugs to make it clear that you can’t see bugs filed internally at Apple. 2022-12-13 Added advice about the “Something else not on this list” option. 2022-09-01 Added a personal notes section at the end. Added a new bullet in the sysdiagnose section about running your app outside of Xcode. Made other minor editorial changes. 2022-08-29 Added a note about filing duplicate bugs. 2022-08-24 First posted.
0
0
11k
Aug ’22
Xcode freezes/ hangs on startup and does not load any application
I recently updated my M1 mac to Monterey 12.5.1 and since my xcode fail to load my project. Xcode opens and hangs as seen in the picture. I have to force quit to close. The installed version of xcode is Version 13.4.1 Things I have tired: Completely removing and reinstalling xcode from the dev site Restarting device Suggestion from here https://stackoverflow.com/questions/11247008/xcode-freezes-on-startup-while-loading-project Even if I fully create a new project from the start screen, it still freezes on load Nothing seems to be working. Wondering if anyone can help Thanks
7
1
4.6k
Aug ’22
PassbookUIService crash on Xcode 14 beta 6 causes StoreKit failure
I am running a very simple UI test on Xcode 14 beta 6 that sets up a StoreKit testing session and then attempts to bring up a purchase dialog. Unfortunately, PassbookUIService is crashing and thereby causing the purchase to be canceled. Here is the crash report: PassbookUIService-2022-08-30-094331.ips.txt For context, the UI test is very simple: func testExample() throws { _ = self.expectation(description: "Never fulfilled") let session = try SKTestSession(configurationFileNamed: "CatsAndLlamas.storekit") session.clearTransactions() session.resetToDefaultState() session.disableDialogs = false let app = XCUIApplication() app.launch() let tablesQuery = app.tables tablesQuery.staticTexts["Buy Product"].tap() tablesQuery.cells.containing(.staticText, identifier:"Silver Llama").staticTexts["Subscribe"].tap() waitForExpectations(timeout: 30) } On an iOS 15.5 simulator device, the UI test works as expected. However, on an iOS 16 simulator device, the UI test behaves as if the purchase request were canceled before the dialog is even displayed. This is when PassbookUIService crashes. I believe this crash is causing StoreKit (or StoreKitTest) to consider the purchase canceled. (I have screenshots of the behavior but I’ve not been able to successfully include them in this post for some reason.)
9
5
2.3k
Aug ’22
Simulator in Low Data Mode
Hi, I have logged into an iCloud account on an iOS device simulator on my Mac to sync photos in order to test my app. The photos app is telling me syncing is paused as the device is in low power mode, but as this is a simulator, there's no network seatings to change this and I can't find out why it's in this mode or how to get it out. I've done exactly the same thing for years with no issues, but for some reason it's happening now. Has anyone else experienced the same? The simulator device is an iPhone 13 Pro Max running 15.5 however I've tested on other device and experienced the same issue. Many thanks, Dan
1
2
1.1k
Sep ’22
CMTimeMultiplyByRatio in iOS 16
let videoURL = URL(fileURLWithPath: path ?? "") let asset = AVURLAsset(url: videoURL, options: nil) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true let time = CMTimeMultiplyByRatio(asset.duration, multiplier: 1, divisor: 2) // THIS LINE GIVES ISSUE: "'duration' was deprecated in iOS 16.0: Use load(.duration) instead". I CANNOT FIGURE OUT THE CORRECT SYNTAX FOR CHANGING asset.duration TO REPLACE WITH load(.duration). HELP WITH THE CORRECT SYNTAX WOULD BE HELPFUL.
1
0
786
Sep ’22