Temp

cucumber
robitium
bitbar
aapt
monkey

AAPT - Android Asset Packaging Tool

  1. Usage:  
  2.  aapt l[ist] [-v] [-a] file.{zip,jar,apk}  
  3.    List contents of Zip-compatible archive.  
  4.   
  5.  aapt d[ump] WHAT file.{apk} [asset [asset ...]]  
  6.    permissions      Print the permissions from the APK.  
  7.    resources        Print the resource table from the APK.  
  8.    configurations   Print the configurations in the APK.  
  9.    xmltree          Print the compiled xmls in the given assets.  
  10.    xmlstrings       Print the strings of the given compiled xml assets.  
  11.   
  12.  aapt p[ackage] [-f][-u][-m][-v][-x][-M AndroidManifest.xml] \  
  13.         [-I base-package [-I base-package ...]] \  
  14.         [-A asset-source-dir] [-P public-definitions-file] \  
  15.         [-S resource-sources] [-F apk-file] [-J R-file-dir] \  
  16.         [raw-files-dir [raw-files-dir] ...]  
  17.   
  18.    Package the android resources.  It will read assets and resources that are  
  19.    supplied with the -M -A -S or raw-files-dir arguments.  The -J -P -F and -R  
  20.    options control which files are output.  
  21.   
  22.  aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]  
  23.    Delete specified files from Zip-compatible archive.  
  24.   
  25.  aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]  
  26.    Add specified files to Zip-compatible archive.  
  27.   
  28.  aapt v[ersion]  
  29.    Print program version.  
  30.   
  31.  Modifiers:  
  32.    -a  print Android-specific data (resources, manifest) when listing  
  33.    -c  specify which configurations to include.  The default is all  
  34.        configurations.  The value of the parameter should be a comma  
  35.        separated list of configuration values.  Locales should be specified  
  36.        as either a language or language-region pair.  Some examples:  
  37.             en  
  38.             port,en  
  39.             port,land,en_US  
  40.        If you put the special locale, zz_ZZ on the list, it will perform  
  41.        pseudolocalization on the default locale, modifying all of the  
  42.        strings so you can look for strings that missed the  
  43.        internationalization process.  For example:  
  44.             port,land,zz_ZZ  
  45.    -d  one or more device assets to include, separated by commas  
  46.    -f  force overwrite of existing files  
  47.    -j  specify a jar or zip file containing classes to include  
  48.    -m  make package directories under location specified by -J  
  49.    -u  update existing packages (add new, replace older, remove deleted files)  
  50.    -v  verbose output  
  51.    -x  create extending (non-application) resource IDs  
  52.    -z  require localization of resource attributes marked with  
  53.        localization="suggested"  
  54.    -A  additional directory in which to find raw asset files  
  55.    -F  specify the apk file to output  
  56.    -I  add an existing package to base include set  
  57.    -J  specify where to output R.java resource constant definitions  
  58.    -M  specify full path to AndroidManifest.xml to include in zip  
  59.    -P  specify where to output public resource definitions  
  60.    -S  directory in which to find resources  
  61.    -0  don't compress files we're adding

Android instruction and Android Emulator parameter

  • Android模擬器命令列啟動模式
    在android-sdk-windows-1.1\tools執行emulator以執行模擬器
    加上-skin參數,指定顯示模式為HVGA-L,則可轉為橫向
    emulator - skin HVGA-L (480*320,水平顯示)
    emulator - skin HVGA-L (320*480,垂直顯示,模擬器預設模式)
    emulator - skin HVGA-L (320*240,水平顯示)
    emulator - skin HVGA-L (240*320,垂直顯示)


  • 使用mksdcard指令模擬1GB的記憶卡
    mksdcard 1024M sacard.img

  • 模擬插入 SD 卡的模擬器
    emulator - sdcard sdcard.img

  • 使用 adb+push 上載檔案到SD記憶卡
    adb push 001.jpg /sdcard (複製檔案到 /sdcard 目錄下)
    adb push pictures /sdcard (複製 picture 照片目錄到 /sdcard 目錄下)
    adb push mp3 /sdcard (複製 mp3 音樂目錄到 /sdcard 目錄下)
    adb shell (Android 模擬器啟動命令列模式)
    #cd /sdcard (進入 /sdcard 目錄)
    #ls (查看 SD 記憶卡中的檔案) 


  • 使用 adb+pull 從 SD 記憶卡下載檔案
    adb pull /sdcard/001.jpg . (下載 /sdcard 目錄下的檔案)
    adb pull /sdcard/pictures . (下載 sdcard 目錄下的 pictures 目錄)


  • 刪除 SD 卡裡面的檔案
    adb shell
    #ced /sdcard
    #rm 001.jpg (刪除 SD 記憶卡裡的檔案)
    #rm -r * (刪除 SD 記憶卡裡所有檔案與目錄)


  • Android模擬器影片播放方法
    mksdcard 4096M video.img (製作一個影像檔的 SD 記憶卡)
    adb push video.avi /sdcard (從電腦複製影像檔到 SD 卡中)
    emulator -sdcard video.img (啟動模擬器並載入 SD 卡)

    下載免費的影片播放軟體,ex: Meridian Video Player (iiivpa.apk)
    http://sites.google.com/site/eternalsandbox/Home/meridian-video-player
    adb install iiivpa.apk (安裝Meridian Video Player)
    接下來就可以用裝上去的player播放.mp4、3gp與.wmv三種檔案格式

  • 安裝 APK 應用程式
    adb install filename.apk (安裝filename.apk)
    adb install -r filename.apk (保留已設定資料,重新安裝filename.apk)
    adb -s emulator-5554 install filename.apk (指定安裝 APK 套件在 5554 的 Android 模擬器中)


  • 移除 APK 應用程式
    adb uninstall package
    adb uninstall -k package (移除程式時,保留資料)

    此package名稱不是安裝APK套裝時的檔名或顯示在模擬器中的應用程式名稱
    可以先到/data/data或data/app目錄下,查詢想移除的package名稱
    adb shell
    ls /data/data 或 /data/app (查詢 Package 名稱)
    exit
    adb uninstall package (移除查詢到的 Package)


  • ADB 系統除錯與連結工具
    $adb devices (顯示目前有多少個模擬器正在執行) 
    $adb -s (指定模擬器來操作)
    adb -s emulator-5554 install email.apk

    $adb install apkfile (安裝 APK 應用程式套件)
    adb install email.apk
    $adb uninstall package (移除 APK 應用程式套件)
    adb uninstall com.android.email

    $adb shell (進入 Android 系統指令列模式)
    $ls
    $dmesg (查看 Android Linux Kernel 運作訊息)

    ls - 顯示檔案目錄
    cd - 進入目錄
    rm - 刪除檔案
    mv - 移動檔案
    mkdir - 產生目錄
    rmdir - 刪除目錄

    $adb push (複製檔案到 SD 卡)
    adb push mp3 /sdcard
    $adb pull . (從 Android 系統下載檔案)
    adb pull /data/app/com.android.email

    $adb logcat (監控模擬器運作紀錄,以Ctrl + c 離開監控模式)
    $adb bugreport (產生 adb 除錯報告)
    $adb get-state (獲得 adb 伺服器運作狀態)
    $adb start-server (啟動 adb 伺服器)
    $adb kill-server (關掉 adb 伺服器)

    $adb forward tcp:6100 tcp:7100 (更改模擬器網路 TCP 通訊埠)
    $adb shell ps -x (顯示 Android 上所有正在執行的行程)
    $adb version (顯示 adb 版本)
    $adb help (顯示 adb 指令參數)

  • Emulator 命令列啟動參數
    emulator -timezone Asia/Taipei (指定時區)
    emulator -no-boo-anim (省略開機小機器人動畫畫面)
    emulator -scale auto (調整模擬器視窗大小)
    emulator - scale factor (factor: 0.1-3.0)

    emulator -dpi-device 300 (更改模擬器的解析度,default為 165dpi)
    emulator -skin (更改模擬器顯示模式) 
    emulator -help-keys (顯示鍵盤快速鍵說明)
    emulator -shell (相當於adb shell 功能)
    emulator -data data.img (使 /data 目錄使用 data.img 的檔案空間)
    emulator -sdcard sdcard.img (使 /sdcard 目錄使用 sdcard.img 的檔案空間)
    emulator -cache cache.img (瀏覽器暫存檔儲存空間)

    emulator -wipe-data (使模擬器恢復到原廠設定)
    emulator -help (顯示 emulator 指令參數)
  • 大鎖

    被幹走了~~~
    拿走他意義在哪??
    我心愛的大鎖!!!

    使用 cscope + ctags + taglist 來閱讀sourcecode

    ctags + taglist

    1) Install ctags

    $   sudo apt-get install exuberant-ctags

    2)Download and install taglist
    https://sourceforge.net/projects/ctags/files/
    http://vim-taglist.sourceforge.net/

    $   unzip taglist_45.zip
    #it will generate plugin and doc

    $   mv plugin/   ~/.vim
    $   mv doc/   ~/.vim

    3)turn on/off the taglist in vim

    $   sudo vim /etc/vim/vimrc

    Add the following line:

    map <f9> :Tlist<CR>


    4)check the target directory and create the tags

    $   ctags -R *.c *.h

    OR

    $   find 'pwd' -type f -name "*.[ch]" -o -name "*.cc" -o -name "*.[sS]"  | sed -e 's/^/"/' -e 's/$/"/' | xargs /usr/bin/ctags -a

    5)Open the vim and press F9
    #The window will divide by two part, use the Ctrl-W-W to switch the window
    #The left window: Jump to the correspond function or definition
    #The right window:
       Ctrl+]:Jump to function implement position, the cursor should be the function name's front
       Ctrl+t:return to the original position

    cite:http://stenlyho.blogspot.com/2008/11/ubuntuvim-plugin-ctagstaglist.html

    Cscope




    Call Graph
    CCTree: http://www.vim.org/scripts/script.php?script_id=2368