顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

星期六, 2月 05, 2011

[Android] 在 Ubuntu 上用 LG P500 實機開發除錯

本文參考 Android Development with VirtualBox and the LG P500 phone

這邊簡單翻譯並紀錄一下自己的心得

#設定USB驅動為0666(允許使用者 讀/寫/存取)
$ sudo gedit /etc/udev/rules.d/51-android.rules

#加入以下這句 (原本裡面應該是空白的)
#若是其他廠牌的手機,則依廠牌代碼修改 ATTR{idVendor}
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"

#改變檔案權限
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
$ sudo udevadm control --reload-rules

#接著用USB連接電腦與手機,並試試 lsusb
$ lsusb

#會列出usb連接的設備,理論上其中會出現類似以下的東西
Bus 002 Device 004: ID 1004:618e LG Electronics, Inc.

#這時用 adb devices 檢視
#若沒有 adb 這個命令的話,請將 android-sdk 內的 platform-tools 加入環境變數
$ adb devices

#如果出現以下訊息,表示前面的設定USB驅動設定有誤
List of devices attached
???????????? no permissions

#正確的話應該會出現
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
80A354043041595986 device

#設定手機
在手機中選 設定->應用程式->開發
把 USB偵錯、保持清醒、允許模擬位置勾起來

#設定Eclipse
Debug->Debug Configuratioins->Target 選擇 Manual

OK! 大功告成
現在Debug的時候就可以選手機啦~

星期二, 1月 25, 2011

無線網路無驅動

系統 -> 管理 -> 額外的驅動程式 安裝驅動即可
紀錄一下

星期日, 1月 23, 2011

wubi 下改變 swap



1
2
3
4
5
6
7
cd /host/ubuntu/disks/
sudo swapoff swap.disk
sudo rm swap.disk
sudo dd if=/dev/zero of=swap.disk bs=1M count=2100 (2G)
sudo mkswap -f swap.disk
sudo swapon /host/ubuntu/disks/swap.disk

dd - convert and copy a file
選項與參數:
if :input file
of :output file
bs :一個 block 的大小
count:多少個 bs


參考:
http://forum.ubuntu.org.cn/viewtopic.php?f=159&t=289431&p=2042190
http://linux.vbird.org/linux_basic/0240tarcompress.php#dd

星期六, 2月 27, 2010

為甚麼不能用su? - Ubuntu 9.10 的root權限

剛用VirtualBox灌完Ubuntu ,要安裝一點更新,結果竟然發現不能用su
找到一些資料,隨手做個筆記。

Ubuntu安裝後,root用戶默認是被鎖定了的,不允許登錄,也不允許「su」到root。有人說這是個不好的實踐,特別是對於服務器來說。我覺得對於桌面用戶來說,這樣安全性更高一些,是應該的;但對於服務器可以設置成「允許su 到root,但不允許root用戶直接登錄」。