您的位置:首页 > 移动开发 > Android开发

在ubuntu 12.04tls android 开发 nexus s实体机测试 nexus s手机是18d1

2012-08-06 20:13 162 查看
第一步:安装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”;但别忘了在发布前把这句话去掉。。
第三步: 在手机里找到开发者选项并打勾。

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 the
ATTR{idVendor}
property in the rules file, as described above.

CompanyUSB 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: