メインメニューを開く

Xamarin.MacでアプリのBundle Identifierを調べる

Macアプリで別アプリを起動したり制御したりする場合、 Bundle Identifierを指定する方法が簡潔明瞭である。

実装編集

NSBundleをアプリのパス指定で生成し、そこからBundle Identifierを取得する。

var bundle = NSBundle.FromPath("/Applications/Safari.app");
Console.WriteLine(bundle.BundleIdentifier);

関連項目編集