Linux下Android開發手機裝置不可用問題

2021-06-07 13:51:06 字數 2165 閱讀 4873

原文出處:原文

如果你沒有安裝驅動的話,在eclipse的ddms下看到的是一串的問好,通過命令檢視顯示如下:list of devices attached

????????????    no permissions

我這裡用的系統是debian 6.0.5。

一、首先檢視你的手機是否正常鏈結了電腦:在linux下通過lsusb命令檢視,結果如下:

bus 008 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 007 device 002: id 093a:2510 pixart imaging, inc. optical mouse

bus 007 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 006 device 002: id 1c4f:0002 sigma micro 

bus 006 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 005 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 004 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 003 device 005: id 413c:8160 dell computer corp. wireless 365 bluetooth

bus 003 device 004: id 413c:8162 dell computer corp. integrated touchpad [synaptics]

bus 003 device 003: id 413c:8161 dell computer corp. integrated keyboard

bus 003 device 002: id 0a5c:4500 broadcom corp. bcm2046b1 usb 2.0 hub (part of bcm2046 bluetooth)

bus 003 device 001: id 1d6b:0001 linux foundation 1.1 root hub

bus 002 device 006: id 04e8:685e samsung electronics co., ltd 

bus 002 device 001: id 1d6b:0002 linux foundation 2.0 root hub

bus 001 device 004: id 05ca:180a ricoh co., ltd 

bus 001 device 003: id 0bda:0158 realtek semiconductor corp. usb 2.0 multicard reader

bus 001 device 001: id 1d6b:0002 linux foundation 2.0 root hub

紅色的行是我的手機的。其中,id  04e8是代表samsung的手機。

二、目錄切換到/etc/udev/rules.d/下建立乙個叫50-android.rules的檔案,(50:手機,70:光碟機,好像是)。輸入命令sudo vi /etc/udev/rules.d/50-android.rules。檔案的內容如下:subsystem==」usb」, attr==」04e8″, mode=」0666″ 然後儲存

三、然後重啟udev服務,輸入命令:sudo /etc/init.d/udev restart 

四、為了確保無誤,請在此先開啟eclipse,這個eclipse android開發環境已經搭建好了的。

五、切換到android sdk的platform-tools目錄下

(1)關閉adb服務,輸入命令:sudo ./adb kill-server

(2)再開啟adb服務,輸入命令: sudo ./adb start-server

(3) 檢視當前adb手機鏈結情況,輸入命令:sudo ./adb devices  ,顯示的結果如下

root@pc:/home/tobacco/android/android-sdk-linux/platform-tools# ./adb devices

list of devices attached 

1b6c0002fffc0000device

Linux 系統下Android開發 獲取原始碼

在ubuntu下獲取google原始碼很簡單,只需採用以下命令 sudo apt get install git core 如果是centos 我的系統為centos 5.5 則按以下步驟進行 tar xzvf git latest.tar.gz cd git 2011 04 30 autoconf...

Linux 下開發Android專案 手機驅動問題

習慣用linux在開發的人還是慢慢的增多,尤其在出現了ubuntu和fedora之後。對於linux初學者來說解決驅動問題,還算比較難的。我也是乙個linux初學者,但經過我的部門經理的詳細介紹,也經過我的反覆折騰下終於把這件事弄成了。今天分享給大家。推薦閱讀 ubuntu android ndk配...

ubuntu下android開發如何識別真實手機

在連線真實裝置進行測試時就需要做以下設定 1 把手機裝置為usb除錯模式並和電腦連線 2 開啟終端執行 lsusb 這時就會顯示你連線裝置的名稱及型號 3 然後在終端執行 sudo gedit etc udev rules.d android.rules 其中android.rules是檔名稱可自定...