Android SDK常用命令

2022-09-13 21:57:36 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

1. 注意事项

执行source build/envsetup.sh后可以使用很多android集成的shell命令。

2. 代码中定义

打开build/envsetup.sh文件,可以看到:

代码语言:javascript复制
function hmm() { 
   
cat <<EOF Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment: - lunch: lunch <product_name>-<build_variant> - tapas: tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user] - croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm: Builds all of the modules in the current directory, but not their dependencies. - mmm: Builds all of the modules in the supplied directories, but not their dependencies. - mma: Builds all of the modules in the current directory, and their dependencies. - mmma: Builds all of the modules in the supplied directories, and their dependencies. - cgrep: Greps on all local C/C   files. - jgrep: Greps on all local Java files. - mkgrep: Greps on all local *.mk files. - resgrep: Greps on all local res/*.xml files. - godir: Go to the directory containing a file. Look at the source to view more functions. The complete list is: EOF
    T=$(gettop)
    local A
    A=""
    for i in `cat $T/build/envsetup.sh | sed -n "/^function /s/function ([a-z_]*).*/1/p" | sort`; do
      A="$A $i"
    done
    echo $A
}

3. hmm命令

执行source build/envsetup.sh后,终端中输入hmm就可以看到对应的命令解释。 输出如下:

代码语言:javascript复制
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:   lunch <product_name>-<build_variant>
- tapas:   tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user]
- croot:   Changes directory to the top of the tree.
- m:       Makes from the top of the tree.
- mm:      Builds all of the modules in the current directory, but not their dependencies.
- mmm:     Builds all of the modules in the supplied directories, but not their dependencies.
- mma:     Builds all of the modules in the current directory, and their dependencies.
- mmma:    Builds all of the modules in the supplied directories, and their dependencies.
- cgrep:   Greps on all local C/C   files.
- jgrep:   Greps on all local Java files.
- mkgrep:   Greps on all local *.mk files.
- resgrep: Greps on all local res/*.xml files.
- godir:   Go to the directory containing a file.

Look at the source to view more functions. The complete list is:
addcompletions add_lunch_combo cgrep check_product check_variant chidolphin choosecombo chooseproduct choosetype choosevariant ckunpeng compile_env_switch_ cproj croot findmakefile gdbclient gdbwrapper get_abs_build_var getbugreports get_build_var getlastscreenshot getprebuilt getscreenshotpath getsdcardpath gettargetarch gettop gkobimg godir hmm isviewserverstarted jgrep key_back key_home key_menu lunch _lunch m mangrep mkgrep mm mma mmm mmma pez pid printconfig print_lunch_menu qpid resgrep runhat runtest sepgrep set_java_home set_ota setpaths set_sequence_number set_stuff_for_environment settitle smoketest stacks startviewserver stopviewserver systemstack tapas tracedmdump

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162595.html原文链接:https://javaforall.cn

0 人点赞