插入usb时执行应用程序mac os yosemite 10.10.3

时间:2015-06-12 23:29:25

标签: macos usb plist execute

有人说它适用于优胜美地10.10.3

我将以下内容放入:〜/ Library / LaunchAgents / com.example.plist,我的idproduct是0x0624,id供应商是0x0718,但它不起作用。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.example.program</string>
    <key>ProgramArguments</key>
    <array>
    <string>/path/to/program</string>
    </array>
    <key>LaunchEvents</key>
    <dict>
            <key>com.apple.iokit.matching</key>
            <dict>
                    <key>com.apple.device-attach</key>
                    <dict>
                            <key>idProduct</key>
                            <integer>0624</integer>
                            <key>idVendor</key>
                            <integer>0718</integer>
                            <key>IOProviderClass</key>
                            <string>IOUSBDevice</string>
                            <key>IOMatchStream</key>
                            <true/>
                    </dict>
            </dict>
    </dict>
</dict>
</plist>

1 个答案:

答案 0 :(得分:0)

我在苹果开发者中找到了this,我不明白我在网上做了同样的事情并加载了launchd。