├── 使用Xcode10调试iOS13设备.md ├── Xcode iPhoneOS 设备支持 (6.0 - 15.0).md ├── README.md ├── iOS 14 适配.md └── Xcode 多环境配置.md /使用Xcode10调试iOS13设备.md: -------------------------------------------------------------------------------- 1 | # 更新最新热门文章 2 | 3 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 4 | 5 | 6 | 7 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 8 | 9 | 10 | 在iOS13适配过程中会有使用低版本的SDK进行编译然后跑在高版本的设备上进行兼容性适配。 如果每次都打包出来跑在高版本的设备上实在有些麻烦又不方便Debug。其实,低版本的Xcode是可以调试高版本的设备的,只是需要进行一点改动。 11 | 12 | ## 低版本Xcode调试高版本真机 13 | 14 | Xcode的真机部署和调试依赖一个叫做 **Device Support File**的东西, 每个版本的固件都有对应的该文件,只有电脑的**device Support File**和目标设备的系统匹配才可以调试。 15 | 16 | 对应新版本固件的**Device Support File**都是随新版本的Xcode附带, 首先下载好新版本的Xcode(目前最新版的是Xcode 11 beta),然后到(假设新版本的Xcode是Xcode-beta) 17 | 18 | ``` 19 | /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 20 | 复制代码 21 | ``` 22 | 23 | 复制对应版本的**Device Support File**, 24 | 25 | ![image.png](https://upload-images.jianshu.io/upload_images/19704571-bccd2e8bb3e5bb15.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 26 | 27 | 28 | > 注意:要整个目录一起复制, 比如上图就是复制整个**13.0**目录 29 | 30 | 到旧版本的目录 31 | 32 | ``` 33 | /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 34 | 复制代码 35 | ``` 36 | 37 | 输入密码, 重启下旧版Xcode就可以调试高版本真机了。 38 | 39 | ## 低版本Xcode调试高版本模拟器 40 | 41 | 要调试高版本的模拟器, 只需要先下载一个高版本的Xcode,然后随便打开一个项目运行一下, 等模拟器启动起来。 42 | 43 | 然后再旧版本的Xcode上就可以选择高版本的模拟器进行调试了。 44 | 45 | # 更新最新热门文章 46 | 47 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 48 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 49 | 50 | 51 | 作者:lxyzk 52 | 链接:https://juejin.cn/post/6844903910658801672 53 | 54 | -------------------------------------------------------------------------------- /Xcode iPhoneOS 设备支持 (6.0 - 15.0).md: -------------------------------------------------------------------------------- 1 | Xcode iPhoneOS 设备支持 (6.0 - 15.0) 2 | 3 | **最新版本:** 4 | 5 | **iOS的15.0** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/15.0.zip) 6 | **iOS版14.7.1** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.7.1.zip) 7 | **iOS的14.7** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.7.zip) 8 | **iOS的14.6** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.6.zip) 9 | **iOS的14.5** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.5.zip) 10 | **iOS的14.4** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.4.zip) 11 | **iOS的14.3** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.3.zip) 12 | **iOS的14.2** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.2.zip) 13 | **iOS的14.1** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.1.zip) 14 | **iOS的14.0** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/14.0.zip) 15 | **iOS的13.7** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.7.zip) 16 | **iOS的13.6** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.6.zip) 17 | **iOS 13.5** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.5.zip) 18 | **iOS 13.4** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.4.zip) 19 | **iOS 13.3** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.3.zip) 20 | **iOS 13.2** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.2.zip) 21 | **iOS 13.1** -[下载](https://github.com/filsv/iPhoneOSDeviceSupport/raw/master/13.1.zip) 22 | 23 | # 坚持维护更新中~ 24 | 25 | **喜欢的点个星,再一次^_^。** 26 | 27 | **需要14.6以上15.0真机包的;可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载!** 28 | 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS设备真机调试包 2 | 真机调试包,供大家参考,当前收录iOS8.0~iOS15.0 持续更新中 3 | 4 | 各版本的iOS设备支持(最新支持iOS15.0) 5 | 6 | 只需要多少的可以下载,如下 7 | 8 | ## [](https://github.com/LGBamboo/iOSDeviceSupport#%E4%BE%BF%E6%8D%B7%E5%8D%95%E5%8C%85%E4%B8%8B%E8%BD%BD%E5%9C%B0%E5%9D%80)趋势单包下载地址: 9 | 10 | * [iOS 14.6](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.6.zip) 11 | * [iOS 14.5](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.5.zip) 12 | * [iOS 14.4](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.4.zip) 13 | * [iOS 14.3](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.3.zip) 14 | * [iOS 14.2](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.2.zip) 15 | * [iOS 14.1](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.1.zip) 16 | * [iOS 14.0](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS14%EF%BC%8814.0-14.6%EF%BC%89/14.0.zip) 17 | * [iOS 13.7](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS13%EF%BC%8813.0-13.7%EF%BC%89/13.7.zip) 18 | * [iOS 13.6](https://gitee.com/ios-code-for-the-future/iosdevicesupport/raw/master/iOS13%EF%BC%8813.0-13.7%EF%BC%89/13.6.zip) 19 | 20 | # [](https://github.com/LGBamboo/iOSDeviceSupport#%E5%9D%9A%E6%8C%81%E7%BB%B4%E6%8A%A4%E6%9B%B4%E6%96%B0%E4%B8%AD)坚持维护更新中~ 21 | 22 | **喜欢的点个星,下次再来^_^。** 23 | 24 | **需要14.6以上15.0真机包的;可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载!** 25 | 26 | ************** 27 | # 更新最新热门文章 28 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 29 | * [BAT最新面试题合集](https://github.com/uzi-yyds-code/Good-interview) 30 | * [iOS音视频入门到进阶](https://github.com/uzi-yyds-code/IOS-audio-and-video-technology) 31 | 32 | -------------------------------------------------------------------------------- /iOS 14 适配.md: -------------------------------------------------------------------------------- 1 | # 更新最新热门文章 2 | 3 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 4 | 5 | 6 | 7 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 8 | 9 | 苹果每年发布新手机的时间前后,都会发布最新的 iOS 系统,一般会包含比较多的更新,例如隐私策略、API 更新和废弃、审核策略等等。所以针对每次更新,都需要进行适配,以便可以让用户无感知的过渡到新系统,不会出现崩溃等一些体验性问题。 10 | 11 | ####KVC 方法禁用 12 | 现状: 13 | 如同 iOS 13 时,UITextField 禁止使用 setValue:forKey: 来设置 _placeholderLabel 私有属性,iOS 14 中,UIPageControl 也禁止使用 setValue 方法,来设置 _pageImage 和 _currentPageImage 属性。否则运行时将会崩溃。 14 | 15 | 解决方法: 16 | 全局搜索 _pageImage 和 _currentPageImage 关键字,发现项目中没有用到。 17 | 18 | ####选择照片 19 | 现状: 20 | 访问相册选择照片时,弹出的权限弹窗中多出了一个选项:选择照片。可以让用户选择部分照片,以供 App 使用,未选择的其他照片,App 是看不到的。葩趣 App 中引入了一个三方 TZImagePickerController ,会受到影响白屏,通过升级到最新的版本,解决。 21 | 22 | 更优方案: 23 | 24 | 用户选择了这个选项以后,每次重启手机再次请求时,这个权限弹窗都会再次弹出 可以通过在 info.plist 中配置 PHPhotoLibraryPreventAutomaticLimitedAccessAlert 项值为 YES,来阻止每次弹窗的弹出。 25 | 同时可以有个策略告诉用户,你选择的模式是部分图片,可以在设置中进行更改。产品暂时没有时间进行排期。 26 | 27 | ####获取唯一标识符 API 废弃 28 | 现状: 29 | 在 iOS13 及以前,系统会默认为用户开启允许追踪设置,我们可以简单的通过代码来获取到用户的 IDFA 标识符。 30 | ``` 31 | if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) { 32 | NSString *idfaString = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; 33 | NSLog(@"%@", idfaString); 34 | } 35 | 复制代码 36 | ``` 37 | iOS 14 以后,会默认关闭广告追踪权限,而且上面判断是否开启权限的方法已经废弃。 38 | 39 | 解决方案:需要我们需要在 Info.plist 中配置" NSUserTrackingUsageDescription " 及描述文案,接着使用 AppTrackingTransparency 框架中的 ATTrackingManager 中的 requestTrackingAuthorizationWithCompletionHandler 请求用户权限,在用户授权后再去访问 IDFA 才能够获取到正确信息。 40 | ``` 41 | #import 42 | #import 43 | 44 | - (void)testIDFA { 45 | if (@available(iOS 14, *)) { 46 | [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { 47 | if (status == ATTrackingManagerAuthorizationStatusAuthorized) { 48 | NSString *idfaString = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; 49 | } 50 | }]; 51 | } else { 52 | // 使用原方式访问 IDFA 53 | } 54 | } 55 | 复制代码 56 | ``` 57 | 葩趣中没有用到广告标识符,但是需要确认 Bugly 等一些第三方有没有 SDK 更新。经过查看官网,没有需要更新的 SDK。 58 | 59 | ####获取相册 API 更新 60 | 61 | 现状: 62 | 63 | AssetLibrary 方式获取照片被禁用,使用该方式,将不会获取到照片。推荐使用 PHPhotoKit 来获取相册照片。 64 | 65 | 解决方案:葩趣 App 中使用了 PhotoKit 来获取相册,无需适配。 66 | 67 | ####UITableViewCell 68 | cell 内部必须使用 self.contentView addsubview: 方式,添加子控件,否则会出现无法响应点击的情况。 69 | 70 | 71 | 72 | # 更新最新热门文章 73 | 74 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 75 | 76 | 77 | 78 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 79 | 80 | 作者:落寒 81 | 链接:https://juejin.cn/post/6912339107268329485 82 | -------------------------------------------------------------------------------- /Xcode 多环境配置.md: -------------------------------------------------------------------------------- 1 | # 更新最新热门文章 2 | 3 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 4 | 5 | 6 | 7 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 8 | 9 | 在进行多环境配置之前,我们需要对Xcode内的元素组成做一些了解。 10 | 11 | * Project:包含了项目所有的代码,资源文件等所有信息。 12 | * Target:对指定代码和资源文件的具体构建方式。 13 | * Scheme:对指定Target的环境配置。 14 | 15 | ## 多环境配置三种方式 16 | 17 | ### 方式1\. 多Target 18 | 19 | 新建一个Target,修改BundleId,修改跟随Target新生成的Info-plist文件名 20 | 21 | ![BunduleId](https://upload-images.jianshu.io/upload_images/19704571-d5f47352d9d8563f.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 22 | 23 | ![info.plist](https://upload-images.jianshu.io/upload_images/19704571-2d6869456e454fb5.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 24 | 25 | 对OC来说,根据target在Builed setting 的Preprocessor Macros中定义宏,来区分不同target的不同环境 26 | 27 | ![环境](https://upload-images.jianshu.io/upload_images/19704571-cbf808530a1adf81.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 28 | 29 | 切换不同的target的编译scheme后,在代码中以下面方式使用 30 | 31 | ![代码](https://upload-images.jianshu.io/upload_images/19704571-2ce284441c4fe8fb.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 32 | 33 | 对swift来说,可以在Builed setting 的 Other Swift Flags 里配置一个变量,然后在Swift代码中进行判断 34 | 35 | ![swift](https://upload-images.jianshu.io/upload_images/19704571-65a71d107d1de1b8.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 36 | 37 | 但是该方式并不是很方便,缺点如下: 38 | 39 | * 会生成多个Info-plist,不便于管理 40 | * 配置起来比较混乱 41 | 42 | ### 方式2\. 多Scheme - 多Configurations 43 | 44 | 一般Scheme默认有Debug和Relesse 两种Configurations,此处可以再添加第三种 45 | 46 | ![Scheme](https://upload-images.jianshu.io/upload_images/19704571-5b0e2088ed9b51e7.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 47 | 48 | 这时所有的配置选项都会变成三个,此时可以新建多个Scheme,分别在不同Scheme选择对应不同的Configurations 49 | 50 | ![Configurations](https://upload-images.jianshu.io/upload_images/19704571-894ffaab52782ae8.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 51 | 52 | 然后我们在User-Defined定义一个HOST_URL,并在info-plist中暴露出来 53 | 54 | ![User-Defined](https://upload-images.jianshu.io/upload_images/19704571-ba90be1b7c6cc982.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 55 | 56 | 切换Scheme就可以切换不同环境的HOST_URL,达到多环境配置的目的 57 | 58 | ![代码](https://upload-images.jianshu.io/upload_images/19704571-c0d1de5d41ed5607.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 59 | 60 | 此外,还可以在User-Defined中 为不同Scheme配置不同的appico 61 | 62 | ![icon](https://upload-images.jianshu.io/upload_images/19704571-ad07c339682f38f2.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 63 | 64 | ![icon配置](https://upload-images.jianshu.io/upload_images/19704571-46216df39b907de1.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 65 | 66 | 这时不同Target就有了不同的icon 67 | 这种方式相较第一种方便了一些,但是依然需要在Builed setting 中进行配置 68 | 69 | ### 方式3\. xconfig文件 (cocoapods就是使用的这种方式) 70 | 71 | 首先创建xconfig文件,需要注意的是xconfig文件与环境一一对应 72 | 命名时以 路径-项目名-环境名 来命名 73 | 74 | ![xconfig](https://upload-images.jianshu.io/upload_images/19704571-fec39a88273b97b5.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 75 | 76 | 并在Configurations中选择对应的xconfig文件 77 | 78 | ![Configurations](https://upload-images.jianshu.io/upload_images/19704571-51502bff7f8a5212.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 79 | 80 | #### xconfig冲突处理 81 | 82 | 此时删除之前配置的HOST_URL,在不同Xconfig文件中写入不同HOST_URL的值,也能得到相同的效果,但是cocoa pods中也有自己的Xconfig文件,在这之前需要把cocoa pods的xconfig文件路径(注意加上根目录Pods/)引入到Xconfig文件中来解决冲突。 83 | 84 | ![xconfig1](https://upload-images.jianshu.io/upload_images/19704571-5eaf606613703d12.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 85 | 86 | ![xconfig2](https://upload-images.jianshu.io/upload_images/19704571-844f7e366746862d.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 87 | 88 | 此时就准确打印出了Debug模式下HOST_URL 89 | 90 | ![代码](https://upload-images.jianshu.io/upload_images/19704571-9a3dd00a65c04441.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 91 | 92 | 但是在两个Xconfig文件中可能配置了两个相同的Builed setting配置,这也是一种冲突,这时需要在自己的XConfig文件中用$(inherited)来继承cocoapods中的配置就可以了。 93 | 94 | ![相同配置](https://upload-images.jianshu.io/upload_images/19704571-ffe139f0d967e71a.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 95 | 96 | ![相同配置设置](https://upload-images.jianshu.io/upload_images/19704571-8edfc3f0d5e36960.image?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 97 | 98 | ### 对以上三种方式进行总结: 99 | 100 | * 多target ,可以控制需要编译的代码文件和资源文件 101 | * 多Scheme可以提供多套环境变量 102 | * 多xconfig 可以更好的管理和配置这些环境变量 103 | 104 | # 更新最新热门文章 105 | 106 | * [逆向入门到进阶项目合集](https://github.com/uzi-yyds-code/IOS-reverse-security) 107 | 108 | 109 | 110 | * **欢迎可以加入iOS高级技术交流群:[1001906160](https://jq.qq.com/?_wv=1027&k=KjioxJty);群文件可以免费真机包下载,更多中高级进阶资料!** 111 | 112 | 作者:ives_w 113 | 链接:https://juejin.cn/post/6971303989342109726 114 | 115 | --------------------------------------------------------------------------------