????今天測試給我反饋了一個bug,在iOS10的iPhone5手機(jī)出現(xiàn)了白屏的現(xiàn)象,先說下我們的項(xiàng)目結(jié)構(gòu)。我們的項(xiàng)目是一個ionic工程,在里面有一個原生的模塊,當(dāng)用戶進(jìn)入原生模塊之后,白屏。剛開始是百思不得其解,后來想是不是iOS13的問題,因?yàn)橹霸趇nfo.plist里新加了UIUserInterfaceStyle
字段,剛開始在這個方向去找問題,怎么也找不到,后來換了一種思路,白屏說明view沒有加載出來,而view是由xib創(chuàng)建的,是不是bundle出了問題?最后通過比對bundle的info.plist文件,最終找到了原因,bundle的plist文件里多了一個UIRequiredDeviceCapabilities
字段 o(╥﹏╥)o。
????我們來看下這個字段是什么意思
A key that tells iTunes and the App Store know which device-related features an application requires in order to run. iTunes and the mobile App Store use this list to prevent customers from installing applications on a device that does not support the listed capabilities.
The value of this key is either an array or a dictionary. If you use an array, the presence of a given key indicates the corresponding feature is required. If you use a dictionary, you must specify a Boolean value for each key indicating whether the feature is required. In both cases, not including a key indicates that the feature is not required.
For a list of keys to include in the dictionary, see Information Property List Key Reference. This key is supported in iOS 3.0 and later.
????大概意思是通過添加這個字段,可以對運(yùn)行這個app加一些限制,比如我添加了arm64,這個app就僅能在arm64架構(gòu)的手機(jī)上運(yùn)行,所有armv7的手機(jī)就不能運(yùn)行。
還有一些其他的字段,感興趣的可以在下面的引用文件找到。
????再來說下我的bug是怎么造成的,在我打包bundle的時候,是在DEBUG模式下打的,而在Buidl Setting-Build Active Architecture Onli字段下,DEBUG為YES,而且當(dāng)前的設(shè)備選擇是一臺iPhone 6的手機(jī),所以就導(dǎo)致在編譯的過程中自動添加了UIRequiredDeviceCapabilities
,這個字段,且當(dāng)前的限制為arm64(iPhone 6是arm64的手機(jī)),至此導(dǎo)致了這個bug。
????不過還有一個很奇怪的是,添加了這個字段之后不管是xcode打包還是通過下發(fā)蒲公英的app,運(yùn)行在iPhone 5的手機(jī)都是沒有問題的,只有下載AppStore上的app才是有問題的。