請問Simulate Touch 自動在程式碼裡連續執行touch的方法嗎?

需求:
我想要在theos tool projec的main裡面连续执行simulateTouch,而不是按照官方的范例一行一行输入在terminal裡面,我目前使用dispatch_after想让第二次的simulateTouch方法延后一秒执行,但是他无法延后,只能执行第一次的方法,然后就结束了.

代码:
else if (strcmp(argv[1], “autorun”) == 0)
{
printf(“AutoRun Start!\n”);

        int r = [SimulateTouch simulateTouch:0 atPoint:CGPointMake(150, 35) withType:STTouchDown];
        if (r == 0) printf("iOSREError: Simutale touch down failed at (%d, %d).\n", 150, 35);
        [SimulateTouch simulateTouch:r atPoint:CGPointMake(150, 35) withType:STTouchUp];

        double delayInSeconds = 1.0;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
            printf("delay 1 second!\n");
            int r = [SimulateTouch simulateTouch:0 atPoint:CGPointMake(300, 1350) withType:STTouchDown];
            [SimulateTouch simulateTouch:r atPoint:CGPointMake(300, 1350) withType:STTouchUp];
        });
    } 

操作步骤:
按照範例來說我必須每次的touch都要透過terminal一次一次輸入,例如:
iPhone:~ root# iOSRETouch touch 100 500
iPhone:~ root# iOSRETouch touch 150 500
iPhone:~ root# iOSRETouch touch 200 500
iPhone:~ root# iOSRETouch touch 250 550
但是我直接在main裡面串写这个四个touch event,所以我预期执行autorun的时候,
程式会自己跑四次不同参数的touch event,而且间隔一秒做一次动作,但是事实上第一个动作有发生之后其他三个动作就没有反应了.想请教大大要怎麽实现让他自动执行多行touch event?

环境:
iMac 10.12.6
iPhone 10.2
JB