<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Calvin's Tech Space

    成于堅(jiān)忍,毀于浮躁

       :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
    Building, running, and debugging Android source


    There is a lot of confusion surrounding the work flow in the Android source tree, so allow me to simplify:

    1. Follow the initial instructions for downloading the source at:

      http://source.android.com/download

    2. Set up your environment to build the engineering build for the generic device and generic product. This is similar to the SDK, but with a few pieces missing.

      $ source build/envsetup.sh
      $ lunch 1
    3. To build for the first time:

      $ make

      If you have a multi-core system, you can build with make -jN where N is twice the number of cores on your machine. This should speed up the first build considerably.

    4. To launch the emulator from your build:

      $ ./out/host/<your-machine-type>/bin/emulator

      On my system <your-machine-type> is linux-x86.

      NOTE: The emulator knows where to find system and data images as a result of running lunch 1 above. This sets the environment variable ANDROID_PRODUCT_OUT to point to the target directory. For this example, it should be out/target/product/generic/.

    5. If you wish to make changes to the source code, there are handy utilities that have been exposed to your environment by source build/envsetup.sh above. For example, if you modify the Email app and just want to rebuild it:

      $ mmm packages/apps/Email

    6. To see your changes in the emulator you can run:

      $ adb remount
      $ adb sync

      Which will copy the regenerated Email.apk file into the emulator’s /system/app folder, triggering the PackageManager to automatically reinstall it.

    7. Or if you change framework resources in frameworks/base/core/res/res/ you could regenerate framework-res.apk with:

      $ mmm frameworks/base/core/res

      Or if you modified even the framework itself you could run:

      $ ONE_SHOT_MAKEFILE="frameworks/base/Android.mk" make framework

      This is a special variation of mmm which is used to build frameworks/base/core/java.

      To sync these changes you must restart the running framework and sync, as with this handy sequence:

      $ adb remount
      $ adb shell stop
      $ adb sync
      $ adb shell start

    8. Finally, to debug your changes you can use the DDMS tool to select a process for debug and then attach Eclipse to it. If you have the Eclipse Android Development plugin installed, there is a special DDMS perspective which you can use to choose the process for debug. To attach Eclipse to it, see these instructions:

      http://source.android.com/using-eclipse

      This document also describes how to use Eclipse for development. Any IDE should work with the proper finagling though. Just note that the IDE won’t really by an integrated environment, the final output of APKs, system.img, and even the generation of R.java files will have to be done by make!

      A note about the processes in Android:

      • system_process houses all things under frameworks/base/services. This includes the PackageManagerService, StatusBarService, etc. It has many, many threads (one for each service, and then one main UI thread), so be wary when debugging.
      • com.android.acore hosts Launcher (home), Contacts, etc. You can determine the apps/providers that run here by looking forandroid:process="android.process.acore" in the various AndroidManifest.xml files in packages/.

      Also remember that the “framework” (under frameworks/base/core/java) is not hosted by any one process. It is a library used by most processes, so to debug code there you can usually use a simple demo app that takes advantage of whatever you changed and debug that app’s process. A useful trick for setting up your debug connection is to callDebug.waitForDebugger() during some startup part of an application or system service.

     原文地址 http://planetandroid.vitaeblog.com/?p=749
    posted on 2010-10-17 14:05 calvin 閱讀(301) 評(píng)論(0)  編輯  收藏 所屬分類: Android
    主站蜘蛛池模板: 国产一精品一aⅴ一免费| 亚洲视频免费在线播放| 亚洲综合色自拍一区| 免费看男人j放进女人j免费看| 91精品国产亚洲爽啪在线影院| 欧洲精品成人免费视频在线观看 | 精品国产精品久久一区免费式| 免费看美女午夜大片| 亚洲视频在线观看一区| 免费高清资源黄网站在线观看| 中文字幕手机在线免费看电影| 亚洲人成777在线播放| 亚洲一级黄色视频| 成人AV免费网址在线观看| 一区二区在线视频免费观看| 亚洲性一级理论片在线观看| 亚洲成A人片在线观看无码3D| 午夜视频免费在线观看| 国产精品亚洲综合一区在线观看| 久久亚洲一区二区| 免费国产在线观看| 亚洲毛片免费视频| 在线观看免费黄网站| 亚洲国产精品无码久久九九大片 | 香蕉免费一区二区三区| 亚洲av午夜电影在线观看| 久久亚洲中文字幕精品有坂深雪 | 全黄大全大色全免费大片| 亚洲娇小性色xxxx| 亚洲伊人久久综合影院| 免费不卡视频一卡二卡| 国产精品美女久久久免费| 国产亚洲人成网站在线观看| 成人免费一级毛片在线播放视频| 又黄又大的激情视频在线观看免费视频社区在线 | 亚洲人成高清在线播放| 四虎影库久免费视频| 麻花传媒剧在线mv免费观看| 四虎成人精品国产永久免费无码| 亚洲另类小说图片| 国产一级特黄高清免费大片|