The problem of setting up ADT under Ubuntu 64-bit

Source: Internet
Author: User
Tags perl script

I am using an ADT version of Adt-bundle-linux-x86_64-20140702.zip

1. When eclipse starts, ADB is prompted to fail to load the dynamic-link library libstdc++.so.6 and libz.so.1

Install the following two 32-bit packages: lib32stdc++6 LIB32Z1

2. Eclipse crashes frequently

To modify the Eclipse.ini in the directory where Eclipse is located, add one line:

-dorg.eclipse.swt.browser.defaulttype=mozilla

3. ADB cannot find an access phone

===================== the following references from http://www.cnblogs.com/sink_cup/archive/2011/10/31/ubuntu_x64_android_sdk_java.html

Lsusb

Unplug the phone and run Lsusb, one less line, that is the device.

such as bus 002 Device 003:id 0BB4:0CCF High Tech computer Corp. Indicates that HTC's vendor ID is 0BB4

Xiaomi 1S's Bus 002 Device 007:id 18d1:9025 Google Inc., which indicates that Xiaomi's manufacturer ID is 18D1

The hammer phone Smartisan T1 is the bus 003 Device 019:id 29a9:7019, indicating that the hammer's manufacturer ID is 29a9

Fill in according to the manufacturer ID, such as Hammer T1 write:

echo ' 0x29a9 ' | Tee-a ~/.android/adb_usb.iniecho ' subsystem== "USB", attr{idvendor}== "29a9", mode= "0666", group= "Plugdev" | sudo tee-a/etc/udev/rules.d/51-android.rulessudo chmod a+r/etc/udev/rules.d/51-android.rulessudo service Udev RESTARTADB kill-serveradb Start-server

Turn off the "USB debugging" of the device, unplug it, reconnect it to the computer, and turn on "USB debugging".

ADB devices

If the display is normal, you can.

======================== End of Quote

To make it easier to find Vendorid/productid, I wrote a perl script to do it. When prompted for a user name, it waits 10 seconds, during which time, if your phone is plugged in, unplug it and insert it if it is not plugged in. After 10 seconds, it will help you figure out two IDs and tell you how to modify the file

#!/usr/bin/perl# This script was to enable ADB debug on android Devices$hint = <<END; This script would help you to find our vendor id/product Idendprint "Enter Your user name:"; $username = <stdin>;# Find out product Id/vendor ID@AA = &getcmdoutput ("Lsusb");p rint "\nif your Android is plugged in, unplug it now. If it ' s not, plug in it now.  I'll wait for ten seconds ... \ n "; sleep; @aB = &getcmdoutput (" Lsusb "); if ($ #aA = = $ #aB | | ABS ($ #aA-$ #aB)! = 1) {die "You didn do the plug/unplug work as I said. Quit\n ";} @smaller = ($ #aA > $ #aB)? @aB: @aA; @bigger = ($ #aA > $ #aB)? @aA: @aB;%map;foreach $item (@smaller) {$map {$item} = 1;} $deviceInfo = ""; foreach $item (@bigger) {if (not exists $map {$item}) {$deviceInfo = $item; last;}} Die "Failed to resolve device info\n" unless $deviceInfo ne "; $deviceInfo =~/(. *):(. *)/; $vendorId = $; $productId = $; $ruleFile = '/etc/udev/rules.d/51-android.rules '; $adbFile = '/home/'. $username. ' /.android/adb_usb.ini '; $content = <<END; subsystem== "USB", attr{idvendor}== "$vendorId", attr{idproduct}== "$productId", owner= "$username", mode= "0666", GROUP = "Plugdev" EndPrint "What do you should add to $ruleFile: \ n $content";p rint "please add the line to your/home/". $username. ' /android/adb_usb.ini '. ": \ n";p rint "$vendorId \ n"; exit 0;sub getcmdoutput{my $command = $_[0];my @output; unless (open CMD    _pipe, "-|")        {exec "$command";    Exit        } while (<CMD_PIPE>) {chomp;    if (/id\s ([a-f0-9]+):([a-f0-9]+] \s/) {push @output, "$1:$2";} } @output; }

  

The problem of setting up ADT under Ubuntu 64-bit

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.