iOS中info.plist文件的一些相關配置

下面是一些iOS項目中經常使用的plist文件的相關設置:網絡

1.定位爲題:ide

  調用定位時在target裏設置兩個屬性:NSLocationAlwaysUsageDescription  NSLocationWhenInUseUsageDescription測試

2. 網絡請求:ui

  Xcode升級後不支持http訪問的解決辦法:在Info.plist中添加NSAppTransportSecurity類型Dictionary。
    在NSAppTransportSecurity下添加NSAllowsArbitraryLoads類型Boolean,值設爲YES
spa

3. 設置應用名稱(Bundle display name)
  <key>CFBundleDisplayName</key>
  <string>應用程序名稱</string>
code

4.設置應用程序版本號(Bundle version):
  每次部署應用程序的一個新版本時,將會增長這個編號,用於標識不一樣的版本。
  <key>CFBundleVersion</key>
  <string>1.0</string>
ip

5.設置應用程序是否支持後臺運行(Application does not run in background)

  經過UIApplicationExitsOnSuspend能夠設置iOS的應用程序進入到掛起狀態下是否當即退出,設置爲YES表示不支持後臺運行退出到後臺當即退出,設置爲NO表示  支持後臺運行。
  (1)設置支持後臺運行
  <key>UIApplicationExitsOnSuspend</key>
  <false/>
  (2)設置不支持後臺運行
  <key>UIApplicationExitsOnSuspend</key>
  <true/>
開發

6. info.plist的幾個常見屬性:字符串

  Localization native development region : 與本地化設置有關,爲默認的開發語言
  Executable file:程序安裝包的名稱
  Bundle identifier:軟件惟一的標識,是根據公司的標識與項目名稱自動生成的,在上傳和測試的時候會用到
  InfoDictionary version:版本信息
  Bundle name:App安裝後顯示的名稱
  Bundle OS Type code:用來標識軟件包類型
  Bundle versions string, short:發佈的版本字符串
  Bundle creator OS Type code:建立者的標識
  Bundle version:應用程序版本號
  Application requires iPhone environment:用於指示程序包是否只能運行在iPhone OS 系統上,默認爲YES
  Launch screen interface file base name:歡迎界面的文件名稱
  Main storyboard file base name:默認狀況下程序的主入口
  Supported interface orientations:設置程序默認支持的方向
部署

相關文章
相關標籤/搜索