Add app icon to dock

I'm working on adding app icon to the dock programmatically. But after all my investigation, it seems like I do need to restart the dock after the change.

Is there any possible method that can add icon to the dock "live" that doesn't need to kill process? What about in mach IPC way.

Replies

You want to add icon of another App from your running app, is it ?

Yes, add another App's icon to the dock

Did you see this ? Not sure it is your use case

https://stackoverflow.com/questions/13953475/mac-osx-how-to-add-app-icon-to-dock-programmatically

w ww.danandcheryl.com/2011/02/how-to-modify-the-dock-or-login-items-on-os-x

Yes I did. By adding icon path to plist, I still need to restart the Dock after all.