更新了Xcode8 以及 iOS10,App访问用户的相机、相册、麦克风、通讯录的权限都需要重新进行相关的配置,不然在Xcode8中打开编译的话会直接crash。

需要在info.plist中添加App需要的一些设备权限。

  1. 相机NSCameraUsageDescription
  2.  
  3. 相册NSPhotoLibraryUsageDescription
  4.  
  5. 通讯录NSContactsUsageDescription
  6.  
  7. 始终访问位置NSLocationAlwaysUsageDescription
  8.  
  9. 位置NSLocationUsageDescription
  10.  
  11. 在使用期间访问位置NSLocationWhenInUseUsageDescription
  12.  
  13. 麦克风NSMicrophoneUsageDescription
  14.  
  15. 访问蓝牙NSBluetoothPeripheralUsageDescription
  16.  
  17. 访问日历NSCalendarsUsageDescription
  18.  
  19. 访问媒体资料库NSAppleMusicUsageDescription
  20.  
  21. 访问健康分享NSHealthShareUsageDescription
  22.  
  23. 访问健康更新NSHealthUpdateUsageDescription
  24.  
  25. 访问运动与健身NSMotionUsageDescription
  26.  
  27. 访问提醒事项NSRemindersUsageDescription

提别提醒: 从2017年1月1日起,强制使用https,所有新提交的 app 默认不允许使用NSAllowsArbitraryLoads来绕过ATS的限制 安全传输不再支持SSLv3, 建议尽快停用SHA1和3DES算法.

下面贴出来错误:

Q1:  iOS10相册相机闪退问题:

iOS10系统下调用系统相册、相机功能,遇到闪退的情况,日志描述如下:

This app has crashed because it attempted to access privacy-sensitive data without a usage description.The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

解决方法:在info.plist文件下添加

相机权限

  1. <key>NSCameraUsageDescription<key>
  2. <string>cameraDesciption<string>

相册权限

  1. <key>NSPhotoLibraryUsageDescription<key>
  2. <string>photoLibraryDesciption<string>

Q2:  iOS 10 因苹果健康导致闪退

如果在app中调用了苹果健康,iOS10中会出现闪退。控制台报出的原因是:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'

这是因为我们要在info.plist文件中声明苹果健康的使用权限,所以在info.plist中添加以下key就可以:

请求写入

  1. <key>NSHealthUpdateUsageDescription<key>
  2. <string>some string value stating the reason<string>

请求读取

  1. <key>NSHealthShareUsageDescription<key>
  2. <string>some string value stating the reasonPaste_Image.png<string>

Q3:  Xcode 打印的那些杂乱无章的bug

更新Xcode8之后,新建立工程,都会打印一堆莫名其妙看不懂的Log.比如如这些

subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level:0, persist_level:0, default_ttl:0, info_ttl:0, debug_ttl:0, generate_symptoms:0, enable_oversize:1,

屏蔽的方法如下:

Xcode8里边 Edit Scheme->Run-> Arguments, 在Environment Variables里边添加

OS_ACTIVITY_MODE = Disable 就行,截图如下:(真的没有iPhone4了)

弄完之后就可以像之前那样 正常打印了.

info.plist的更多相关文章

  1. plist文件、NSUserDefault 对文件进行存储的类、json格式解析

    ========================== 文件操作 ========================== Δ一 .plist文件 .plist文件是一个属性字典数组的一个文件: .plis ...

  2. Your app declares support for audio in the UIBackgroundModes key in your Info.plist 错误

    提交AppStore时候被拒绝 拒绝原因:Your app declares support for audio in the UIBackgroundModes key in your Info.p ...

  3. ios开发之Info.plist文件相关配置

    前言:在iOS开发中有些情况下需要对Info.plist文件进行配置,以下介绍几种相关配置.以后遇到需要配置的再更新... 开发环境:swift3.0.1,Xcode8.1 一,项目中需要使用第三方字 ...

  4. Excel文件转plist文件出现的文件编码问题

    今天在测试时遇到了需要将大量整理好的Excel数据转换为plist文件的情况.百度了一下教程,发现虽然别人也遇到过类似的情况,但是有些讲的还是不够细致.所以做如下整理.   百度到的内容中有使用Mes ...

  5. 将plist文件读取成为数组

    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"city" ofType:@"plist&q ...

  6. IOS学习笔记之获取Plist文件读取数据

    @property(nonatomic,strong) NSArray *pic; //创建数组属性 @property(nonatomic,assign) int index; //创建索引属性 @ ...

  7. plist的读取和写入

    // 从plist中读取数组数据 let arrPath = Bundle.main.path(forResource: "ArrayPList", ofType: "p ...

  8. App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file

    ios进行http请求,会出现这个问题: App Transport Security has blocked a cleartext HTTP (http://) resource load sin ...

  9. iOS plist文件创建

    iOS中plist的创建,数据写入与读取功能创建一个test.plist文件,textInput作为输入,displayLabel作为显示,有一个按钮来触发保持程序triggerStorage: -( ...

  10. 加载plist文件数据的方法

    这个pilist文件最外面的是一个数组,数组中每一个item是一个字典,我们的目的就是为了取到每一个item字典中的内容数据 下面看代码举例 //加载数组 - (void)handleData { / ...

随机推荐

  1. [Linux] Ubuntu 18 LTS netplan 网络配置

    Ubuntu 18 LTS netplan 网络配置 今天装完 Ubuntu 18 LTS,配置网络时发现Ubuntu 18LTS ifupdown has been replaced by netp ...

  2. 国产Linux滋生腐败

    回想过去,2002年12月11日至12日,信息产业部与科技部联合主办"Linux软件与应用猜測研讨会".影响中国IT业的重要人士,包含政府决策者.学界权威.主要Linux推动厂商等 ...

  3. yield的使用

    参考: http://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/ http://blog.csdn.net/alvine0 ...

  4. spring mvc 下 applicationContext 和webApplicationContext

    spring中的ApplicationContexts可以被限制在不同的作用域.在web框架中,每个DispatcherServlet有它自己的WebApplicationContext,它包含了Di ...

  5. ExtJS GridPanel的ColumnModel 动态加载

    var colM = "company,id,flyline"; var colMArr = colM.split(","); var colLength = ...

  6. <jsp:directive.page import=""/>的用法和解释

    <jsp:directive.page import="zero.space.ch03.BookBean"/>    相当于    <%@ page import ...

  7. SVN中的Trunk、Tag、Brance的用法

    在SVN中Branch/tag在一个功能选项中,在使用中也往往产生混淆.在实现上,branch和tag,对于svn都是使用copy实现的,所以他们在默认的权限上和一般的目录没有区别.至于何时用tag, ...

  8. android之截屏(包括截取scrollview与listview的)

    public class ScreenShot { // 获取指定Activity的截屏,保存到png文件 public static Bitmap takeScreenShot(Activity a ...

  9. 快速入门:十分钟学会PythonTutorial - Learn Python in 10 minutes

    This tutorial is available as a short ebook. The e-book features extra content from follow-up posts ...

  10. Linux C Socket编程发送结构体、文件详解及实例

    利用Socket发送文件.结构体.数字等,是在Socket编程中经常需要用到的.由于Socket只能发送字符串,所以可以使用发送字符串的方式发送文件.结构体.数字等等. 本文:http://www.c ...