Projetos
Ver no GitHub
liuslevis/GYBootingProtection
Sobre
Ferramenta para detectar e reparar falhas contínuas na inicialização de apps iOS
Desenvolvimento web e de aplicativosCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- 0
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalGYBootingProtection
A tool for detecting and repairting continuous launch crash of iOS App
说明
引入项目
将
src目录下所有文件拖拽到你的 Xcode 项目在
AppDelegate+GYBootingProtection.m的onBeforeBootingProtection方法中添加检测前需要执行的代码,比如设置crash上报:
- (void)onBeforeBootingProtection {
[GYBootingProtection setLogger:^(NSString *msg) {
// setup logger
NSLog(@"%@", msg);
}];
[GYBootingProtection setReportBlock:^(NSInteger crashCounts) {
// setup crash report
}];
}
在
onBootingProtection方法中添加修复逻辑,比如删除文件:- (void)onBootingProtection { // 检查 JSPatch 更新 ... // 删除 Documents Library Caches 目录下所有文件 [GYBootingProtection deleteAllFilesUnderDocumentsLibraryCaches]; ... }如需执行异步的修复逻辑,在
onBootingProtectionWithCompletion:方法添加修复逻辑,并在完成修复后调用 completion :- (void)onBootingProtectionWithCompletion:(BoolCompletionBlock)completion { [self onBootingProtection]; // 异步修复 [self asyncRepairWithCompletion:^(void) { // 正常启动流程 if (completion) completion(); }]; }
测试与使用
- 首先制造连续闪退场景:
启动后 5 秒内,双击 Home 通过上划手势 kill 掉 App,重复多次。(也可以在代码里人为制造crash)
- 当连续闪退超过 5 次时,会提示用户修复:

- 用户轻触修复,App 重置初始状态,连续闪退问题解决:

Explore projetos relacionados
Carregando…