cycript用下面的方法列出来视图控制器所有的方法:
function printMethods(className) {
var count = new new Type("I");var methods = class_copyMethodList(objc_getClass(className), count);
var methodsArray = [];
for(var i = 0; i < *count; i++) {
var method = methods[i];
methodsArray.push({selector:method_getName(method), implementation:method_getImplementation(method) });
}
free(methods);
free(count);
return methodsArray;
.a静态库,合成既能在真机又能在模拟器下编译的静态库命令:lipo -create Debug-iphoneos/libdcj.a Debug-iphonesimulator/libdcj.a -output libdcj.a