在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