1 functionhmm () {2 # Print Help information3 Cat<<EOF4Invoke". build/envsetup.sh"From your shell to add the following functions to your environment:5-Lunch:lunch <product_name>-<build_variant>6-Tapas:tapas [<app1> <App2> ...] [ARM|X86|MIPS|ARMV5|ARM64|X86_64|MIPS64] [Eng|userdebug|User]7-croot:changes directory to the top of the tree.8-M:makes from the top of the tree.9-Mm:builds all of the modulesinchThe current directory is not their dependencies.Ten-Mmm:builds all of the modulesinchthe supplied directories, but not their dependencies. OneTo limit the modules being built use the SYNTAX:MMMdir/: Target1,target2. A-Mma:builds all of the modulesinchthe current directory, and their dependencies. --Mmma:builds all of the modulesinchthe supplied directories, and their dependencies. --Cgrep:greps on all local C + +files. the-ggrep:greps on all local Gradle files. --jgrep:greps on all local Java files. --Resgrep:greps on all local res/*. xml files. - -Sgrep:greps on all local source files. + -Godir:go to the directory containing a file. - + Look at the source to view more functions. The complete list is: A EOF at # GetTop is an in-script function that returns the top-level path of the current Android code tree. If the current path is in the Android code tree - t=$ (gettop) - # A variable local quantization - Local A - a= "" - # View envsetup.sh content, and start the line at the beginning of space, tab any time, replace function as a matching substring (function name), by word Fu ascending, remove duplicates in For i in ' Cat $T/build/envsetup.sh | sed-n "/^[\t]*function/s/function \ ([a-z_]*\).*/\1/P"| sort | uniq '; do - # The replaced function name is appended after a and printed toA="$A $i" + Done - Echo$A the}
envsetup.sh How to use:
[Email protected]:/work/android-5.0.2$ source Build/envsetup.SHincluding device/asus/deb/vendorsetup.SHincluding device/asus/fugu/vendorsetup.SHincluding device/asus/tilapia/vendorsetup.SHincluding device/asus/flo/vendorsetup.SHincluding device/asus/grouper/vendorsetup.SHincluding device/samsung/manta/vendorsetup.SHincluding device/friendly-arm/tiny4412/vendorsetup.SHincluding device/lge/mako/vendorsetup.SHincluding device/lge/hammerhead/vendorsetup.SHincluding device/moto/shamu/vendorsetup.SHincluding device/generic/mini-emulator-mips/vendorsetup.SHincluding device/generic/mini-emulator-armv7-a-neon/vendorsetup.SHincluding device/generic/mini-emulator-arm64/vendorsetup.SHincluding device/generic/mini-emulator-x86/vendorsetup.SHincluding device/generic/mini-emulator-x86_64/vendorsetup.SHincluding SDK/bash_completion/Adb.bash[email protected]-virtual-machine:/work/android-5.0.2$ get_abs_build_var target_product/work/android-5.0.2/full
envsetup.sh parsing