Recently, I want to continue to improve and optimize some of my previous Android program code. I want to import the previous code to the eclipse project in windows. Who knows that eclipse will be suspended after the import, even the windows Resource Manager cannot be moved. The strange thing is that the cpu usage and memory usage are more than enough. But simply go to linux. So I started to build the android development and debugging environment under Ubuntu13.04. I have encountered some problems during the construction process and hope to help later users.
Download and install the Eclipse and Android sdks
Remember that during android development, eclipse still needs to download the standard version of eclipse from www.eclipse.org, and install the adt plug-in to build the IDE environment for Android development. Now you only need to download an adt package. This package contains the eclipse adt development environment and android sdk, and has been configured. Running eclipse directly is a complete android integrated development environment. Adt package: http://developer.android.com/sdk/index.html. The detailed tutorial is not described here.
Debugging of connecting to Xiaomi 2 s real machine through Ubuntu 13.04 adb
After setting up the Android development environment, a new Android Application project is created. Prepare for running. The problem is that the simulator is too slow. How can I debug it on a real machine? The basic methods for Baidu and Google are similar:
- Connect your phone and computer with a usb cable and enable usb debugging.
- Dialing: * #717717 # * this step is critical. I did not perform this step, so the adb cannot view the device.
- Lsusb to obtain the device's VENDOR ID
- Add SUBSYSTEM = "usb", ATTR {idVendor }== "2717", MODE = "0666" to/etc/udev/rules. d/50-android.rules"
- Chmod a + x/etc/udev/rules. d/50-android.rules
- In ~ /. Add the device id 0x2717 to android/adb_usb.ini.
- Restart udev and sudo service udev restart
- Close the adb process, cd to the platform-tools directory of the adt tool, sudo./adb kill-server
- View the device connected to the device adb, sudo./adb devices-l
- In fact, this is done. If the device is still offline in eclipse, You can restart your mobile phone, disable it, and re-enable the usb debugging option, the mobile phone may ask if you are permanently using this computer for debugging. Select OK to display the device online in eclipse. Then you can debug the code of the app in the real machine environment in eclipse.
- When offline occurs, the basic solution is to restart usb debugging, restart the mobile phone, and restart the computer.
International practice: HelloWorld
What I did today is actually just a glimpse of some of adb debugging, and there will certainly be a lot of interesting feature waiting for me to learn.
Build an Android Development Environment on Ubuntu 12.04
Import Maven project to Eclipse4.2 from GitHub
Eclipse SDK 4.2.2/Equinox 3.8.2 released