• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide]Setting up ADB and Fastboot

Search This thread

amidabuddha

Senior Member
Jun 26, 2011
2,441
2,458
i need some help in cammand propt for adb devices please. my problem is when i push enter on putting in adb devices it says emulator-5554 device and then my device underneath, i need to some how turn off the emulator because it will only finish process with one adb device. has anyone asked you about this before? can you help me?

Open ADV Manager that comes with the SDK and delete the emulator

Sent from my Desire S
 

dragonsmma2009

New member
Mar 5, 2013
1
0
driver error

Definition:

ADB is the android debugging bridge that allows you to control your phone from your PC and is a bridge allowing you transfer stuff from it

Fastboot is usually used in bootloader and used a lot in unlocking your bootloader and commands in it

Setting up ADB:

1.Download the ZIP file from the attachments and extract it in C:\SDK\platform-tools (You will need to create these folders)
2. Go to command prompt by typing this word in menu search
3.Start writing
Code:
cd C:\SDK\platform-tools
adb.exe
You will see
Code:
Android Debug Bridge version 1.0.29

 -d                            - directs command to the only connected USB devic
e
                                 returns an error if more than one USB device is
 present.
 -e                            - directs command to the only running emulator.
                                 returns an error if more than one emulator is r
unning.
 -s <serial number>            - directs command to the USB device or emulator w
ith
                                 the given serial number. Overrides ANDROID_SERI
AL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.

                                 If -p is not specified, the ANDROID_PRODUCT_OUT

                                 environment variable is used, which must
                                 be an absolute path.
 devices                       - list all connected devices
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number
is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number
is specified.
                                 Using this command with no additional arguments

                                 will disconnect from all connected TCP/IP devic
es.

device commands:
  adb push <local> <remote>    - copy file/dir to device
  adb pull <remote> [<local>]  - copy file/dir from device
  adb sync [ <directory> ]     - copy host->device only if changed
                                 (-l means list but don't copy)
                                 (see 'adb help all')
  adb shell                    - run remote shell interactively
  adb shell <command>          - run remote shell command
  adb emu <command>            - run emulator console command
  adb logcat [ <filter-spec> ] - View device log
  adb forward <local> <remote> - forward socket connections
                                 forward specs are one of:
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
                                   dev:<character device name>
                                   jdwp:<process pid> (remote only)
  adb jdwp                     - list PIDs of processes hosting a JDWP transport

  adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
                                 ('-l' means forward-lock the app)
                                 ('-r' means reinstall the app, keeping its data
)
                                 ('-s' means install on SD card instead of inter
nal storage)
  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories
)
  adb bugreport                - return all information from the device
                                 that should be included in a bug report.

  adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
stem] [<packages...>]
                               - write an archive of the device's data to <file>
.
                                 If no -f option is supplied then the data is wr
itten
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks
 themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the
 device's
                                    shared storage / SD card contents; the defau
lt is noshared.)
                                 (-all means to back up all installed applicatio
ns)
                                 (-system|-nosystem toggles whether -all automat
ically includes
                                    system applications; the default is to inclu
de system apps)
                                 (<packages...> is the list of applications to b
e backed up.  If
                                    the -all or -shared flags are passed, then t
he package
                                    list is optional.  Applications explicitly g
iven on the
                                    command line will be included even if -nosys
tem would
                                    ordinarily cause them to be omitted.)

  adb restore <file>           - restore device contents from the <file> backup
archive

  adb help                     - show this help message
  adb version                  - show version num

scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb status-window            - continuously print device status for a specifie
d device
  adb remount                  - remounts the /system partition on the device re
ad-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
  adb reboot-bootloader        - reboots the device into the bootloader
  adb root                     - restarts the adbd daemon with root permissions
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on th
e specified port
networking:
  adb ppp <tty> [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
 <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
 [parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
  <localdir> can be interpreted in several ways:

  - If <directory> is not specified, both /system and /data partitions will be u
pdated.

  - If it is "system" or "data", only the corresponding partition
    is updated.

environmental variables:
  ADB_TRACE                    - Print debug information. A comma separated list
 of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes prior
ity over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these de
bug tags are printed.
Don't freak out everything will be explained

4.Connect device and make sure that USB Debugging is enabled from Settings:Applications:Development(on GB)
Settings:Developer Options(on ICS and HC)

5.Write
Code:
adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
Device name

6.There are common commands used on ADB:
Code:
adb reboot 
adb reboot recovery
adb reboot bootloader
adb push C:\<directory>\file /sdcard/
adb pull /sdcard/file C:\<directory>\
adb install C:\<directory>/file.apk
              or /sdcard/<directory>/file.apk
adb remount
Push and Pull means copy form directory to another

ADB Shell for in device commands
Code:
adb shell
#mv /sdcard/file /system/app
#cp /sdcard/file /system/app
#rm /sdcard/file 
#mkdir /sdcard/yourfoldernamehere
#ls /sdcard/<directory>

Setting up fastboot: Your phone must be on bootloader
Code:
cd C:\SDK\platform-tools

Commands List:
Code:
fastboot devices – lists which devices in fastboot mode are currently attached to your computer

fastboot boot <filename> – boots a rom stored on your pc specified by the filename

fastboot flash <partition> <filename> – flashes a rom stored on your pc, partition can be one of {boot, recovery, system, userdata}
Example: fastboot flash recovery C:\<directory>\recovery.img

PS: When i wrote <directory> it means like C:\Users\Desktop\Desktop\file
Or you can put the file in the the platform-tools folder you created so
write Ex:
Code:
adb push file.apk /sdcard/











Well i went through all the steps and th MTP failed shows a ? in yellow how can i fix it to detect my device???? please help
 

abdullahmk

Member
Apr 20, 2011
5
2
Istanbul
Guys I've got a problem. My Galaxy S2s home button is broken. I was on MIUI and I flashed original 4.1.2 firmware via Odin but phone stucked on starting and boot looped. Because of broken home button, I can't enter to recovery mode for wipe. I can only enter to download mode. So I tried to use ADB but ADB did't recognize the phone. It said device not found every time. I tried it both on bootloop and download mode. Now what can I do?
Someone had the same situation with mine and he solved with this XDA thread. Here you can see: forum.cyanogenmod.org/topic/63841-bootloop-and-cant-boot-into-recovery-mode-homebutton-brocken
 
Last edited:

themindfreak

Member
Jan 10, 2014
6
1
Guys I've got a acer iconia a1-810 and I did the root step by step using toolkit v0.8.2 and it went fine till I rebooted the system now it's in a bootloop I can access bootloader. I'm confused about the right update to use.

Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
 

kchaisu

Senior Member
Jan 27, 2014
896
738
Bangkok
Hello, i tried several ways found on internet....nothing worked for me on win 8.1 64 bit.... Any idea?
If you follow the 3rd link on jmcclue's post, it might be work for you. My observation is the problem stem from fastboot itself because if it is the HTC drivers problem neither ADB nor Fastboot would be working. For Win 8.1 Pro x64 bit with the latest HTC driver installed, ADB commands work flawlessly, but fastboot wouldn't work even updated to Windows 2967917. So by changing to fastboot.reg according to the 3rd link on imcclue's post, fastboot commands are working on my PC (Win 8.1 Pro x64 bit) flawlessly. So far I have no problem on fastboot and adb. However, if your DS is equipped with 4ext recovery management, flashing either ROM or Hboot could be done by this app anyway.
 
Last edited:

Ammiraglio

Senior Member
Jul 19, 2013
413
135
If you follow the 3rd link on jmcclue's post, it might be work for you. My observation is the problem stem from fastboot itself because if it is the HTC drivers problem neither ADB nor Fastboot would be working. For Win 8.1 Pro x64 bit with the latest HTC driver installed, ADB commands work flawlessly, but fastboot wouldn't work even updated to Windows 2967917. So by changing to fastboot.reg according to the 3rd link on imcclue's post, fastboot commands are working on my PC (Win 8.1 Pro x64 bit) flawlessly. So far I have no problem on fastboot and adb. However, if your DS is equipped with 4ext recovery management, flashing either ROM or Hboot could be done by this app anyway.

Thank you. I just need to have my phone recognized for fastboot commands.
I'll try later. Ciao
 
  • Like
Reactions: jmcclue

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    Definition:

    ADB is the android debugging bridge that allows you to control your phone from your PC and is a bridge allowing you transfer stuff from it

    Fastboot is usually used in bootloader and used a lot in unlocking your bootloader and commands in it

    Setting up ADB:

    1.Download the ZIP file from the attachments and extract it in C:\SDK\platform-tools (You will need to create these folders)
    2. Go to command prompt by typing this word in menu search
    3.Start writing
    Code:
    cd C:\SDK\platform-tools
    adb.exe
    You will see
    Code:
    Android Debug Bridge version 1.0.29
    
     -d                            - directs command to the only connected USB devic
    e
                                     returns an error if more than one USB device is
     present.
     -e                            - directs command to the only running emulator.
                                     returns an error if more than one emulator is r
    unning.
     -s <serial number>            - directs command to the USB device or emulator w
    ith
                                     the given serial number. Overrides ANDROID_SERI
    AL
                                     environment variable.
     -p <product name or path>     - simple product name like 'sooner', or
                                     a relative/absolute path to a product
                                     out directory like 'out/target/product/sooner'.
    
                                     If -p is not specified, the ANDROID_PRODUCT_OUT
    
                                     environment variable is used, which must
                                     be an absolute path.
     devices                       - list all connected devices
     connect <host>[:<port>]       - connect to a device via TCP/IP
                                     Port 5555 is used by default if no port number
    is specified.
     disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                     Port 5555 is used by default if no port number
    is specified.
                                     Using this command with no additional arguments
    
                                     will disconnect from all connected TCP/IP devic
    es.
    
    device commands:
      adb push <local> <remote>    - copy file/dir to device
      adb pull <remote> [<local>]  - copy file/dir from device
      adb sync [ <directory> ]     - copy host->device only if changed
                                     (-l means list but don't copy)
                                     (see 'adb help all')
      adb shell                    - run remote shell interactively
      adb shell <command>          - run remote shell command
      adb emu <command>            - run emulator console command
      adb logcat [ <filter-spec> ] - View device log
      adb forward <local> <remote> - forward socket connections
                                     forward specs are one of:
                                       tcp:<port>
                                       localabstract:<unix domain socket name>
                                       localreserved:<unix domain socket name>
                                       localfilesystem:<unix domain socket name>
                                       dev:<character device name>
                                       jdwp:<process pid> (remote only)
      adb jdwp                     - list PIDs of processes hosting a JDWP transport
    
      adb install [-l] [-r] [-s] <file> - push this package file to the device and i
    nstall it
                                     ('-l' means forward-lock the app)
                                     ('-r' means reinstall the app, keeping its data
    )
                                     ('-s' means install on SD card instead of inter
    nal storage)
      adb uninstall [-k] <package> - remove this app package from the device
                                     ('-k' means keep the data and cache directories
    )
      adb bugreport                - return all information from the device
                                     that should be included in a bug report.
    
      adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
    stem] [<packages...>]
                                   - write an archive of the device's data to <file>
    .
                                     If no -f option is supplied then the data is wr
    itten
                                     to "backup.ab" in the current directory.
                                     (-apk|-noapk enable/disable backup of the .apks
     themselves
                                        in the archive; the default is noapk.)
                                     (-shared|-noshared enable/disable backup of the
     device's
                                        shared storage / SD card contents; the defau
    lt is noshared.)
                                     (-all means to back up all installed applicatio
    ns)
                                     (-system|-nosystem toggles whether -all automat
    ically includes
                                        system applications; the default is to inclu
    de system apps)
                                     (<packages...> is the list of applications to b
    e backed up.  If
                                        the -all or -shared flags are passed, then t
    he package
                                        list is optional.  Applications explicitly g
    iven on the
                                        command line will be included even if -nosys
    tem would
                                        ordinarily cause them to be omitted.)
    
      adb restore <file>           - restore device contents from the <file> backup
    archive
    
      adb help                     - show this help message
      adb version                  - show version num
    
    scripting:
      adb wait-for-device          - block until device is online
      adb start-server             - ensure that there is a server running
      adb kill-server              - kill the server if it is running
      adb get-state                - prints: offline | bootloader | device
      adb get-serialno             - prints: <serial-number>
      adb status-window            - continuously print device status for a specifie
    d device
      adb remount                  - remounts the /system partition on the device re
    ad-write
      adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
    tloader or recovery program
      adb reboot-bootloader        - reboots the device into the bootloader
      adb root                     - restarts the adbd daemon with root permissions
      adb usb                      - restarts the adbd daemon listening on USB
      adb tcpip <port>             - restarts the adbd daemon listening on TCP on th
    e specified port
    networking:
      adb ppp <tty> [parameters]   - Run PPP over USB.
     Note: you should not automatically start a PPP connection.
     <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
     [parameters] - Eg. defaultroute debug dump local notty usepeerdns
    
    adb sync notes: adb sync [ <directory> ]
      <localdir> can be interpreted in several ways:
    
      - If <directory> is not specified, both /system and /data partitions will be u
    pdated.
    
      - If it is "system" or "data", only the corresponding partition
        is updated.
    
    environmental variables:
      ADB_TRACE                    - Print debug information. A comma separated list
     of the following values
                                     1 or all, adb, sockets, packets, rwx, usb, sync
    , sysdeps, transport, jdwp
      ANDROID_SERIAL               - The serial number to connect to. -s takes prior
    ity over this if given.
      ANDROID_LOG_TAGS             - When used with the logcat option, only these de
    bug tags are printed.
    Don't freak out everything will be explained

    4.Connect device and make sure that USB Debugging is enabled from Settings:Applications:Development(on GB)
    Settings:Developer Options(on ICS and HC)

    5.Write
    Code:
    adb devices
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    List of devices attached
    Device name

    6.There are common commands used on ADB:
    Code:
    adb reboot 
    adb reboot recovery
    adb reboot bootloader
    adb push C:\<directory>\file /sdcard/
    adb pull /sdcard/file C:\<directory>\
    adb install C:\<directory>/file.apk
                  or /sdcard/<directory>/file.apk
    adb remount
    Push and Pull means copy form directory to another

    ADB Shell for in device commands
    Code:
    adb shell
    #mv /sdcard/file /system/app
    #cp /sdcard/file /system/app
    #rm /sdcard/file 
    #mkdir /sdcard/yourfoldernamehere
    #ls /sdcard/<directory>

    Setting up fastboot: Your phone must be on bootloader
    Code:
    cd C:\SDK\platform-tools

    Commands List:
    Code:
    fastboot devices – lists which devices in fastboot mode are currently attached to your computer
    
    fastboot boot <filename> – boots a rom stored on your pc specified by the filename
    
    fastboot flash <partition> <filename> – flashes a rom stored on your pc, partition can be one of {boot, recovery, system, userdata}
    Example: fastboot flash recovery C:\<directory>\recovery.img

    PS: When i wrote <directory> it means like C:\Users\Desktop\Desktop\file
    Or you can put the file in the the platform-tools folder you created so
    write Ex:
    Code:
    adb push file.apk /sdcard/
    2
    you need to flash it when you are in bootloader using fastboot command:

    fastboot flash boot boot.img
    2
    I have been trying to do a factory reset of the Nabi 2, and since I can't seem to access the "Mommy Mode", I thought I could do it from the recovery menu. So far I have yet to find any factor reset option available. Is there such a beast or am I out of luck?

    This is not the Nabi 2 forum...
    And don't even know what the hell the "Mommy Mode" is, but with the command <adb reboot recovery> should bring you to the recovery.

    Sent from my Nexus 7 using xda app-developers app
    2
    Hello, i tried several ways found on internet....nothing worked for me on win 8.1 64 bit.... Any idea?
    If you follow the 3rd link on jmcclue's post, it might be work for you. My observation is the problem stem from fastboot itself because if it is the HTC drivers problem neither ADB nor Fastboot would be working. For Win 8.1 Pro x64 bit with the latest HTC driver installed, ADB commands work flawlessly, but fastboot wouldn't work even updated to Windows 2967917. So by changing to fastboot.reg according to the 3rd link on imcclue's post, fastboot commands are working on my PC (Win 8.1 Pro x64 bit) flawlessly. So far I have no problem on fastboot and adb. However, if your DS is equipped with 4ext recovery management, flashing either ROM or Hboot could be done by this app anyway.
    1
    Link to that guide will be helpful