envsetup命令解析

2023-01-18 20:06:04 字數 3993 閱讀 3872

每次進入到android source目錄後的第一件事恐怕就是先執行. build/完成一些命令的初始化,今天主要分析

function help顯示幫助資訊

function get_abs_build_var獲取絕對變數

function get_build_var獲取絕對變數

function check_product檢查product

function check_variant檢查變數

function setpaths設定檔案路徑

function printconfig列印配置

function set_stuff_for_environment設定環境變數

function set_sequence_number設定序號

function settitle設定標題

function choosetype設定type

function chooseproduct設定product

function choosevariant設定variant

function tapas功能同choosecombo

function choosecombo設定編譯引數

function add_lunch_combo新增lunch專案

function print_lunch_menu列印lunch列表

function lunch配置lunch

function mmake from top

function findmakefile查詢makefile

function mmmake from current directory

function mmmmake the supplied directories

function croot回到根目錄

function cproj()

function pid()

function systemstack()

function gdbclient()

function jgrep查詢j**a檔案

function cgrep查詢c/cpp檔案

function resgrep()

function tracedmdump()

function runhat()

function getbugreports()

function startviewserver()

function stopviewserver()

function isviewserverstarted()

function smoketest()

function runtest()

function godir跳到指定目錄

# add the default one here

add_lunch_combo generic-eng

# execute the contents of any files we can find.

for f in `/bin/ls vendor/*/ vendor/*/build/ 2> /dev/null`

do echo "including $f"

. $f

done

已經有人分析過了,直接搬過來:

下面是詳細解釋,好多都沒有用到過,看來我的確是個菜鳥

(1). build/

build/提供了幾個有用的shell命令,使用

$. build/

可以引入到shell環境中。下面整理並簡述。特別,還同時會引入vendor/和device /目錄下的指令碼。

help

顯示幫助,列出提供的命令

get_abs_build_var

列出make指令碼中某變數的值,字首上當前路徑。ref

使用方法:

get_abs_build_var var_name

var_name是需要顯示的make指令碼中的變數。

例如: get_abs_build_var target_product

返回 \

get_build_var

列出make指令碼中某變數的值。ref

usage:

get_build_var var_name

var_name是需要顯示的make指令碼中的變數。

return:

example:

get_abs_build_var target_product

check_product

檢查指定的target_product是否允許,預設的有sim和generic。如果不允許,則輸出錯誤資訊,允許則無回顯。

usage:

check_product

example:

check_product generic

check_variant

檢查variant是否支援,支援則返回0,不支援則返回1。允許的variant列表定義在中的variant_choices中,預設是user,userdebug,eng。定製android時,可以在variant_choices中新增vairant。

usage:

check_variant

example:

check_variant eng

setpaths

奇次執行時,將android_build_paths路徑加到path中。偶次執行時,將android_build_paths路徑從path中去除。android_build_paths包括android編譯中要使用到的路徑,例如android_eabi_toolchain,android_toolchain,android_qtools,android_j**a_toolchain,android_product_out等等。

usage:

setpaths

printconfig

輸出類似如下形勢的配置資訊。

platform_version_codename=aosp

platform_version=aosp

target_product=generic

target_build_variant=eng

target_simulator=

target_build_type=release

target_build_apps=

target_arch=arm

host_arch=x86

host_os=linux

host_build_type=release

build_id=openmaster

set_stuff_for_environment

依次呼叫settitle, set_j**a_home,setpaths,set_sequence_number。設定android編譯需要的環境變數。

set_sequence_number

輸出環境變數build_env_sequence_number。

settitle

設定shell的prompt提示,prompt_command中加入target_product,target_build_variant,和target_build_apps等資訊提示。

choosesim

配置環境變數target_simulator。linux下會提示使用者選擇device或simulator。然後呼叫set_stuff_for_environment設定。

choosetype

配置環境變數target_build_type_simulator。會提示使用者選擇release或debug。然後呼叫set_stuff_for_environment設定。

chooseproduct

配置環境變數target_product。會提示使用者選擇release或debug。然後呼叫set_stuff_for_environment設定。

choosevariant

配置環境變數target_build_variant。會提示使用者選擇release或debug。

關於Linux系統中關機命令詳細解析

發布時間 2006.09.01 03 14 賽迪網技術社群作者 mary 在linux下一些常用的關機 重啟命令有shutdown halt reboot 及init,它們都可以達到重啟系統的目的,但每個命令的內部工作過程是不同的,通過本文的介紹,希望你可以更加靈活的運用各種關機命令。shutdow...

linux命令學習之網路命令和監控命令

面列出來的10個基礎的每個linux使用者都應該知道的網路和監控命令,大家參考使用吧 網路和監控命令類似於這些 hostname,ping,ifconfig,iwconfig,netstat,nslookup,traceroute,finger,telnet,ethtool 用於檢視linux伺服器...

Linux命令學習總結 flie命令

conjunction with m to debug a new magic file before installing it f,files from file read the filenames to be examined from file f,separator string use...