2019独角兽企业重金招聘Python工程师标准>>>

今天在测试app时,发现app store上版本有奔溃现象,但是直接用xcode跑本地程序没问题。猜测release&debug版本造成的,后发现targets的 optimization level设置问题,将release版本的optimization level改为none后程序不再崩溃。

参考见: http://www.mindjuice.net/2011/11/30/how-to-fix-an-app-that-crashes-in-release-but-not-debug/

关于优化级别:GCC_OPTIMIZATION_LEVEL 描述如下
None: Do not optimize. [-O0]

With this setting, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results.  Statements are independent: if you stop the program with a breakpoint between statements, you can then assign a new value to any variable or change the program counter to any other statement in the function and get exactly the results you would expect from the source code.

Fast: Optimizing compilation takes somewhat more time, and a lot more memory for a large function. [-O, -O1]

With this setting, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time. In Apple's compiler, strict aliasing, block reordering, and inter-block scheduling are disabled by default when optimizing.

Faster: The compiler performs nearly all supported optimizations that do not involve a space-speed tradeoff. [-O2]

With this setting, the compiler does not perform loop unrolling or function inlining, or register renaming.  As compared to the 'Fast' setting, this setting increases both compilation time and the performance of the generated code.

Fastest: Turns on all optimizations specified by the 'Faster' setting and also turns on function inlining and register renaming options. This setting may result in a larger binary. [-O3]

Fastest, smallest: Optimize for size.  This setting enables all 'Faster' optimizations that do not typically increase code size.  It also performs further optimizations designed to reduce code size.

转载于:https://my.oschina.net/michael1986/blog/129607

How to Fix an App that Crashes in Release but n...相关推荐

  1. 理解和分析App崩溃报告(译)

    Apple Develop官方原文:Understanding and Analyzing Application Crash Reports 简介 当一个应用程序崩溃, 会产生一个崩溃报告(cras ...

  2. Building Android App Without an IDE

    UPDATE 2018-03-12: "android create project" command is removed from newer sdk tools (since ...

  3. react hooks使用_如何使用React Hooks和Context API构建简单的PokémonWeb App

    react hooks使用 After seven years of full stack development using Ruby, Python, and vanilla JavaScript ...

  4. android app签名方法

    1.生成签名文件 在android studio 里操作如下: 填完即可. 会产生这个签名文件. 2.签名app 到jdk的bin文件夹下输入下面命令: jarsigner -verbose -key ...

  5. Android使用Github Actions持续集成并自动上传apk到蒲公英App内测分发平台(含证书密码脱敏)

    目录 1.前言 2.Github Actions持续集成 3.上传apk到蒲公英 4.Gradle配合Github Actions的Secret使用 4.1设置Github Actions Secre ...

  6. android 蒲公英 类似平台,Jenkins之android APP打包上传蒲公英平台

    1. 需求 实现android项目的系统化打包以及各版本apk归档管理并通过蒲公英平台API自动上传到蒲公英平台(之前是android开发自己开发工具手动打包再上传蒲公英) 2. 实现方式 jenki ...

  7. Jenkins生成APP二维码下载链接

    Jenkins 打包好的 apk 文件,上传到tomcat或者httpd所在服务器,并且生成对应URL二维码,进行扫码下,还可以配置到钉钉机器人模板消息通知中. 一.Jenkins配置 (一)Jenk ...

  8. iOS App审核遇到的问题(持续更新)

    Guideline 5.3.2 - Legal - Gaming, Gambling, and Lotteries 解决:在规则里面加入 该抽奖活动跟苹果无关 Your app includes a ...

  9. ios开发app瘦身

    缩减iOS安装包大小是很多中大型APP都要做的事,一般首先会对资源文件下手,压缩图片/音频,去除不必要的资源.这些资源优化做完后,我们还可以尝试对可执行文件进行瘦身,项目越大,可执行文件占用的体积越大 ...

最新文章

  1. 微信小程序开发(2)_data属性
  2. BZOJ-2049 [SDOI2008]洞穴勘测
  3. 浅析网站地图设置对网站的作用有哪些?
  4. AutoML Challenge 历史回顾
  5. 请使用recaptcha_如何在30分钟内使用ReCaptcha和PHP构建Bootstrap电子邮件表单
  6. 为知笔记 Markdown 新手指南
  7. 想成为一个高效的Web开发者吗?来看看大牛分享的经验吧
  8. SQL 存储过程中,将串连的字符串当表用。
  9. python建立虚拟环境付款_python 创建虚拟环境(virtualenv)
  10. mysql 清理表碎片需要停止数据库吗_Mysql的表的碎片清理
  11. 【Oracle】解决问题:pl/sql developer 小钥匙图标下拉框中oracle连接串不加粗显示
  12. 如何完成知识问答环节中的前期设置,题目准备及现场操作等主要流程?
  13. 算法学习之路|反转链表
  14. @软考考生,你想要的论文写作方法及规范,给你安排上了!
  15. 滴滴出行app——网约车出行的背后(下)
  16. 交叉编译libxcb与X11
  17. 深度相机:结构光、TOF、双目相机
  18. 读书札记-曾国藩陈景润
  19. 计算机网络——IP数据报分片
  20. C. Unusual Competitions

热门文章

  1. python PIL图像处理-框选
  2. python爬取豆瓣前25个影片内容的正则表达式练习
  3. 关于arraylist的扩容机制
  4. ASIHTTPRequest详解 [经典3]
  5. SAP ABAP规划 使用LOOP READ TABLE该方法取代双LOOP内部表的方法
  6. Java-jdbc连接数据库
  7. 跨站点脚本(XSS)
  8. Chrome 控制台的console用法收集
  9. vs code打开文件显示的中文乱码
  10. Cortex-M3 的SVC、PendSV异常,与操作系统(ucos实时系统)(转)