Android Development Environment configuration: program debugging using the entity pad

Source: Internet
Author: User

Reference webpage:
Http://www.njpro.cn/forum.php? MoD = viewthread & tid = 111.
Http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp
Http://forum.xda-developers.com/showthread.php? T = 1071584

 

Method 1: Connect using a USB connector
1. Use lsusb to view the idvendor of the USB Connection Device
It can be found that the idvendor of tf101 of Asus is: 0b05
2. In ubuntu, the first time you connect to the physical machine for debugging, you will find that Ubuntu cannot identify the Android mobile phone.
The following settings are required:

1. log in as root and create this file:/etc/udev/rules. d/51-android.rules.
For gusty/hard, edit the file to read:
Subsystem = "USB", sysfs {idvendor} = "0bb4", mode = "0666"

For dapper, edit the file to read:
Subsystem = "usb_device", sysfs {idvendor }== "0bb4", mode = "0666"
2. Now execute:
Chmod A + R/etc/udev/rules. d/51-android.rules

In Ubuntu Linux, when installing software using source code files, CHMOD commands are often used to change the permissions of files so that they can be executed during installation.
3. Install the driver of the device (because of the Ubuntu system I use, it is difficult to find and install the driver, so the following method 2 is used without using USB for connection)
4. Run ADB connect 192.168.xxx.xxx to connect to the device.

Method 2: Connect using a Wi-Fi network
1. the pad and PC have been connected to the LAN and are in the same CIDR block, which can be pinged.
2. the android SDK has been installed on the PC (ensure that the SDK version is later than 2.0 ).
3. Check whether the ADB version on the PC is later than 1.0.25. The method is to press ADB in shell and press enter to display help. The first line is the ADB version information.
(If Bash: ADB: Command not found appears, follow the instructions below to set the path parameter of the system)
4. view the IP address of the pad, ADB connect 192.168.xxx.xxx
If connected to 192.168.xxx.xxx: 5555 is returned, the connection is successful.
5. Use ADB devices to view the devices that can be connected currently.
6. If the connection fails, kill the-server command and try again.
ADB kill-Server
7. After debugging is completed, you can use ADB disconnect 192.168.xxx.xxx: 5555 to disconnect the connection.

Note: The above two methods both need to set pad to the developed USB debugable status.

FAQ 1:
I am using viewsonic 10 s and Asus tf101 pad for debugging, and these two pads do not enable adbd's 5555 listening port by default, it will appear
ADB connect 192.168.xxx.xxx cannot be connected.
The reason is: When adbd is started, check whether service. ADB. tcp. Port is set. If yes, TCP is used as the connection mode;
If not set, check whether there is an adb usb device (DEV/android_adb). If yes, use USB as the connection mode;
If there is no USB device, TCP is used as the connection mode.
Solution: crack the pad, get the root permission, and set service. ADB. tcp. Port.
Use z4root to install the APK installation package to the pad. Easy to use.
Because the pad driver is not installed in my PC system, if you have drivers installed, you can use USB to connect to the pad, use the ADB shell to enter the pad command line, and Su to get the root permission.
I downloaded the better_terminal_emulator_pro_3.14.apk installation package, an android command line. Run Su to obtain the root permission.
Execute the following statement: (it seems that you can modify it by setting the init. RC file)
Setprop service. ADB. tcp. port 5555
Stop adbd
Start adbd
In this way, we have set service. ADB. tcp. Port to 5555 (I don't know why, I have executed it multiple times before it is successful, so far I don't know why)
Run ADB connect 192.168.xxx.xxx to connect to the pad.
You can also use the following statement to restore the pad to the USB listening status.
Setprop service. ADB. tcp. Port-1
Stop adbd
Start adbd
There is another section below, which is not used currently
========================================================== ==========
If you have USB access already, it is even easier to switch to using WiFi.
From a command line on the computer that has the device connected via USB, issue the commands

ADB tcpips 5555
ADB connect 192.168.0.101: 5555

To tell the ADB daemon return to listening over USB

ADB USB

There are also several apps on the Android Market that automate this process.
========================================================== ==========
FAQ 2:
Run SDB and Bash: ADB: Command not found appears.
Sudo gedit ~ /. Bashrc
To:
Export path =$ {path}:/home/Ray/Android-sdks/tools:/home/Ray/Android-sdks/platform-Tools
To solve the problem, you can view the ADB version.

CTRL + C Exit the ping command
Ifconfig-A can query the IP address result 192.168.1.79. Why Ping different tablets?

** How do I set the IP address of the android WiFi Nic? Settings-> Wireless Control-> WI-FI settings-> click the menu key on the keyboard-> advanced-> that's here! (This method is to set a fixed IP address for pad)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.