Application Services

RSS for tag

Perform common application tasks using Application Services.

Posts under Application Services tag

10 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Error when trying to check the daemon registration of our application
Hello, Our product registers a daemon in the system through SMAppService (API available from Ventura) and also checks its status in case it has to tell the user to allow the daemon process as a background process. To check the status we call a script written in applescript that returns the status of the service. Script excerpt: NSString* scriptText = @"use framework "AppKit"\n" @"use framework "ServiceManagement"\n" @"use scripting additions\n" @"on startCommand()\n" @"try\n" @"local this, service, SMAppServiceInstance, ret\n" @"set this to a reference to current application\n" @"set SMAppServiceInstance to a reference to SMAppService of this\n" @"set service to SMAppServiceInstance's daemonServiceWithPlistName: "%@"\n" @"set str to service's status as string\n" @"set success to str as number\n" @"return success\n" @"on error errorMessage number errorNumber\n" @"log ("errorMessage: " & errorMessage & ", errorNumber: " & errorNumber)\n" @"end try\n" @"return -1\n" @"end startCommand\n"; The problem we see is sometimes when we try to check the status, a thread that is created when executing the script crashes. This is an error but it doesn't always occur at this point: Crashed Thread: 6 Dispatch queue: com.apple.root.utility-qos.overcommit Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: psanwatchdog [61506] Error Formulating Crash Report: PC register does not match crashing frame (0x0 vs 0x7FF89D102A78) Thread 6 Crashed:: Dispatch queue: com.apple.root.utility-qos.overcommit 0 ??? 0x7ff89d102a78 ??? 1 libsystem_kernel.dylib 0x7ff80ce7314a __pthread_kill + 10 2 libsystem_pthread.dylib 0x7ff80ceabebd pthread_kill + 262 3 libsystem_c.dylib 0x7ff80cdd1a39 abort + 126 4 libsystem_c.dylib 0x7ff80cdd0d1c __assert_rtn + 314 5 CoreFoundation 0x7ff80d0e1104 -[__NSPlaceholderDate initWithTimeIntervalSinceReferenceDate:].cold.2 + 35 6 CoreFoundation 0x7ff80cf44cfc -[__NSPlaceholderDate initWithTimeIntervalSinceReferenceDate:] + 370 7 CoreServicesInternal 0x7ff81038da12 BookmarkData::copyItem(CFBookmarkDataItem const*, std::__1::set<CFBookmarkDataItem const*, std::__1::less<CFBookmarkDataItem const*>, std::__1::allocator<CFBookmarkDataItem const*>>&, unsigned long) const + 1780 8 CoreServicesInternal 0x7ff81038df1f BookmarkData::copyDataItemAtOffset(unsigned int, unsigned long) const + 59 9 CoreServicesInternal 0x7ff81036f0dd BookmarkCopyPropertyFromBookmarkData(BookmarkData&, __CFString const*, unsigned long) + 154 10 CoreServicesInternal 0x7ff81036ecc0 _CFURLCreateResourcePropertiesForKeysFromBookmarkData + 242 11 CoreFoundation 0x7ff80cf71893 +[NSURL resourceValuesForKeys:fromBookmarkData:] + 25 12 LaunchServices 0x7ff80d3bf8f9 +[FSNode(BookmarkData) getName:fileIdentifier:creationDate:forBookmarkData:error:] + 205 13 LaunchServices 0x7ff80d3bf0fb _LSAliasCompareToNode + 353 14 LaunchServices 0x7ff80d47e3ce _LSAliasAndInodeOnContainerMatchesNode + 173 15 LaunchServices 0x7ff80d4505d3 _LSBundleMatchesNode(_LSDatabase*, unsigned int, LSBundleData const*, id, unsigned long long) + 97 16 LaunchServices 0x7ff80d3bee21 ___LSBundleFindWithNode_block_invoke + 33 17 LaunchServices 0x7ff80d3bec64 LaunchServices::BindingEvaluation::isBindingOK(LaunchServices::BindingEvaluation::State&, LaunchServices::BindingEvaluation::ExtendedBinding const&) + 165 18 LaunchServices 0x7ff80d3bbf31 LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void ()(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocatorLaunchServices::BindingEvaluation::ExtendedBinding>&) + 4127 19 LaunchServices 0x7ff80d3ba6d3 LaunchServices::BindingEvaluation::runEvaluator(LaunchServices::BindingEvaluation::State&, NSError __autoreleasing*) + 1021 20 LaunchServices 0x7ff80d44bdb4 LaunchServices::BindingEvaluator::getBestBinding(LSContext*, UTTypeRecord* __strong*, NSError* __autoreleasing*) const + 138 21 LaunchServices 0x7ff80d3b9d75 LaunchServices::BindingEvaluator::getBestBinding(LSContext*, NSError* __autoreleasing*) const + 19 22 LaunchServices 0x7ff80d3b94a6 _LSBundleFindWithNode + 586 23 LaunchServices 0x7ff80d3b8a02 _LSFindOrRegisterBundleNode + 228 24 LaunchServices 0x7ff80d58b86a LaunchServices::URLPropertyProvider::capabilityEffectiveNodeForNode(LaunchServices::Database::Context&, FSNode*) + 279 25 LaunchServices 0x7ff80d58a4d7 LaunchServices::URLPropertyProvider::prepareApplicationCapabilityValue(LaunchServices::Database::Context&, id, __FileCache*, __CFString const*, LaunchServices::URLPropertyProvider::State*, NSError* __autoreleasing*) + 226 26 LaunchServices 0x7ff80d3b4e09 LaunchServices::URLPropertyProvider::prepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) + 772 27 CoreServicesInternal 0x7ff81036c057 prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) + 380 28 CoreServicesInternal 0x7ff8103687cb _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) + 266 29 CoreFoundation 0x7ff80cf5c54d CFURLCopyResourcePropertyForKey + 96 30 CoreFoundation 0x7ff80cf5bbca ____CFRunLoopSetOptionsReason_block_invoke_5 + 168 31 libdispatch.dylib 0x7ff80cd09ac6 _dispatch_call_block_and_release + 12 32 libdispatch.dylib 0x7ff80cd0adbc _dispatch_client_callout + 8 33 libdispatch.dylib 0x7ff80cd1a359 _dispatch_root_queue_drain + 1014 34 libdispatch.dylib 0x7ff80cd1a84f _dispatch_worker_thread2 + 152 35 libsystem_pthread.dylib 0x7ff80cea8b43 _pthread_wqthread + 262 36 libsystem_pthread.dylib 0x7ff80cea7acf start_wqthread + 15 The script is executed in the main thread of the application and the process itself does nothing more than launch this script, it is not performing any other tasks apart from recording logs of the script task. Also comment that this error has been seen on Mac machines with rosetta and the compilation of our product is on x86_64 architecture. And to say, if we are using applescript instead of the API it is because the compilation machine uses a Mac Catalina to compile it and we found it convenient to use applescript Any ideas why these errors may occur? Thanks
0
0
57
5d
Apple Podcasts Latest iOS 17 bug
For my iPhone 13 Pro Max, the current beta's (Developer Beta 6 and Public Beta 4), there has been issues with the Apple Podcasts App. When I try to refresh to check for new episodes, it's takes way too long to load new episodes. It takes about 1-2 minutes to display the latest episode. My Wi-Fi internet speed and my cellular data is fast and I did not have this issue on the previous beta's. I deleted the Apple podcast app multiple times and I deleted all of my downloaded podcasts/episodes and yet no resolution. I even enrolled my iPAD Pro, with the current Beta's and it's still the same problem. I even reset my phone to factory settings and it's still a problem. As a result, I went back to iOS 16.6 because of this podcast bug. Hopefully in the next beta, the update fixes this problem. Is anyone else having this issue?
0
1
940
Aug ’23
iOS Health Application Bluetooth Data Transfer - Background Processing Issue
Hello, Our application is a health application that functions alongside a device transferring data via Bluetooth. There is continuous data transfer happening from this device. However, when operated on an iOS device, the application gets cut off in the background after a certain duration, negatively impacting the user experience. As is known, the background services of an application being terminated after a certain period is generally associated with how iOS manages system resources. In our case as well, we came across this issue before we implemented a formatted background task. Therefore, to address this situation, we used a formatted background task in our application, but the problem still persists. Unable to resolve the issue, we decided to analyze how other Bluetooth devices work on iOS devices. For example, when an electronic watch is connected, the Bluetooth connection never gets cut off. However, why can't we achieve the same performance with our device? I would be extremely grateful if you could shed technical insight on this matter and share your experiences. Furthermore, if you have any recommendations on how to handle such situations, I would love to hear all about them. Thanks in advance for your help.
1
1
909
Jul ’23
Cannot get rid of current postgres installation
Ths installer created the .plist entry in /Library/LaunchDaemons/postgresql-15 and uninstaller left that intact. Because of this I cannot reinstall new version of postgres application as I alway get the message that an instance of this app is alredy running - no wonder, since the launchd daemon starts this at each reboot. How can I delete / remove that "postgresql-15.plist" file?
0
0
478
Jul ’23