核心层:ccui.sh

文件内容

#!/bin/bash

function Usage() {
  cat <<eof
    eg:bash run.sh
    Usage: bash ccui.sh []

    Exit status:
     0  if OK,
     1  if minor problems  (e.g., cannot access subdirectory),
     2  if serious trouble (e.g., cannot access command-line argument).

eof
  exit 1
}

function linefeed() {
  echo ""
}

function log_d() {
  echo -e "\033[0m$(date +%Y-%m-%d\ %H:%M:%S) $$ D $* \033[0m"
}

function log_i() {
  echo -e "\033[32m$(date +%Y-%m-%d\ %H:%M:%S) $$ I $* \033[0m"
}

function log_w() {
  echo -e "\033[33m$(date +%Y-%m-%d\ %H:%M:%S) $$ W $* \033[0m"
}

function log_e() {
  echo -e "\033[31m$(date +%Y-%m-%d\ %H:%M:%S) $$ E $* \033[0m"
  exit 1
}

function fatal() {
  echo -e "\033[41m$(date +%Y-%m-%d\ %H:%M:%S) $$ F $* \033[0m"
  exit 2
}

function debugEnable() {
  adb shell setprop "ccui.debug.kernel" true
  adb shell setprop "ccui.debug.speech" true
  adb shell setprop "ccui.debug.server" true
  adb shell setprop "ccui.debug.ota" true
  adb shell setprop "ccui.debug.ipc" true
  adb shell setprop "ccui.debug.bus" true
  adb shell setprop "ccui.debug.iot" true
  showDebugFlag
}

function debugDisable() {
  adb shell setprop "ccui.debug.kernel" false
  adb shell setprop "ccui.debug.speech" false
  adb shell setprop "ccui.debug.server" false
  adb shell setprop "ccui.debug.ota" false
  adb shell setprop "ccui.debug.ipc" false
  adb shell setprop "ccui.debug.bus" false
  adb shell setprop "ccui.debug.iot" false
  showDebugFlag
}

function strictModel() {
    adb shell setprop "ccui.strict.core" true
}

function looseModel() {
    adb shell setprop "ccui.strict.core" false
}

function showDebugFlag(){
  adb shell getprop | grep "ccui.debug"
}

function restart() {
  adb shell am startservice -a ccui.intent.action.DAEMON --es action restart
}

function destroy() {
  adb shell am startservice -a ccui.intent.action.DAEMON --es action destroy
}

function launch() {
  adb shell am start -n com.aispeech.ccui.voice/com.aispeech.ccui.MainActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
}

function deploy(){
  ./gradlew :clean
  ./gradlew :deploy -P kernelBuildIndex=7
}

function dumpMeminfo() {
  process_array=$(adb shell "ps -ef | grep 'com.aispeech.ccui.voice' | grep -v 'grep'" | awk '{print $8}' | awk -v RS='' '{gsub("\n"," "); print}')
  for process in $process_array; do
    adb shell "dumpsys meminfo $process"
  done
}

function md2html() {
#  ./gradlew :app_kernel:assembleRelease -PkernelBuildIndex=22 -PBuildUser=CHYR -PBuildEmail='yanrong.chen@aispeech.com' -PgitBranchCommit='abcdefgh' -PgitBranchName='release-xxxx' -PbuildPurpose=show
    echo "$*"
    cp "outputs/V$1.md" "md2html"
    cd "md2html"
    node_modules/.bin/gulp release --path V"$1".md --title CCUI-KERNEL-V"$1"版本总览
    cp "dist/htmlmin/V$1.html" "../outputs/" && rm "dist/htmlmin/V$1.html" &&  rmdir "dist/htmlmin" && rmdir "dist" && rm "V$1.md"
    cd -
}

if [ $# -gt 0 ]; then
  # shellcheck disable=SC2048
  $*
else
  log_i "support function:"
  grep "function" "$0" | awk '{print $2}' | grep -v -E "function|^log|linefeed|fatal|Usage" | awk -F '(' '{print $1}'
fi

ccui.sh文件在哪里被读取的?

ccui.sh文件内容的编程语言是什么?

Bash

#!/bin/bash 什么意思?

用/bin/bash/解释执行

\033是什么?

设置字体颜色,31代表红色

核心层代码学习 文章被收录于专栏

核心层架构梳理、代码学习

全部评论

相关推荐

01-11 02:09
已编辑
华中师范大学 golang
京京洪洪学java:如果坚定转Java就要先做好暑期结果可能没那么好的准备,大厂也有做go的,也有接受内部切换技术栈的,go怎么就不行了呢?,ACM+华师肯定能接到一些大厂面试的,acm铜的基础可以让你比较轻松地应对中大厂的手撕,就是八股和项目要下硬功夫,至于找不到go项目?github上一直刷啊,跟刷b站主页一样,那么多好的go开源项目,怎么会找不到呢?刷到想学感兴趣的用ai吃透,试着改进或者吸收作为自己的项目,另一个选择就是考研了。
点赞 评论 收藏
分享
李橙子:结果虽不够理想,但过程本身已是宝贵的淬炼。能把学习机会放在薪酬之前,证明你目光长远。先踏实进去,用这段时间扎实学好Python后端,把公司项目吃透,你的价值会在下一份工作中完全体现。这个起点,值得。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务