一、下載
如果你資金充足,請自行購買收費版的Idea:https://www.jetbrains.com/idea/buy。
在線激活地址: http://idea.lanyus.com/ 或者 https://www.iteblog.com/idea/
本地證書服務器版,壓縮包地址:https://pan.baidu.com/s/1coj34G1vVgx9pSqtHhSXWQ
二、安裝
1.解壓下載后的軟件包,根據當前系統的類型,選中對應的程序版本。
2.編輯一個 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64.plist 文件,文件名稱自己定義:
<?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>KeepAlive</key> <false/> <key>RunAtLoad</key> <true/> <key>Label</key> <string>com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64</string> <key>ProgramArguments</key> <array> <string>/Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64</string> <string>-l</string> <string>0.0.0.0(綁定的IP地址)</string> <string>-p</string> <string>8888(大於1024的端口號)</string> <string>-u</string> <string>phpdragon(顯示被激活的用戶名)</string> </array> </dict> </plist>
➜ ~ /Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64 -h #查看啟動參數 Usage of /Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64: -l string bind on host (default "0.0.0.0") -p int port (default 1017) -prolongationPeriod string prolongationPeriod (default "607875500") -u string username (default "ilanyu")
3.紅色部分請根據實際部署目錄來設置,編輯完畢之后拷貝 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64.plist 文件至 ~/Library/LaunchAgents/ 目錄下。
三、服務管理
1. 加載配置好的.plist文件:
launchctl load ~/Library/LaunchAgents/com.phpdragon.IntelliJIDEALicenseServer.plist
2.查看配置是否加載生效:
➜ ~ launchctl list | grep IntelliJIDEALicenseServer
21598 -15 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64
3. 使用 launchctl 命令管理你的服務,使用 -h 參數來獲取參數說明幫助。
launchctl start com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64 #啟動服務 launchctl stop com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64 #停止服務 launchctl list | grep IntelliJIDEALicenseServer | awk '{print $3}' | xargs launchctl start launchctl list | grep IntelliJIDEALicenseServer | awk '{print $3}' | xargs launchctl stop
4.檢查服務是否啟動:
➜ ~ telnet 127.0.0.1 8888 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'.
或者查看服務進程是否已經啟動
ps aux | grep IntelliJIDEALicenseServer | grep -v grep
好了,Mac上的 IntelliJIDEALicenseServer 已經安裝好了,並隨機啟動了,開始激活IntelliJIDEA吧!
window請參考:IntelliJ IDEA 激活 及 License Server 安裝使用 Window篇
PS:
https://www.liaoxuefeng.com/article/0013738936043408e14365018e3427eaa09758db0ea90ac000
http://blog.csdn.net/abby_sheen/article/details/7817198
http://www.devdaily.com/mac-os-x/launchd-plist-examples-startinterval-startcalendarinterval
http://www.devdaily.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs