Top Banner
Debug @yarshure
29

Debuging tech

Jul 11, 2015

Download

Technology

Kong XiangBo
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Debuging tech

Debug@yarshure

Page 2: Debuging tech

自我介绍

Unix System Admin

Coder(Python/C)

Apple Developer

Core Animation Speech

Page 3: Debuging tech

agenda

iOS Application launch

静态/动态分析

调试

发布之后

Page 4: Debuging tech

应用程序启动过程

Page 5: Debuging tech

分析工具

file determine file type

strings find the printable strings in a object, or other binary, file

otool object file displaying tool

class-dump examining the Objective-C runtime information stored in Mach-O files

nm display name list (symbol table)

Page 6: Debuging tech

Xcode项目编译

xcodebuild -- build Xcode projects

gcc,clang, dsymutil, lipo,libtool,install_name_tool

codesign -- Create and manipulate code signatures

Page 7: Debuging tech

Xcode项目编译

PackageApplication prepare an application for submission to AppStore or installation by iTunes.

productbuild/productsign -- Build deployable product from Mac OS X Installer packages.

Page 8: Debuging tech

Build log

$ cd /Users/yarshure/Documents/WIFIKey/$ xcodebuild

Page 9: Debuging tech

静态分析: LLVM/Clang Static Analyzer

Page 10: Debuging tech

动态runingNSLog,printf

标准输出重定向

条件编译, 著名软件Release版也print Logfreopen( p, "w", stdout);

#ifdef DEBUG# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);#else# define DLog(...)

Page 11: Debuging tech
Page 12: Debuging tech

紧急情况

Page 13: Debuging tech

IPCU(支持Win)

Page 14: Debuging tech

UncaughtExceptions

EXC_BAD_ACCESS is a Mach exception sent by the kernel to your application when you try to access memory that is not mapped for your application. If not handled at the Mach level, it will be translated into a SIGBUS or SIGSEGV BSD signal.

SIGABRT is a BSD signal sent by an application to itself when an NSException or obj_exception_throw is not caught.

Page 16: Debuging tech

debug

Page 17: Debuging tech

运行选项

Page 18: Debuging tech

断点

Page 19: Debuging tech
Page 20: Debuging tech

重要

Page 21: Debuging tech
Page 22: Debuging tech
Page 23: Debuging tech
Page 24: Debuging tech

新的旅程

Page 25: Debuging tech

终端

/Developer/usr/bin/lldb

Page 26: Debuging tech

Crash Reports

Page 27: Debuging tech

network Tools

Page 28: Debuging tech

推荐资源

WWDC11 123

WWDC11 319

WWDC11 321

Page 29: Debuging tech