效率 :tools:Android tapas, croot, m, mm, mmm, mma...cgrep, ggrep, jgrep, godir

今天看到身邊的同事在使用croot命令,可以直接跳轉到Android根目錄,遂產生了好奇,這可是我實際開發中的一個痛點啊,還是孤陋寡聞了。趕緊的,研究研究~

在Android源碼根目錄執行完 source build/envsetup.sh 命令後,在當前目錄在執行hmm命令可查看到該source命令新增的一系列命令工具,這些工具可以大大提高我們在Android代碼上的開發效率,還發現Android高版本比低版本新增了些命令,看來Android也一直爲工程師的開發效率操心那,強烈推薦~

calm.xia@shand09[17:53:11]:~/10_automotive$ hmm

Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:      lunch <product_name>-<build_variant>
              Selects <product_name> as the product to build, and <build_variant> as the variant to
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- 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.
              To limit the modules being built use the syntax: mmm dir/:target1,target2.
- 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.
- umake:     Call ninja directly to speed up build when there is no modifications to .mk or .bp files.
- provision:  Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:      Greps on all local C/C++ files.
- ggrep:      Greps on all local Gradle files.
- jgrep:      Greps on all local Java files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
- mgrep:      Greps on all local Makefiles files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
- gomod:      Go to the directory containing a module.
- pathmod:    Get the directory containing a module.
- refreshmod: Refresh list of modules for allmod/gomod.

Environment options:
- SANITIZE_HOST: Set to 'true' to use ASAN for all host modules. Note that
                 ASAN_OPTIONS=detect_leaks=0 will be set by default until the
                 build is leak-check clean.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
addcompletions add_lunch_combo allmod build_analysis build_build_var_cache build_tool_and_sign_images cgrep check_product check_type check_variant check_version choosecombo chooseproduct choosetype choosevariant chooseversion _complete_android_module_names core coredump_enable coredump_setup cproj cp_sign croot _croot destroy_build_var_cache enable_zsh_completion findmakefile get_abs_build_var get_all_build_vars getbugreports get_build_var getlastscreenshot get_make_command getprebuilt getscreenshotpath getsdcardpath gettargetarch gettop ggrep godir gomod hmm is isviewserverstarted jgrep key_back key_home key_menu lunch _lunch m make makeota makepac mangrep mgrep mm mma mmm mmma pathmod pez printconfig print_lunch_menu provision qpid rcgrep refreshmod resgrep runhat runtest sepgrep setpaths set_sequence_number set_stuff_for_environment sgrep should_add_completion smoketest source_vendorsetup startviewserver stopviewserver systemstack tapas tracedmdump treegrep umake validate_current_shell _wrap_build

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章