{"id":295971,"date":"2019-12-18T09:00:23","date_gmt":"2019-12-18T09:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295971"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295971","title":{"rendered":"\u0427\u0438\u0441\u0442\u0438\u043c Dock \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 xCode"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/480876\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c4\/bn\/b-\/c4bnb-qvbkbbsxd8y_75tp_gobe.png\"><\/p>\n<p>  \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430.<br \/>  \u0412\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f terminal, Swift \u0432\u0435\u0440\u0441\u0438\u0438 3.1 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440.<br \/>  \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 macOS Sierra 10.12.6 \u0438 macOS Catalina 10.15.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c terminal \/Applications\/Utilities\/Terminal \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b.<\/p>\n<pre><code class=\"bash\">touch toolbar.swift<\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b toolbar.swift \u0438 \u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"swift\">import AppKit var app: NSApplication var statusItem: NSStatusItem #if swift(&gt;=5.1)     app = NSApplication.shared     statusItem = NSStatusBar.system.statusItem(         withLength: CGFloat(NSStatusItem.variableLength)) #else     app = NSApplication.shared()     statusItem = NSStatusBar.system().statusItem(withLength: CGFloat(32)) #endif  if #available(macOS 10.10, *) {     statusItem.button?.title = \"\\u{2699}\\u{FE0F}\" }  \/\/ extension  \/\/ menu  app.setActivationPolicy(.prohibited) app.run() <\/code><\/pre>\n<p>  \u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u044f\u0437\u044b\u043a\u0430. <br \/>  \u0421\u0442\u0440\u043e\u043a\u0430 app.setActivationPolicy(.prohibited) \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u043a\u043e\u043d\u043a\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 Dock.<\/p>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">swift toolbar.swift<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u00ab\u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f\u00bb \u043a\u043d\u043e\u043f\u043a\u0430. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b UTF \u0441\u0438\u043c\u0432\u043e\u043b \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0438 &#171;\\u{2699}\\u{FE0F}&#187;, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e statusItem.button?.image.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kz\/1z\/df\/kz1zdftsnhs459p5w5ofmwketyy.png\"><\/p>\n<p>  \u0412\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430\u0436\u0430\u0432 \u0432 terminal ctrl-c.<\/p>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c class AppDelegate \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b \u043a\u043b\u0430\u0441\u0441 NSApplication. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \/\/ extension \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"swift\">extension NSApplication {     func runTask(_ appName: String, _ arg: String = \"\") {         let task = Process()         #if swift(&gt;=5.1)             task.executableURL = URL(fileURLWithPath: \"\/usr\/bin\/open\")         #else             task.launchPath = \"\/usr\/bin\/open\"         #endif         task.arguments = arg.isEmpty ?[appName] : [arg, appName]         #if swift(&gt;=5.1)             do {try task.run()}             catch {print(error)}         #else             task.launch()         #endif     }     @objc func securityRun () {         self.runTask(\"\/System\/Library\/PreferencePanes\/Security.prefPane\")     }     @objc func diskRun () {         self.runTask( \"disk utility\", \"-a\")     }     @objc func automatorRun () {         self.runTask( \"automator\", \"-a\")     } } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b SystemPreference. <\/p>\n<p>  \u0414\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041f\u043e\u0441\u043b\u0435 \/\/ menu \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435:<\/p>\n<pre><code class=\"swift\">let menu = NSMenu() let items: [String] = [\"Security\", \"Disk Utility\", \"Automator\", \"Quit\"]  var sel: [Selector] = [] let shared = NSApplication.shared  #if swift(&gt;=5.1)     sel = [         #selector(shared.securityRun), #selector(shared.diskRun),         #selector(shared.automatorRun), #selector(shared.terminate)] #else     sel = [         #selector(shared().securityRun), #selector(shared().diskRun),         #selector(shared().automatorRun), #selector(shared().terminate)] #endif  for i in 0..&lt;items.count {     menu.addItem(NSMenuItem(         title: items[i], action: sel[i], keyEquivalent: \"\"))     if i==items.count-2 {         menu.addItem(NSMenuItem.separator())     } } statusItem.menu = menu <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043b\u0438 \u043a \u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 NSApplication. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abQuit\u00bb, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f terminal.<\/p>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e swift \u043d\u0430\u0434\u043e \u043d\u0430\u0431\u0440\u0430\u0442\u044c swiftc.<\/p>\n<pre><code class=\"bash\">swiftc toolbar.swift<\/code><\/pre>\n<p>  \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0444\u0430\u0439\u043b toolbar. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">.\/toolbar<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0444\u0430\u0439\u043b toolbar \u0434\u0432\u043e\u0439\u043d\u044b\u043c \u043a\u043b\u0438\u043a\u043e\u043c, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043e\u043a\u043d\u043e terminal, \u0430 \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. <\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 terminal.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">mkdir -p ToolBar.app\/Contents\/MacOS<\/code><\/pre>\n<p>  \u041c\u0435\u043d\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"bash\">chmod a+x ToolBar.app<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0438\u043a\u043e\u043d\u043a\u0438.<\/p>\n<pre><code class=\"bash\">mkdir ToolBar.app\/Contents\/Resources<\/code><\/pre>\n<p>  \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u043c\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0438\u043a\u043e\u043d\u043e\u043a.<\/p>\n<pre><code class=\"bash\">cp \/System\/Library\/CoreServices\/CoreTypes.bundle\/Contents\/Resources\/ToolbarAdvanced.icns ToolBar.app\/Contents\/Resources\/AppIcon.icns<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b toolbar \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e MacOS.<\/p>\n<pre><code class=\"bash\">mv toolbar ToolBar.app\/Contents\/MacOS<\/code><\/pre>\n<p>  \u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0443 toolbar.<\/p>\n<pre><code class=\"bash\">chmod a+x ToolBar.app\/Contents\/MacOS\/toolbar<\/code><\/pre>\n<p>  C\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b PkgInfo \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0442\u0438\u043f\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0424\u043b\u0430\u0433 -n \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 PkgInfo \u043d\u0435 \u0431\u044b\u043b\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<pre><code class=\"bash\">echo -n \"APPL????\" &gt; ToolBar.app\/Contents\/PkgInfo<\/code><\/pre>\n<p>  \u041c\u0435\u043d\u044f\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0443 PkgInfo.<\/p>\n<pre><code class=\"bash\">chmod a+x ToolBar.app\/Contents\/PkgInfo<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 Info.plist \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"bash\">echo '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\"&gt; &lt;plist version=\"1.0\"&gt; &lt;dict&gt;   &lt;key&gt;CFBundleIdentifier&lt;\/key&gt;   &lt;string&gt;example.ToolBar&lt;\/string&gt;   &lt;key&gt;CFBundleExecutable&lt;\/key&gt;   &lt;string&gt;toolbar&lt;\/string&gt;   &lt;key&gt;CFBundleIconFile&lt;\/key&gt;   &lt;string&gt;AppIcon&lt;\/string&gt; &lt;\/dict&gt; &lt;\/plist&gt;' &gt; ToolBar.app\/Contents\/Info.plist <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 ToolBar.app \u0432 \/Applications\/Utilities.<br \/>  Terminal \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<pre><code class=\"bash\">sudo mv ToolBar.app \/Applications\/Utilities<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \/Applications\/Utilities \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Launchpad (\u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Others)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1k\/s8\/dj\/1ks8djbt9drojjoaxq1_d7ylz_s.png\"><\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a. <\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b ~\/Library\/LaunchAgents\/example.ToolBar.plist. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439:<\/p>\n<pre><code class=\"bash\"> echo '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\"&gt; &lt;plist version=\"1.0\"&gt; &lt;dict&gt;     &lt;key&gt;Label&lt;\/key&gt;     &lt;string&gt;example.ToolBar&lt;\/string&gt;     &lt;key&gt;ProgramArguments&lt;\/key&gt;     &lt;array&gt;         &lt;string&gt;open&lt;\/string&gt;         &lt;string&gt;\/Applications\/Utilities\/ToolBar.app&lt;\/string&gt;         &lt;string&gt;--args&lt;\/string&gt;         &lt;string&gt;-silent&lt;\/string&gt;     &lt;\/array&gt;     &lt;key&gt;RunAtLoad&lt;\/key&gt;     &lt;true\/&gt; &lt;\/dict&gt; &lt;\/plist&gt;' &gt; ~\/Library\/LaunchAgents\/example.ToolBar.plist<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043b\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<pre><code class=\"bash\">ls ~\/Library\/LaunchAgents<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0432\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0432 terminal \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">launchctl load -w ~\/Library\/LaunchAgents\/example.ToolBar.plist<\/code><\/pre>\n<p>  \u0418\u043a\u043e\u043d\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430.<br \/>  \u0412\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 unload \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">launchctl unload -w ~\/Library\/LaunchAgents\/example.ToolBar.plist<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043b\u0438\u0448\u043d\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 Dock.<\/p>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u043d\u0438-\u043f\u043b\u0435\u0435\u0440 \u0434\u043b\u044f iTunes, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 todo list \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u043a\u043e\u043d \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u0442\u043e\u043b\u0435.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/480876\/\"> https:\/\/habr.com\/ru\/post\/480876\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/480876\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/c4\/bn\/b-\/c4bnb-qvbkbbsxd8y_75tp_gobe.png\"><\/p>\n<p>  \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430.<br \/>  \u0412\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f terminal, Swift \u0432\u0435\u0440\u0441\u0438\u0438 3.1 \u0438\u043b\u0438 \u0432\u044b\u0448\u0435 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440.<br \/>  \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 macOS Sierra 10.12.6 \u0438 macOS Catalina 10.15.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-295971","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295971"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295971\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}