前言
欢迎来到hitroad杂货铺,一个全新的系列,希望你喜欢
在这里,你将会学习到海量的零碎知识
今天讲mac软件的编写
开始
首先,你需要创建一个目录,长这样:
其中test.app
可以换成其他的(不管怎么换,都要以.app
结尾)
run.sh要替换成软件的代码,需要使用shell写
其中Info.plist的内容:
<?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>CFBundleGetInfoString</key>
<string>...</string>
<key>CFBundleExecutable</key>
<string>run.sh</string>
<key>CFBundleIdentifier</key>
<string>unknown</string>
<key>CFBundleName</key>
<string>...</string>
<key>CFBundleIconFile</key>
<string>main.icns</string>
<key>CFBundleShortVersionString</key>
<string>$PKG_VERSION</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>
<integer>0</integer>
<key>IFMinorVersion</key>
<integer>1</integer>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>
文件中两个...
要替换成软件的名字
CFBundleIdentifier
尽量写unknown
main.icns和Icon1024文件的生成:
前往icns文件生成器,下载资源并生成得到
现在你得到了你的软件
更多精彩内容,尽在hitroad杂货铺
作者
hit-road
拜拜,下课!
hit-road不定期跟新,不见不散!