如何从已知PID找到Bundle标识符? [英] How to find Bundle Identifier from known PID?
本文介绍了如何从已知PID找到Bundle标识符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个任意运行的进程的pid(进程标识符)。如何找到相关应用程序的捆绑标识符(如果有)?
I have the pid (process identifier) of an arbitrary running process. How can I find the bundle identifier (if any) of the associated application?
推荐答案
:首先调用 GetProcessForPID
将pid转换为 ProcessSerialNumber
。然后调用 ProcessInformationCopyDictionary
获取软件包ID。 (添加:这些功能在OS 10.9中已弃用,我不知道它们是否仍然存在于10.10 SDK中)
Here's a way that works in 10.2 and later: First call GetProcessForPID
to turn the pid into a ProcessSerialNumber
. Then call ProcessInformationCopyDictionary
to get the bundle ID. (Added: these functions are deprecated in OS 10.9. I don't know if they still exist in the 10.10 SDK.)
这篇关于如何从已知PID找到Bundle标识符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文