在obj c中按任务执行cycript

问题描述

我正在尝试运行 cycript 命令并从我的工具中获取 cycript 返回的结果(该工具在越狱的 iphone 上由 theos 运行)?但这里的问题是 cycript 正在占用主线程,似乎让我的工具挂在那里。有没有办法做到这一点?这是我用来测试它的代码

-(Nsstring*)getTestCycript:(Nsstring*)appname {
    @try {
        NSLog(@"Executing command...");
        Nsstring *command = [[[Nsstring alloc] init] autorelease];
        Nsstring *result = [[[Nsstring alloc] init] autorelease];
        
        command = [Nsstring stringWithFormat:@"cycript -p %@",appname];
        result = [self runcommand:command];
        
        command = [Nsstring stringWithFormat:@"UIApp.keyWindow.recursiveDescription().toString()"];
        result = [self runcommand:command];
        return result;
    }
    @catch (NSException * e) {
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)