Post

Replies

Boosts

Views

Activity

Reply to how to get console logs for the last 24 hours
OS Log / Logger It is now possible using Apple's unified logging (OS Log / Logger) Refer: https://developer.apple.com/wwdc20/10168 Note: Make sure your device is connected to the Mac either (USB / network) Network would work only if Connect via network is checked Terminal Run the following command on the terminal: sudo log collect --device-name yourdevicename --start '2022-12-01 13:15:00' --output mine.logarchive Here your yourdevicename is your device's name Open file Double clicking the file should open in console
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’22
Reply to iOS widget always displaying placeholder on simulator or device
It has happened to me a couple of times. Possible causes: 1 It takes a long time for the timeline provider function to provide a timeline. If that is the case then reduce the number of timeline entries and have a reload policy of atEnd 2 Sometimes this happens when using Running the app on device vs TestFlight app version. Delete app and restart phone and install app and then add the accessory widget.
Topic: App & System Services SubTopic: General Tags:
Dec ’22
Reply to Logger on Xcode console
Non-sensitive logging (Public) This doesn't work in my following case: import SwiftUI import os struct ContentView: View { let logger = Logger(subsystem: "MyApp", category: "MyCategory") let itemName = "something non-sensitive" var body: some View { Text("Hello, world!") .onAppear { logger.debug("content view displayed") logger.debug("Item name = \(itemName, privacy: .public)") } } }
Nov ’22
Reply to Freshly inserted data through REST-request only displayed after reopening the view
Guessing: I think it has something to do with DATA.depot.datapoints. Is Depot a struct or a class? Just remember: Mutating a class property is not considered as a value change. Mutating a struct property is considered as a value change. Testing For testing purpose create a temp @Published var temp dataPoints, update it there and see if your view reacts. If so then it is something with Depot and if it is a struct / class. Possible Workaround You can manually call objectWillChange.send() inside your DataService to indicate the object has changed
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Freshly inserted data through REST-request only displayed after reopening the view
Are you familiar with data dependencies (source of truth) in SwiftUI? Example @State, @StateObject, @ObservedObject, @EnvironmentObject etc. If anyone of the variables are declared using one of the above, and if their @Published property changes then the views would be refreshed automatically. IMHO it might make sense to go through https://developer.apple.com/wwdc20/10040
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Cannot debug widget in a watch target using Xcode 14.1
Xcode 14.1 known issue: Xcode 14.1 release notes seems to mention a known issue After Running a widget extension, users will need to manually start the debugging session with Debug -> Attach to Process. (99285608) Approach (works on simulator and device) Run app target and widget target at the same time Attach debugger to your widget Steps Select app scheme and run on iOS device (don't stop) Select widget scheme and run on iOS (don't stop) So both the targets are running at the same time Select widget scheme then Debug > Attach to Process > Select your widget target name On device / simulator add widget Note: You need to attach the debugger every time you run (Xcode forgets debugger added for the previous run) Now your breakpoints should work as expected and you can debug
Topic: App & System Services SubTopic: General Tags:
Nov ’22
Reply to Logger messages not showing in XCode console
@eskimo Thanks a lot for the prompt reply, you are right we can filter by subsystem which is great. Upon further investigation I realised these aren't debug messages that got printed, they were errors (not sure why though). When I set the launch arguments as com.apple.CoreData.Logging.stderr 0 (under Scheme > Run > Arguments) I don't get these errors anymore. The only question remaining is why are these errors thrown, I even tried with Xcode > New Project > Checking CloudKit and CoreData checkboxes, even on the new project with generated code these errors are thrown. Tested on device with iCloud turned on, syncing is fine but not sure if I am missing something or this is a internal error within the framework. FB FB11794798 - Feedback contains sample project
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Xcode Cloud error: Swift Package dependency for app extension
Approch Check if Package.resolved is checked into the repository and is pushed to remote Check if Xcode Cloud has access to your swift packages used in your project Package.resolved Check if <appname>.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is checked into the repository and is pushed to remote Xcode Cloud Go to AppstoreConnect > choose App name > Xcode Cloud > Select failed build number See the yellow banner with the following message Repository Issue ----------------- Xcode Cloud is unable to connect to the repository “https://github.com/<github username>/<package name>.git”. Reconnect the repository to resume builds. Click Manage Repositories See the following yellow banner with the message: Grant access to the following repositories to allow them to be used for this product. Click Grant button Start build and it should fix the issue
Nov ’22