5. 其他
- Android 預設可編譯成三種模式: eng, userdebug, user。一般使用者拿到的機器多是 user 版,當然如果是開發人員,可能會使用 eng 或 userdebug 版 進行debug。或是使用者自行 root 機器後,可使用下列指令取得 root 權限
adb root
- 一般為了防止系統出問題,所以 /system 通常在掛載時會設定為唯讀(read only),當使用者有root權限時,可使用下面指令將系統重新掛載成 R/W 模式,可對 /system 內的檔案做修改
adb remount
- 如果在使用 adb 時發現有* daemon not running. starting it now *的提示可以結束adb
adb kill-server
- 顯示 android 機器連接狀況
adb devices
結果如下
List of devices attached
1234567890ABCDEF device
- 等待正在運行的設備
adb wait-for-device
- Port forwarding,在某些應用如模擬器的網路連接使用、VNC時,會用到這項功能。主要是用來將機器上的的TCP port 5555 轉發到 port 1234
adb forward tcp:5555 tcp:1234
- 擷取系統內的各種資訊,產生 bug report
adb bugreport
Android - How to mount the SDCard image file to Android Emulator
(1)首先必須產生SDCard的image file
mksdcard: create a blank FAT32 image to be used with the Android emulator
usage: mksdcard [-l label]
if is a simple integer, it specifies a size in bytes
if is an integer followed by 'K', it specifies a size in KiB
if is an integer followed by 'M', it specifies a size in MiB
ex:mksdcard 1024M sdcard.iso
(2)讓SDCard連到Android Emulator
a:./emulator -sdcard ~/.android/SDK-1.0/sdcard.iso
b:用Eclipse中設定程式的Open Run Dialog裏,Target頁籤的Aditional Emulator Command Line Option中加入啟動參數 -sdcard scard.iso