android aosp编译的一些辅助命令


lunch对应的查询命令

每次执行完lunch后下次进入基本就忘记上次编译的参数设置,可以使用printconfig命令显示当前的设置

timfeng@14:42:20:~/android-src $printconfig
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-37-generic-x86_64-with-LinuxMint-17.1-rebecca
HOST_CROSS_OS=windows
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
OUT_DIR=out
============================================

查看 envsetup.sh引入的函数

Function names and definitions may be listed with the -f option to the declare builtin command (see Bash Builtins). The -F option to declare will list the function names only (and optionally the source file and line number).

timfeng@14:39:49:~/android-src $declare -F
declare -f __all_modules
declare -f __cards
declare -f __expand_tilde_by_ref
declare -f __get_cword_at_cursor_by_ref
declare -f __git_aliased_command
declare -f __git_aliases
declare -f __git_commands
declare -f __git_complete
declare -f __git_complete_file
declare -f __git_complete_index_file
declare -f __git_complete_remote_or_refspec
declare -f __git_complete_revlist
declare -f __git_complete_revlist_file
declare -f __git_complete_strategy
declare -f __git_compute_all_commands
declare -f __git_compute_merge_strategies
declare -f __git_compute_porcelain_commands

查看函数具体的内容type

timfeng@14:42:42:~/android-src $type lunch
lunch is a function
lunch () 
{ 
    local answer;
    if [ "$1" ]; then
        answer=$1;
    else
        print_lunch_menu;
        echo -n "Which would you like? [aosp_arm-eng] ";
        read answer;
    fi;
    local selection=;
    if [ -z "$answer" ]; then
        selection=aosp_arm-eng;
    else
        if ( echo -n $answer | grep --color --exclude-dir=".svn" --exclude-dir .git -q -e "^[0-9][0-9]*$" ); then
            if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]; then
                selection=${LUNCH_MENU_CHOICES[$(($answer-1))]};
            fi;
        else
            if ( echo -n $answer | grep --color --exclude-dir=".svn" --exclude-dir .git -q -e "^[^\-][^\-]*-[^\-][^\-]*$" ); then
                selection=$answer;
            fi;
        fi;
    fi;
    if [ -z "$selection" ]; then


Copyright © FengGuangtu 2017