android伺服器端源碼
㈠ 怎樣著手研究 Android 源代碼
一、源碼里的工程需要導入所有的Android源碼,不可以單獨作為一個Android工程導入到Eclipse里。
二、使用git和repo下載Android的源代碼,參考如下步驟
以下操作都是在Ubuntu10.04LTS下完成:
1)安裝git
sudo apt-get install git-core
2)安裝curl
sudo apt-get install git-core curl
3)安裝Repo,為了方便直接下載repo到用戶根目錄中。通過curl下載repo
curl http://android.git.kernel.org/repo >~/repo
4)給repo可執行的許可權
chmod a+x ~/repo
5)新建一個目錄,然後進入該目錄。通過repo將當前Android上所有源代碼下載。
首先初始化本地,
~/repo init -u git://android.git.kernel.org/platform/manifest.git
看到repo initialized in /android的提示後,則證明初始化完畢。成功後會在~/android下生成.repo文件夾
執行
repo sync
則自動開始下載源代碼。git支持斷點續傳,如果中斷了下次可繼續。
單獨下載內核,用這個
git clone git://android.git.kernel.org/kernel/linux-2.6.git
如果想拿某個branch而不是主線上的代碼,我們需要用-b參數制定branch名字,比如:
repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
另一種情況是,我們只需要某一個project的代碼,比如kernel/common,就不需要repo了,直接用Git即可。
git clone git://android.git.kernel.org/kernel/common.git
㈡ 如何編輯android 系統源碼
1、通過 ubuntu 軟體中心安裝 wine;
2、通過 ubuntu 軟體中心安裝 winetricks;
3、通過 winetricks 在 shell中輸入: winetricks mfc42
1、通過 wine windows 的方式啟動代理伺服器
2、設置瀏覽器代理伺服器
3、設置shell代理伺服器:
在shell中輸入 sudo gedit /etc/bash.bashrc
在文件 /etc/bash.bashrc 中添加
通過shell安裝如下的組件:
1、sudo apt-get install bison g++-multilib git gperf libxml2-utils
2、新建一個存放源碼的目錄,如:mkdir ~/andorid/source
3、在源碼目錄中輸入命令:repo init -u -b android-4.0.1_r1
其中: android-4.0.1_r1是android源碼的版本,更多的版本可以通過下面的方式查詢:
4、修改source/.repo/manifest/default.xml 文件中的 fetch 的值為:
git://Android.git.linaro.org/
通過如下的指令來設置郵箱和用戶名
git config --global user.name "<your name>" ----修改用戶名git config --global user.email "<your email>" ----修改email
5、在source目錄下輸入指令:repo sync
便開始了代碼的下載
方便他人亦是方便自己,如果覺得還行就點下下邊的投票吧,這樣可以幫助其他人更快的找到解決問題的方法;有疑問的也可留言哦, 謝謝!