Results 1 to 6 of 6

Thread: adb commands work only with ./adb

  1. #1
    Join Date
    Dec 2013
    Beans
    105
    Distro
    Xubuntu

    adb commands work only with ./adb

    So i had to re-install adb, thought that since i had installed once i wouldn't have any problems.... well half-way i stumbled upon problem.
    The phone is checked at the usb-debugging and even checked in the unknown sources(under application setings).
    Since i have 12.04 32 bit i didn't installed ia32-libs. oracle java 7 is installed.
    I've downloaded adt-bundle-linux-x86-20140702.

    The main problem is the following: until now adb commands works under one condition only.
    I have to cd in the terminal to the platform-tools folder and then to use ./adb. If simply adb will be used i will get command not found...
    As far as i know when "." is used in front of a file then that file is hidden... why did that happened?

    For my PATH variable i used:
    Code:
    nano ~/.bashrc
    and at the end of the file i typed:
    Code:
    #AndroidDev PATH
    export PATH=${PATH}/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools
    export PATH=${PATH}/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    that ~/.bashrc file is saved in /home/haris/.bashrc

    Now my declaration of the udev rules works correctly but only declared 1 device.

    By the way my second and last question: How is it possible to make udev rules for random devices, so that you won't have to every time to use the vendors id and product id and make a specific udev rule for each and every device that you'll plug-in

  2. #2
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: adb commands work only with ./adb

    ./adb - the dot-slash (./) means "on this folder, the file adb" which will run the script (if it is a script/program)
    .adb - a file with a dot at the start is a hidden file.

    Back to the problem, your export command seems to have a typo, the default paths (and additional ones) are separated by a colon:
    Code:
    kenneth@nerdtron:~$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
    So if you need to add a custom path to the PATH variable you need to:
    Code:
    export PATH=YOUR_PATH_WITHOUT_TRAILING_SLASH:$PATH
    Reboot to reset you current changes so far, then try adding custom path again. To verify if your path is added, just use the echo command that I used above.

  3. #3
    Join Date
    Dec 2013
    Beans
    105
    Distro
    Xubuntu

    Re: adb commands work only with ./adb

    About the trailing slash, you mean the "android_dev_tools"???
    Also your echo $PATH code confused me a bit...

    Look:
    i)Open the terminal inside platform-tools folder:
    Code:
    haris@Mini-210:~/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools$ echo $PATH
    /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    ii)open terminal inside tools folder:
    Code:
    haris@Mini-210:~/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools$ echo $PATH
    /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    although the paths should show 2 different destinations, it shows the same... what???

    However if open the terminal in the sdk folder and use readlink:
    Code:
    haris@Mini-210:~/android_dev_tools/adt-bundle-linux-x86-20140702/sdk$ readlink -f tools
    /home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools
    haris@Mini-210:~/android_dev_tools/adt-bundle-linux-x86-20140702/sdk$ readlink -f platform-tools
    /home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    P.S. or by trailing slash you mean the "/" sign?

  4. #4
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: adb commands work only with ./adb

    trailing slash you mean the "/" sign?
    Yes.

    Your current "echo $PATH" is wrong. There should be a colon ( : )between the
    /usr/games folder and the /home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools

    Look carefully on the separation of paths.
    Last edited by nerdtron; November 8th, 2014 at 08:10 PM.

  5. #5
    Join Date
    Dec 2013
    Beans
    105
    Distro
    Xubuntu

    Re: adb commands work only with ./adb

    Ok i managed to do it! Thank you for the help!
    I put the colon ( : ) between usr/games folder and the other 2 corresponding folders and it worked.
    However it makes me wonder:
    Code:
    haris@Mini-210:~$ echo $PATH
    /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    Now it showed the colon ( : ) at the proper place, but why did it showed the specific path and not the path to my user folder or something?

  6. #6
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: adb commands work only with ./adb

    Because of your wrong export command with no colons.
    Code:
    #AndroidDev PATH
    export PATH=${PATH}/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/tools
    export PATH=${PATH}/home/haris/android_dev_tools/adt-bundle-linux-x86-20140702/sdk/platform-tools
    Those line basically means combine the current PATH and add the path you specified, but since you did not specify any colon as a form of separation, it just assumed that it is a valid path the you declared. It won't bother to check so your custom path will just be appended on the last entry which will have a discrepancy on the final output.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •