A recent project needs to use linux to develop Android programs! I found that there was no connection to Xiaomi development in Ubuntu! It took me one afternoon to complete the operation! Check it out! The Xiaomi phone uses USB to connect to the Ubuntu10.04 system. Run the following command: www.linuxidc.com @ linuxidc :~ $ LsusbBus007Device001: ID1d6b: 0001LinuxFoundation1. 1
A recent project needs to use linux to develop Android programs! I found that there was no connection to Xiaomi development in Ubuntu! It took me one afternoon to complete the operation! Check it out!
The Xiaomi phone uses USB to connect to the Ubuntu 10.04 system. Run the following command:
Www.linuxidc.com @ linuxidc :~ $ Lsusb
Bus 007 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 17ef: 1003 Lenovo
Bus 006 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 046d: c06c Logitech, Inc.
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 003: ID 0a5c: 2110 Broadcom Corp. Bluetooth Controller
Bus 003 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 18d1: 9025
Bus 001 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Unplug the USB cable from your phone and run the following command:
Www.linuxidc.com @ linuxidc :~ $ Lsusb
Bus 007 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 17ef: 1003 Lenovo
Bus 006 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 046d: c06c Logitech, Inc.
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 003: ID 0a5c: 2110 Broadcom Corp. Bluetooth Controller
Bus 003 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 root hub
We found that Bus 001 Device 005: ID 18d1: 9025 is the phone of Xiaomi.
Sudo gedit/etc/udev/rules. d/53-android.rules Add the following text to the open file:
SUBSYSTEM = "usb", SYSFS {idVendor} = "04e8", MODE = "0666"
SUBSYSTEM = "usb", ATTR {idVendor} = "04e8", ATTR {idProduct} = "685e", SYMLINK + = "android_adb"
Sudo chmod a + rx/etc/udev/rules. d/53-android.rules
Www.linuxidc.com @ linuxidc:/etc/udev/rules. d $ sudo service udev restart // or restart udev
Udev start/running, process 7147
Run it in the tools directory of the android sdk (this step is very important and must be sudo, otherwise it will not work)
Www.linuxidc.com @ linuxidc :~ /Star2011/SDK/android-sdk-linux/platform-tools $ sudo./adb kill-server
Www.linuxidc.com @ linuxidc :~ /Star2011/SDK/android-sdk-linux/platform-tools $ sudo./adb devices
* Daemon not running. starting it now on port 5037 *
* Daemon started successfully *
List of devices attached
Then, you can directly use the adb shell operation. You can also use Eclipse for debugging.