The simulator is too slow, and the effect of running programs on the simulator is still a little different from that on the real machine after all. Therefore, we recommend that you use the real machine for debugging as much as possible. Connect your android phone to your computer through a USB cable, and then perform the following steps:
1. Create a 51-android.rules file in the/etc/udev/rules. d/directory. The file content is:
SUBSYSTEM = "usb", ENV {DEVTYPE} = "usb_device", MODE = "0666"
2. $ sudo chmod a + rx/etc/udev/rules. d/50-Android.rules
3. $ sudo/etc/init. d/udev restart
4. Go to the tools directory of the android sdk and run platform-tools.
$ Sudo./adb kill-server
$ Sudo./adb start-server
5. $ sudo adb devices
The device model you connected to is displayed. If the device name is displayed as "???", It is probably because of your 51-android.rules file. Repeat the previous steps.
6. Open eclipse and run your program. Then you can see the running result on your android phone.