Mac下模擬器遇到App Transport Security policy的解決辦法

在昇級到 Cocos Creator 1.1.0 後,
在Mac下的模擬器,使用Socket IO時,若你跟我一樣使用 帶網址的後端 ( http://xxx.com/ 之類 )

應該會遇到跟我一樣的問題,
Log會像這樣

Simulator : JSB SocketIO.connect method called
Simulator : Calling native SocketIO.connect method
Simulator : In the constructor of HttpClient!
Simulator : JSB SocketIO.on method called
Simulator : JSB SocketIO eventName to: 'error'
Simulator : JSB SocketIO eventName to: 'connect'
Simulator : SIOClientImpl::handshake() failed
Simulator : error buffer: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Simulator : JSB SocketIO::SIODelegate->onError method called from native with data: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Simulator : JSB SocketIO::SIODelegate->fireEventToScript method called from native with name 'error' data: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

這個問題大概是Cocos Creator內的模擬器,
編譯的時候,未加入NSAllowsArbitraryLoads的關係,

解決辦法是,用文字編譯器打開路徑
/Applications/Cocos/CocosCreator.app/Contents/Resources/cocos2d-x/simulator/mac/Simulator.app/Contents/Info.plist
這個 Info.plist 檔,
接著在的區段內,加入

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

這樣下次你使用 Mac 下的模擬器,就不會再遇到相同問題了,
當然,在編譯 IOS 原生App的時候,也能使用這個方法。

提供給遇到一樣問題的人參考。