How to debug Android phones in Ubuntu

Source: Internet
Author: User
The following describes how to debug the Android mobile phone in Ubuntu. The procedure is as follows: 1. Set the mobile phone to USB debugging mode through the following operations -- & gt; application -- & gt; Development -- & gt; USB debugging II. view the usb information of the mobile phone lsusbBus002Device004: ID18c3: 6255

For how to debug the Android mobile phone in Ubuntu, take my moto mb525 (Defy) as an example. The specific steps are as follows:

1. Set the mobile phone to USB debugging mode through the following operations

Set --> Application --> Development --> USB debugging


II,View the usb information of the mobile phone

Lsusb
Bus 002 Device 004 : ID 18c3 : 6255
Bus 002 Device 002 : ID 8087 : 0020 Intel Corp . Integrated Rate Matching Hub
Bus 002 Device 001 : ID 1d6b : 0002 Linux Foundation 2.0 Root hub
Bus 001 Device 005 : ID 22b8 : 41db Motorola PCS Motorola Droid (USB Debug)
Bus 001 Device 004 : ID 04d9 : A06b Holtek semicondu , Inc .  
Bus 001 Device 003 : ID 058f : B002 Alcor Micro Corp .  
Bus 001 Device 002 : ID 8087 : 0020 Intel Corp . Integrated Rate Matching Hub

The lsusb command is used to list all current usb devices. My defy is

Bus001Device005:ID 22b8:41db Motorola PCS Motorola Droid (USB Debug)

3. Add udev rules

Udev is a dynamic hardware management service.

Cd/Etc/Udev/Rules.D/

Sudo vi 50 - Android - Usb . Rules

Add the following content based on the actual usb information, and then save

 SUBSYSTEM="Usb",SYSFS ("Motorola PCS Motorola Droid (USB Debug)")="22b8",MODE="0666"

Sysfs contains the actual description of your android mobile phone. The value = is followed by the ID number, the mode is the Read mode, and 0666 is accessible to all users, the above information is investigated by lsusb.

4. Set Rule file permissions and restart udev rules

Sudo Chmod A + Rx / Etc / Udev / Rules . D / 50 - Android - Usb . Rules

Sudo/Etc/Init.D/Udev restart 

Udev-related prompts are displayed.

 

5. Set adb

Go to the platform-tools directory of the sdk

Sudo ./ Adb Kill - Server
Sudo ./ Adb devices
* Daemon not running . Starting it now on port 5037   *
* Daemon started successfully *
List of devices attached

0163C5420200F029 device 

You can use a real machine for debugging in eclipse.

Method for accessing android shell:

./Adb shell

After entering, you can do whatever you want. It is best not to delete or modify it.


Vi. adb applications

Adb (Android Debug Bridge) is a common tool for Android users. With this tool, we can develop very well. adb.exe is under the android sdk tools directory you have installed.

Command Description
Install Install the application on the server
Pull Pulling remote files out of the server
Push Push local files to the server
Shell Open a shell environment on the server
Forward Transfer traffic from one port to another port (to or from the server)
Start-server Start the server
Kill-server Stop a server
Ppp Use a ppp connection via USB
Devices List available Simulators
Help List adb commands
Version Show adb version

Adb usage:

Adb [-d |-e |-s ]

Related Article

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.