<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                #### **概述** Android源代碼開發環境與SDK開發環境相比,優勢是可以查看和調試系統源代碼,包括Java代碼和C/C++代碼。這對應用開發也是非常有用的,因為在開發中碰到疑難雜癥時可以跟蹤到系統內部去定位問題。對于涉及到C/C++代碼的開發,例如JNI開發和安全相關開發,更加建議在Android源代碼開發環境進行,這樣就可以利用gdb以及gdbclient工具進行調試。 主要講Android源代碼下載、編譯和運行,以及C/C++、Java代碼的調試。 * 開發機器配置 * Android源碼下載、編譯和運行 * Linux內核源碼下載、編譯和運行 * Java代碼開發和調試 * C/C++代碼開發和調試 #### **開發機器配置** **硬件** * CPU I5及以上 * 內存16GB及以上 * 硬盤40GB及以上 **軟件** * Ubuntu 10.04 64bit * Java SDK 1.6 * 其它Package * http://source.android.com/source/initializing.html #### **Android源碼下載** * $ mkdir ~/bin $ PATH=~/bin:$PATH * $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo * $ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY * $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.2_r1 * $ repo sync * http://source.android.com/source/downloading.html #### **Android源碼編譯和運行** * $ . build/envsetup.sh * $ lunch full-eng * $ make –j8 * $ emulator & * http://source.android.com/source/building-running.html #### **Linux內核源碼下載、編譯和運行** * $ git clone https://android.googlesource.com/kernel/goldfish.git * $ cd goldfish * $ git branch –a remotes/origin/android-goldfish-3.4 * $ git checkout remotes/origin/android-goldfish-3.4 * $ export PATH=$(AOSP)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH * $ export ARCH=arm * $ export SUBARCH=arm * $ export CROSS_COMPILE=arm-eabi- * $ make goldfish_armv7_defconfig * $ make * $ emulator –kernel kernel/goldfish/arch/arm/boot/zImage & * http://source.android.com/source/building-kernels.html #### **Java代碼開發和調試** * 安裝Eclipse $ sudo?apt-get?install?eclipse? * 拷貝.classpath文件 * $ cd /path/to/android/root * $ cp development/ide/eclipse/.classpath . * $ chmod u+w .classpath * 修改Eclipse內存配置 * 打開/usr/lib/eclipse/eclipse.ini * 將-Xms和-Xmx均設置為2048m * 導入Android源碼到Eclipse * File > New > Java Project * Pick a project name, "android" or anything you like. * Select "Create project from existing source", enter the path to your Android root directory, and click Finish. * 新增App工程到Android源碼工程 * Project > Properties * Select "Java Build Path" from the left-hand menu. * Choose the "Source" tab. * Click "Add Folder..." * Add your app's?src?directory. * Click OK. **使用Eclipse調試Java源碼** **啟動emulator** * $ cd /path/to/android/root * $ . build/envsetup.sh * $ lunch 1 * $ emulator & **打開ddms** * $ ddms * Select a process **打開eclipse** * Run > Debug Configuration... * Right-click "Remote Java Application", select "New". * Pick a name, i.e. "android-debug" or anything you like. * Set the "Project" to your project name. * Keep the Host set to "localhost", but change Port to 8700. * Click the "Debug" button and you should be all set. http://source.android.com/source/using-eclipse.html #### **C/C++代碼開發和調試** **安裝Vim** sudo apt-get install vim **啟動Emulato**r * $ cd /path/to/android/root * $ . build/envsetup.sh * $ lunch 1 * $ emulator & * $ adb shell **在adb shell中啟動gdbserver** `root@android:/ gdbserver :5039 --attach <pid>` **在另外一個終端啟動gdbclient** * $ cd /path/to/android/root * $ . build/envsetup.sh * $ lunch 1 * $ adb forward tcp:5039 tcp:5039 * $gdbclient * https://github.com/keesj/gomo/wiki/AndroidGdbDebugging
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看