feat:add debug option:start debugging

This commit is contained in:
pengfei.zhou
2021-03-02 15:11:16 +08:00
committed by osborn
parent de4188b74e
commit cf888e3655
7 changed files with 117 additions and 22 deletions

View File

@@ -105,11 +105,18 @@ - (void)onClick {
}];
[alertController addAction:cancel];
[alertController addAction:viewSource];
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
[DoricDev.instance stopDebugging:YES];
}];
[alertController addAction:stopDebugging];
if (DoricDev.instance.isInDevMode) {
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
[DoricDev.instance stopDebugging:YES];
}];
[alertController addAction:stopDebugging];
} else {
UIAlertAction *startDebugging = [UIAlertAction actionWithTitle:@"Start debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
[DoricDev.instance requestDebugging:self.doricContext];
}];
[alertController addAction:startDebugging];
}
}
[self.vc presentViewController:alertController animated:true completion:nil];