Skip to content

Commit

Permalink
优化性能
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglikai committed Jan 7, 2020
1 parent 3133a09 commit e808412
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 19
targetSdkVersion 28
versionCode 101002
versionName "1.2"
versionName "1.2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/kevin/testool/adblib/CmdTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ public static String _execAdbCmd(final String cmd, final int wait) {
stream.close();
}
} else {
Thread.sleep(Math.abs(wait));
Thread.sleep(100);
return "";
}

// 获取stream所有输出
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/kevin/testool/common/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public static ArrayList<Element> get_elements(Boolean fresh, String key, String
SystemClock.sleep(100);
wait += 100;
}
if (wait > 15000){
if (wait > 60000){
complete = true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/kevin/testool/utils/AdbUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ public void run() {
}

/**
* Root身份执行shell命令,不关注输出结果
*
* 执行shell命令,无root权限需开启adb tcpip 5555
* @param command 待执行的shell命令
* @return 是否成功执行shell命令
* @param timeout timeout == 0 阻塞命令直到执行结束;timeout>0 超时时间,超时后结束进程; timeout< 0 等待timeout绝对值时间,不返回命令结果
* @return shell命令执行结果
*/
public static String runShellCommand(String command, int timeout) {
boolean waitResult = true;
Expand Down

0 comments on commit e808412

Please sign in to comment.