Android 回显

//执行

private void playRunTime(String cmd) throws Exception {

Process p = Runtime.getRuntime().exec(cmd);

InputStream is = p.getInputStream();

BufferedReader reader = new BufferedReader(new InputStreamReader(is));

String line;

while ((line = reader.readLine()) != null) {

tv_result.append(line + "\n");

}

p.waitFor();

is.close();

reader.close();

p.destroy();

}

若cmd 执行后回显的字符太长,导致string 无法完整保存结果该如何处理

StringBuilder outputBuilder = new StringBuilder();

String line;

while ((line = reader.readLine()) != null) {

outputBuilder.append(line).append("\n");

}

git push mega HEAD:refs/for/

repo forall -c 'git reset --hard'

repo forall -c 'git clean -f -d'

repo sync -d -c --no-tags

相关推荐
帅气的你5 分钟前
Spring Boot 集成 AOP 实现日志记录与接口权限校验
java·spring boot
无限进步_23 分钟前
【数据结构&C语言】对称二叉树的递归之美:镜像世界的探索
c语言·开发语言·数据结构·c++·算法·github·visual studio
zhglhy25 分钟前
Spring Data Slice使用指南
java·spring
CSDN_RTKLIB36 分钟前
C++取模与取余
开发语言·c++
win x37 分钟前
Redis 主从复制
java·数据库·redis
摘星编程1 小时前
【RAG+LLM实战指南】如何用检索增强生成破解AI幻觉难题?
android·人工智能
星河耀银海1 小时前
C++开发入门——环境搭建与第一个程序
开发语言·c++·策略模式
weixin_423995001 小时前
unity 处理图片:截图,下载,保存
java·unity·游戏引擎
还不秃顶的计科生1 小时前
defaultdict讲解
开发语言·javascript·ecmascript
帅气的你1 小时前
从零封装一个通用的 API 接口返回类:统一前后端交互格式
java·设计模式