Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
How it Works
Clone this wiki locally
There's three main parts in DYCI
- Clang-proxy compiler
- Plugin-based compiler
- Dynamic library compiler
- iOS Dyci Library
Step 1. Search how file was compiled
At installation phase, your clang compiler will be switched to the "fake" one. Main purpose of this clang-proxy compiler is to save parameters for each file that was compiled. After save, it calls real clang.
(Note: This part is about to change, because we don't think that proxying clang is the best idea. In next version we are going to perform this task without clang-proxy)
** OR **
At installation phase your clang compiler will remain untouched. (use
In order to search compilation parameters for each file, Plugin is using Xcode runtime.
Step 2. Wrap result the result
Dynamic Library Compiler
When you are executing "Recompile and Inject" from Xcode, dyci working in this way:
- Recompiles your selected file class X, with parameters that was saved earlier by clang-proxy.
- After successful compilation, object file that was received after compilation, is wrapped to dynamic library (dylib)
- This dylib file is placed to user home directory (~/.dyci)
Step 3. Deliver updated code to the Simulator and inject it
###iOS Dyci Library
- On iOS Simulator side, iOS dyci Library are watching for changes in (~/.dyci)
- When new file appeared, it loads new dylib with dlopen function
- If all went OK, then at current moment we have 2 (or more) instances of class X.
- dicy Library changing all methods of your current class with the new implementations
Additionaly, if instances of class X has declared
-(void)updateOnClassInjectionmethod, then this method called for each instance
When all three parts succeded, you save some amount of time.