在OS X
利用苹果的Swift和Cocoa Frameworks,可以在OSX。The resulting app object is an NSApplication instance that contains the necessary information, including the desired bundle identifier.
Implementation Details:
The NSWorkspace class provides access to system-level information about running applications.The runningApplications property返回代表活动应用程序的NSapplication实例的数组。每个NSApplication实例包含一个bundledentifier属性,该属性独特地标识了应用程序捆绑包。
可以使用较低级别的C API来实现相似的功能,但是上面的解决方案在大多数情况下都证明了足够的。免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3