2013年4月10日 星期三

HyperDock 1.3 崩潰問題


網路上找到得..
雖然可以也覺但是會一直不斷的重新啟動..=.=


升级后,虽然不会出现crash的弹窗,但一段时间后hyperdock还是会自动退出。
解决思路很简单:只要写个脚本作为守护进程启动,监控hyperdock进程,一旦被退出就重新启动hyperdock。
具体步骤:
1、随便找个目录创建文件launch_hyper.sh. (比如:/Users/你的用户名/Documents/sh/launch_hyper.sh)
内容如下:
#! /bin/sh
while true
do
/Library/PreferencePanes/HyperDock.prefpane/Contents/Resources/HyperDock\ Helper.app/Contents/MacOS/HyperDock\ Helper
done

2、打开终端执行下面的命令(目录与第一步对应)
cd /Users/你的用户名/Documents/sh/
chmod 755 launch_hyper.sh

此时可以先打开终端,运行 ./Users/你的用户名/Documents/sh/launch_hyper.sh 看hyperdock是否正常运行,如果正常启动了说明脚本没有问题。


下面需要解决的就是在开机的时候让该脚本自动运行
3、在/Library/LaunchAgents目录下创建com.guopeng.launchHyper.plist文件(可以用你的名字替换guopeng)
内容如下(注意主要是路径的对应):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Disabled</key>
        <false/>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>com.guopeng.launchHyperServices</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Users/你的用户名/Documents/sh/launch_hyper.sh</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

4、打开终端执行下面的命令:
cd /Library/LaunchAgents
修改此文件权限和所有者(plist文件名与上面第三步对应;输入命令后需要密码)
sudo chown -R root:wheel com.guopeng.launchHyper.plist
sudo chmod 644 com.guopeng.launchHyper.plist

重启问题解决。

沒有留言:

張貼留言