Unable to enable login helper

I have one report from a customer, who migrated all data from his old MacBook to a new one. His is on Tahoe 26.5.1 (25F80).

Here is my relevant code:

+ (BOOL)enableLoginItem:(BOOL)enable
{
    NSOperatingSystemVersion osv = NSProcessInfo.processInfo.operatingSystemVersion;
    if (osv.majorVersion >= 13)
    {
        NSError* error;
        SMAppService* service = [SMAppService loginItemServiceWithIdentifier:MY_HELPER_APP_ID];
        if (![service registerAndReturnError:&error] && error) @throw error;
        return YES;
    }
    return SMLoginItemSetEnabled((__bridge CFStringRef)MY_HELPER_APP_ID, enable);
}

What should I do to re-enable the login helper?

My advice here is that try to replicate the steps that the user took. That is:

  1. Ask them what OS version their old Mac was running.
  2. Set that up in a VM.
  3. And then set up another VM with 26.5.1.
  4. Start the old Mac VM.
  5. Install your app with its login item.
  6. Start the new Mac VM.
  7. Migrate the state from the old one.
  8. See how you app behaves.

This will either replicate the problem or it won’t. If it does, you can start investigating potential workarounds. If it doesn’t, there something about this user’s environment that’s triggering the issue, and at that point you have to decide how much user support you want to do.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Unable to enable login helper
 
 
Q