在ubuntu 12.04tls android 開發 nexus s實體機測試 nexus s手機是18d1

來源:互聯網
上載者:User

第一步:安裝eclipse  ;配置jdk;配置sdk路徑。安裝adt。。(這些都是android開發的前提。相信你已經做好)

第二步:

Declare your application as "debuggable" in your Android Manifest.

When using Eclipse, you can skip this step, because running your app directly fromthe Eclipse IDE automatically enables debugging.

In the AndroidManifest.xml file, add android:debuggable="true" tothe<application> element.

相信你能看懂。。就是在manifest檔案裡加入debuggable=“ture”;但別忘了在發布前把這句話去掉。。

第三步: 在手機裡找到開發人員選項並打勾。

  1. Turn on "USB Debugging" on your device.

    On the device, go to Settings > Applications > Development and enableUSB debugging (on an Android 4.0 device, the setting is located inSettings > Developer options).

第四步:建立檔案51.android.rules檔案。並作修改

Log in as root and create this file: /etc/udev/rules.d/51-android.rules. Use this format to add each vendor to the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

{idVendor}是生產手機的公司。我的是nexus s ,屬於三星和google配出來的,三星是公,google是母的。 但是!!!生出的孩子是姓google的。。所以裝置號是18d1。

USB Vendor IDs

This table provides a reference to the vendor IDs needed in order to add USBdevice support on Linux. The USB Vendor ID is the value given to theATTR{idVendor} property in the rules file, as described above.

Company USB Vendor ID
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Fujitsu 04c5
Fujitsu Toshiba 04c5
Garmin-Asus 091e
Google 18d1
Hisense 109b
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenovo 17ef
LG 1004
Motorola 22b8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10a9
Pegatron 1d4d
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony 054c
Sony Ericsson 0fce
Teleepoch 2340
Toshiba 0930
ZTE 19d2
第五步:加許可權 sudo chmod a+rx /etc/udev/rules.d/51-android.rules

第六步:

開啟eclipse,在eclipse中,選擇window -> show view -> other...->device然後插上手機就可以識別了。然後右鍵你的工程選擇run as-> android application.這樣你的eclipse裡的android程式就可以在手機裡測試了。快去試試吧。

本文參照:開發人員聯盟 http://developer.android.com/tools/device.html#VendorIds

--

Persist in the end and

never give up

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.