JSPatch-iOS热补丁方式快速修复bug
来源:互联网 发布:windows 10 恢复桌面 编辑:程序博客网 时间:2024/04/28 17:24
通过 JS 调用和改写 OC 方法最根本的原因是 Objective-C 是动态语言,OC 上所有方法的调用 / 类的生成都通过 Objective-C Runtime 在运行时进行。
通过JS代码覆盖,能够快速完美的修复线上程序bug。从此再也不用担心waiting review的时候发现了一个严重的bug,重新排队的问题。对于线上应用通过热补丁的方式进行修复。
具体调用方法如下代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [JPEngine startEngine]; // exec js directly// [JPEngine evaluateScript:@"\// var alertView = require('UIAlertView').alloc().init();\// alertView.setTitle('提示');\// alertView.setMessage('我用的JS写的程序'); \// alertView.addButtonWithTitle('OK');\// alertView.show(); \// "]; // exec js file from network// NSData *data =[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://cnbang.net/test.js"]];// NSString *script = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];// NSLog(@"-----%@",script);// [JPEngine evaluateScript:script]; // exec local js file NSString *sourcePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"js"]; NSString *script = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:nil]; [JPEngine evaluateScript:script]; return YES;}灵活的使用方法降低了,iOS程序开发的难度。只要你熟悉JS编程也能轻松实现自己的iOS应用。
最近出现一些对于JSpatch开发的程序害怕AppStore审核不同的疑虑,对此我明确地告诉大家,AppStore不会因为你使用了JSpatch被拒。
最后感谢我们的bangbangbang (棒)同学的热心分享。
0 0
- JSPatch-iOS热补丁方式快速修复bug
- iOS之热修复JSPatch 补丁更新管理
- iOS热修复JSPatch
- iOS热修复 JSPatch
- iOS热修复(JSPatch)
- IOS热修复之JSPatch
- IOS热修复之JSPatch
- JSPatch bug热修复 集成+简单使用
- IOS热修复之 JSPatch 实现方案
- JSPatch iOS热修复实现原理详解
- iOS 5分钟集成热修复(JSPatch)
- iOS 热修复- JSPatch的(Hello World)
- iOS基于JSPatch的热修复
- iOS JSPatch 热修复实现原理详解
- iOS 通过 JSPatch 实时修复线上 bug!
- iOS 通过 JSPatch 实时修复线上 bug!
- iOS开发 JSPatch实现热跟新及热修复
- iOS之动态热修复技术JSPatch(一)
- AsyncTask源码理解
- 我爱学Java之Pattern和Matcher用法
- Lua_第18 章 Table 库
- 流量单位的计算
- javarebel配置
- JSPatch-iOS热补丁方式快速修复bug
- CircleProgress
- 诡异的楼梯
- hive报错整理之Malformed ORC file 、Invalid postscript.
- Volley+OkHttp的整合
- ios本地通知(二)
- IOS中UITableViewCell使用详解
- error opening trace file: No such file or directory (2)
- 自定义DialogFrament弹框方式(底部,居中等)