This text will guide you how to set up a link with a real Android cell by adb.

You can install an unsigned *.apk to your real device or debug from your PC IDE with your real device.

This text has been proved by Ubuntu 9.10 (Karmic Koala) and Eclipse3.5.

Step 1, Build connection between Ubuntu and Device

1. Turn on "USB Debugging" on your device.
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.

2. Add a rule file on your Ubuntu Linux
Login as root and create this file: /etc/udev/rules.d/51-android.rules.
edit the file to read:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

The text below provide a reference to the vendor IDs(because my cell is HTC G1 so I choose "0bb4"
Acer 0502
HTC 0bb4
Huawei 12d1
LG 1004
Motorola Motorola
Samsung 04e8
Sony Ericsson 0fce

3. execute comands as follow:
$ adb kill-server
$ sudo adb start-server
$ adb devices

there will be a device name list like this:
"
List of devices attached
HT850GZ65731 device
"

If you encounter some trouble like "permission deny" or "device(HT850GZ65731) offline"
try to execute commands as follow:
$ sudo /etc/init.d/udev restart
$ sudo service udev restart
then input command
$ adb devices
to check whether you have build a link with device, if it still does not work, restart your system is the
last recommendation I might suggest.

Step 2 install your apk file to a device

change directory to your project directory/bin, there is a apk file that Eclipse has built for you.
execute command :
$ adb install abc(your app).apk
for instance:
$ adb install TrafficMap.apk
you will be list some information like this:
110 KB/s (318547 bytes in 2.809s)
pkg: /data/local/tmp/TrafficMap.apk
Success

Step 3 debug your program on your device
Declare your application as "debuggable" in your Android Manifest.
In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml file, add android:debuggable="true" to the <application> element.

That's all. Enjoy your ubuntu, enjoy your android, and welcome to android andventure.

Summrized by Benjamin Qi
Intern of Beijing PalmCity Science and Technology Co., Ltd
MSN: benjaminqi@hotmail.com
2009/12/15 night

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android中style的使用
  2. Android启动流程分析(二) init进程的启动
  3. android EditText 全面阐述
  4. Android HTTP实例 发送请求和接收响应
  5. 如何删除Android自带的应用程序?
  6. Android开发从入门到精通
  7. Android Studio 错误:Invalid Android NDK
  8. Android debug.keystore 密码
  9. Android SAX API XmlResourceParser及其
  10. Android + eclipse +ADT安装完全教程