Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 高級開發 >> Android 開發相關命令集合

Android 開發相關命令集合

編輯:高級開發

壓力測試:$ adb shell monkey -p your.package.name -v 500

  找LOG :adb logcat -b main -b radio -b system -v time >log.txt

  如果要抓Message的話,還要加上adb shell setprop log.tag.Mms:transaction VERBOSE

  在ubuntu下安裝手機驅動

  在 ubuntu 通過usb連接 cci 設備,使用 adb 時,會返回無法找到設備,解決辦法如下:

  1) 在終端運行 lsusb

  會發現結果有會有如下類似記錄:

  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

  Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

  Bus 004 Device 005: ID 1219:0102 #這行就是cci手機

  Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

  Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

  這時鍵入

  sudo gedit /etc/udev/rules.d/53-android.rules

  在打開的文件中增加以下文本:

  SUBSYSTEM=="usb", SYSFS{idVendor}=="1219", MODE="0666"

  SUBSYSTEM=="usb", ATTR{idVendor}=="1219", ATTR{idProduct}=="0102", SYMLINK+="android_adb"

  2) 運行以下命令:

  sudo chmod a+rx /etc/udev/rules.d/53-android.rules

  sudo /etc/init.d/udev restart

  3) 在 android sdk 的 tools 目錄下運行 (這一步很重要,必須要sudo,否則沒效果)

  cd cci-base/

  cd out/host/Linux-x86/bin/

  sudo ./adb kill-server

  sudo ./adb devices

  sudo ./adb remount

  然後,就可以直接用 adb shell來進行操作了。

  1. compile 7015 code use make

  #cd 7015

  #make #wait 3 hours

  2. use the new system.img and userdata.img instead of the sdk's img,backup first

  #mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img /yournamedir/android-sdk-Linux_86/platforms/android-8/images/system.img.old

  #mv /yournamedir/android-sdk-Linux_86/platforms/android-8/images/userdata.img

  /yournamedir/android-sdk-Linux_86/platforms/android-8/images/userdata.img.old

  接上頁

  #ln -s 7015/out/target/product/generic/system.img /yournamedir/android-sdk-Linux_86/platforms/android-8/images/system.img

  #ln -s 7015/out/target/product/generic/userdata.img /yournamedir/android-sdk-Linux_86/platforms/android-8/images/userdata.img

  then create a avd in eclipse, this avd will use the new system.img.

  Start it!

  3. modify aPPS

  Change Contacts for example,change Java files in packages and save.

  #cd 7015

  #mmm packages/aPPS/Contacts #wait sevaral minutes

  #adb remount #after remount the /symstem in emulator will be mounted writable

  use the new generated apk replace the same apk in emulator dir /system/app,you can use adb push command or push file in ddms.

  #adb push out/target/product/generic/system/app/Contacts.apk /system/app

  #adb push out/target/product/generic/data/app/ContactsTests.apk /system/app

  4. modify framework files

  Change frameworks/base/core/res/ for example

  edit String.XML and save

  #mmm frameworks/base/core/res/

  this will generate out/target/product/generic/system/framework/framework-res.apk, then use mkyaffs2image make new system.img

  #out/host/Linux-x86/bin/mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system.img

  restart the emulator, the new system.img will be used.

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved