Kazuhito Ochiai

Software Engineer born in Japan, lives in Brooklyn

Read this first

Anatomy of iOS Application Build process (Obj-C)

In this article, I’ll take a close look at the build report, hoping to learn something that helps to improve my development efficiency down the road. I believe knowing what’s going on under the hood helps to resolve problems much faster. I used Xcode Version 8.2.1 (8C1002) and build report may look different in other versions.

Build log analysis in Xcode

In order to produce the most basic build report, I created a new single view application “ObjHelloWorld”, then run on my iPhone 6s Plus device (⌘r). Once the project is built and start running, open the Report Navigator (⌘8) and expand “ObjCHelloWorld” target, select most recent build session.

build_report.png

As you can see in the screenshot above, there are 13 steps to build the simple hello world application excluding duplicated steps. Let’s take a look one by one.

1. Create product structure

“Create product structure” step is simply creating...

Continue reading →


Injecting code in a process with Cycript

In this article, I’m going to show you how to inject code in running process on an iOS device using Cycript. In this example, I injected code into viewWillAppear: function, so that every time a view controller receives viewWillAppear: message, it displays an alert view with its name and address. Although I used Music app as an example, this just works for any application available in the App Store.

For this entire article I used a jailbroken iPhone 5 with iOS 8.1 and a MacBookPro with macOS 10.11.6.

Cycript is a tool developed by Jay Freeman (saurik), who also created Cydia, which allows developers to explore and modify running application. Cycript allows you to perform “Method Swizzling” on a running process, which mean you can inject your code in a running process. (How cool is that?)

SSH into iPhone

If you haven’t, download “OpenSSH” by Jay Freeman (saurik) from Cydia.

First...

Continue reading →