ios 模拟器无法联网

  • 内容
  • 评论
  • 相关

xcode7默认禁用了http明文请求,

右击info.plist文件,注意不要选错文件,有时候会有多个info.plist文件,open source添加一列

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

注意层级,把我的plist 文件贴出来

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>CFBundleDevelopmentRegion</key>

<string>en</string>

<key>CFBundleExecutable</key>

<string>$(EXECUTABLE_NAME)</string>

<key>CFBundleIdentifier</key>

<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

<key>CFBundleInfoDictionaryVersion</key>

<string>6.0</string>

<key>CFBundleName</key>

<string>$(PRODUCT_NAME)</string>

<key>CFBundlePackageType</key>

<string>APPL</string>

<key>CFBundleShortVersionString</key>

<string>1.0</string>

<key>CFBundleSignature</key>

<string>????</string>

<key>CFBundleVersion</key>

<string>1</string>

<key>LSRequiresIPhoneOS</key>

<true/>

<key>UILaunchStoryboardName</key>

<string>LaunchScreen</string>

<key>UIMainStoryboardFile</key>

<string>NewLogin</string>

<key>UIRequiredDeviceCapabilities</key>

<array>

<string>armv7</string>

</array>

<key>UISupportedInterfaceOrientations</key>

<array>

<string>UIInterfaceOrientationPortrait</string>

<string>UIInterfaceOrientationLandscapeLeft</string>

<string>UIInterfaceOrientationLandscapeRight</string>

</array>

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

</dict>

</plist>

 

评论

0条评论

发表评论

电子邮件地址不会被公开。