#include "objc/runtime.h"
@interface AppDelegate ()
@end
UIApplication *_tapplication;
void (*origMehtodImp)(id,SEL,SEL,id,id,UIEvent *);
void MethodSwizzle(Class c,Class c2,SEL origSEL,SEL overrideSEL)
{
Method origMethod = class_getInstanceMethod(c, origSEL);
Method overrideMethod= class_getInstanceMethod(c2, overrideSEL);
if(class_addMethod(c, origSEL, method_getImplementation(overrideMethod),method_getTypeEncoding(overrideMethod)))
{
class_replaceMethod(c,overrideSEL, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}
else
{
method_exchangeImplementations(origMethod,overrideMethod);
}
}
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
_tapplication = application;
Method origMethod = class_getInstanceMethod([UIApplication class], @selector(sendAction:to:from:forEvent:));
origMehtodImp= method_getImplementation(origMethod);
MethodSwizzle([UIApplication class],[self class],@selector(sendAction:to:from:forEvent:),@selector(sendAction:to:from:forEvent:));
return YES;
}
- (BOOL)sendAction:(SEL)action to:(id)target from:(id)sender forEvent:(UIEvent *)event
{
NSLog(@"action =%s target=%@",action,target);
origMehtodImp(_tapplication,@selector(sendAction:to:from:forEvent:),action,target,sender,event);
return true;
}
相关推荐
IOS调试报错“xxxx is running iOS 12.xx (16G77), which may not be supported by this version of Xcode.” 提示当前的xcode版本不支持IOS12.xx,我当前的xcode是10.xx,手机是12.xx. 解决办法有两个: 一是,更新...
iOS 页面调试神器 reveal破解版安装方法在压缩包中
一个iOS调试工具,监控所有HTTP请求,自动捕获Crash分析。 1.当出现功能异常时,有很大可能是与服务器的接口交互有数据异常,不管是客户端参数传错还是服务器返回结果错误,都不需要连接电脑调试了,只要打开...
iOS 调试库,支持 iOS8 ,无需添加任何代码,方便 iOS 开发和测试
一片关于iOS中调试方法及调试命令的文档,棒棒哦~
Cordova iOS调试技巧Cordova iOS调试主要分两部分:Objective-C (插件原生代码,自定义插件,高性能代码)JavaScript/CS
CocoaDebug:一个 iOS 调试工具,支持 Debug 模式下查看 App 日志.zip,iOS调试工具
LLDebugTool - 便捷的IOS调试工具(支持Swift).zip,LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations.
ios12.2 调试包
iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS11.1调试包iOS...
idb-“ iOS调试桥” 我对用于Android设备的一些有用的adb命令进行了仿真,适用于通过USB连接的越狱的iOS设备。 目前,它已在从iOS 4到iOS 10的iDevices上进行了测试,但是无论运行什么最新版本的SSH守护程序,它都...
ios14.0真机调试包
ios 真机调试包,iOS 14.6 最新系统
AllYourMemoriesAreBelong2iOS 是一个方便的调试工具,其集成在 iOS 项目中,让开发者在调试过程中可以通过按动 iOS 物理设备的音量键来模拟内存警告通知的产生。该库由 @开源中国真理部部长 使用 Objective-C 语言...
ios13.1、13.2、13.3、13.4、13.5真机调试包,支持最新版本系统调试.
Xcode iOS 16真机调试包 开发调试 iOS16适配
一款功能强大的 iOS App 内调试工具,支持在 App 运行状态下直接修改 UI 查看效果等。.zip,An in-app debugging and exploration tool for iOS
用于无法升级Xcode 但是还要12.4机器调试的开发人员, 使用方法:放到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 下