close

敬告遊客:
以下內容枯燥無聊,若情非得已不建議進入。
若仍執意進入,當有頭暈嘔吐現象時請盡速離開本篇文章。



background App在Windows上是不會有AppIcon show在工具列上,但在MAC就完全破功,前景程式我們有設定AppIcon秀出來也就算了,但背景程式MAC竟然自己搞個Default的Icon顯示在Dock area,哎呀呀~我們不能讓user知道有這寫背景程式在跑捏,不然Dock area可是會太熱鬧的啦~~嘖嘖!知道我們的產品有多豐富了吧~嘻嘻


先來說說plist.info這個檔案吧,info.plist裡面記錄了MAC OS應該對此App property 的list


<hide Dock icon by info.plist>
在Windows上,一個XXX.exe他就是個執行檔,但MAC上,XXX.exe卻是一個package,
1. Right click the application in Finder
2. Click "Show Package Contents"
3. Open Resources folder
4. Open Info.plist in a text editor
5. Add/Modify configuration value for LSUIElement
LSUIElement

//It should be located in between and .
//info.plist也可以用MAC內建的應用程式打開,直接對著info.plist點兩下就會自動打開了

<make Qt to use our App.list>
在Qt build的過程中,它會自動產生info.plist檔案,但這個他預設的檔案是不包含LSUIElement的設定值的,我總不能每次install完後,在自己去手動加這個設定吧,這樣也太驢了吧,所以
打開App.pro file 編輯,加入 QMAKE_INFO_PLIST = App.plist
把App.plist放在和App.pro檔案的相同位置
這樣在build過程中,Qt就會把App.plist套用到這個App中,而不是用Qt中預設的info.plist


<App.plist sample code>
//line 19.20是為了hide Dock icon用的
1 < ?xml version="1.0" encoding="UTF-8"? >
2 < !DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd" >
3 < plist version="0.9">
4 < dict>
5 < key>CFBundleIconFile< /key>
6 < string>@ICON@< /string>
7 < key>CFBundlePackageType< /key>
8 < string >APPL< /string>
9 < key>CFBundleGetInfoString< /key>
10 < string>Created by Qt/QMake< /string>
11 < key>CFBundleSignature< /key>
12 < string>@TYPEINFO@< /string>
13 < key>CFBundleExecutable< /key>
14 < string>@EXECUTABLE@< /string>
15 < key>CFBundleIdentifier< /key>
16 < string>com.yourcompany.@EXECUTABLE@< /string>
17 < key>NOTE< /key>
18 < string>This file was generated by Qt/QMake.< /string>
19 < key>LSUIElement< /key>
20 < true  / >
21 < /dict>
22 < /plist>


<info.plist 中Key list>
資料來源:iOS Developer Library

Key

Xcode name

Summary

LSArchitecturePriority

"Architecture priority”

Contains an array of strings identifying the supported code architectures and their preferred execution priority.

LSBackgroundOnly

"Application is background only”

Specifies whether the application runs only in the background. (Mach-O applications only).

LSEnvironment

"Environment variables”

Contains a list of key/value pairs, representing environment variables and their values.

LSFileQuarantineEnabled

"File quarantine enabled”

Specifies whether the files this application creates are quarantined by default.

LSFileQuarantineExcludedPathPatterns

None

Specifies directories for which files should not be automatically quarantined.

LSGetAppDiedEvents

"Application should get App Died events”

Specifies whether the application is notified when a child process dies.

LSMinimumSystemVersion

"Minimum system version”

Specifies the minimum version of Mac OS X required for the application to run.

LSMinimumSystemVersionByArchitecture

"Minimum system versions, per-architecture”

Specifies the minimum version of Mac OS X required to run a given platform architecture.

LSMultipleInstancesProhibited

"Application prohibits multiple instances”

Specifies whether one user or multiple users can launch an application simultaneously.

LSRequiresIPhoneOS

"Application requires iPhone environment”

Specifies whether the application is an iOS application.

LSRequiresNativeExecution

"Application requires native environment”

Specifies whether the application must run natively on Intel-based Macintosh computers, as opposed to under Rosetta emulation.

LSUIElement

"Application is agent (UIElement)”

Specifies whether the application is an agent application, that is, an application that should not appear in the Dock or Force Quit window.

LSUIPresentationMode

"Application UI Presentation Mode”

Sets the visibility of system UI elements when the application launches.

LSVisibleInClassic

"Application is visible in Classic”

Specifies whether an agent application or background-only application is visible to other applications in the Classic environment.

MinimumOSVersion

"Minimum system version”

Do not use. Use“LSMinimumSystemVersion” instead.






Ref:
http://codegently.com/
http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-108256





arrow
arrow

    calories 發表在 痞客邦 留言(0) 人氣()