OS X: strange -psn command line parameter when launched from Finder

后端 未结 2 1959
-上瘾入骨i
-上瘾入骨i 2021-01-01 10:38

Our OS X Java application which is launched by a shell script inside the MyApp.app bundle gets a strange command line parameter -psn_0_989382 when

相关标签:
2条回答
  • 2021-01-01 11:13

    Mac OS X assigns a unique process serial number ("PSN") to all apps launched via GUI. It's used for identifying various processes and instances of executables.

    There's nothing I can really add to the documentation, so the best thing is to read the ProcessSerialNumber section of the Carbon Process Manager Reference (original Apple link is dead; this is a mirror).

    0 讨论(0)
  • 2021-01-01 11:35

    It seems that older applications that used the Carbon API get started with this argument. If the application was already updated to a version not using Carbon any more, you can unregister the application from the LaunchServices database by:

    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -u /Applications/AppName.app/
    

    After this it can be re-launched from Finder to register the new version. Then it should not get this argument any more.

    0 讨论(0)
提交回复
热议问题