Commit Graph

128 Commits

Author SHA1 Message Date
Teddie Stenvi 8f5daadcc1 Fix ADB daemon file descriptor leak
The ADB (Android Debug Bridge) daemon suffers from a file descriptor leak.
When transfering file descriptors, opened by the adbd daemon, to a JDWP
process for debugging through sendmsg, the file descriptor is duplicated
by the kernel and a copy is transfered to the JDWP process.
Adbd neglects to close it's copy of the descriptor after the sendmsg call
which causes a file descriptor leak in the process.
Eventually this causes the daemon to hit its maximum roof of opened file
descriptors thus making it impossible for the process to serve any new
commands from the adb server.
Jdwp_service.c has been modified to close the file descriptor after the
send message call has succeded.
Also, the socket used for transfering the file descriptor is set to blocking
mode before the sendmsg call since the adbd processes needs to know when the
duplication has been completed by the kernel.
The flags are reset to its original state after the sendmsg call.

Change-Id: I76b15460301ac01e432f5ce8678ff58c658c16f2
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2010-06-18 08:11:04 +00:00
Mike Lockwood cbbe79add1 adb connect and disconnect improvements:
Port number is now optional.  Will use default port 5555 if not specified.
"adb disconnect" with no additional arguments will disconnect all TCP devices.

Change-Id: I7fc26528ed85e66a73b8f6254cea7bf83d98109f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-06-02 11:31:26 -04:00
Mike Lockwood 67d5358e2a adb: remove obsolete shell history support.
Change-Id: I85a7cda176ca3bb7cb9f96e18556d53daaac3023
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-25 13:40:15 -04:00
Jack Palevich 7fe202f160 Use linenoise to add simple editing and history to the Android shell.
The linenoise library is from http://github.com/antirez/linenoise

This patch also disables command-line editing and history from adb. The
adb implementation was shadowing the Android shell's implementation.

The adb implementation was also shadowing the editing and history
implementation in alternative shells such as BusyBox's ash.

Change-Id: I7ebd4cb391d0ce966c0ce0e707d80ecd659f9079
2010-05-25 14:49:57 +08:00
Stefan Hilzinger d9d1ca4780 Let "adb connect" connect to emulators too
- adb can now connect to an emulator configured with an arbitrary
  pair of <console port, adb port>. These two ports do not have to be
  adjacent.
  This can be done from the commandline at any time using
  adb connect emu:<console_port>,<adb_port>
- Emulators running on ports outside the normal range
  (5554/5555-5584/5585) register themselves on startup if they follow
  the convention "console port+1==abd port".
- Emulators outside the normal port range will not be auto-detected on
  adb startup as these ports are not probed.
- The index into local_transports[] array in transport_local.c does no
  longer indicate the port number of the local transport. Use the altered
  atransport struct to get the port number.
- I have chosen not to document the adb connect emu:console_port,adb_port
  syntax on adb's help screen as this might be confusing to most readers
  and useful to very few.
- I don't expect this to introduce any (backwards) compatibility issues.

Change-Id: Iad3eccb2dcdde174b24ef0644d705ecfbff6e59d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-24 11:27:16 -04:00
Colin Cross 5762ec2905 Fix adb remount on non-MTD devices
Change-Id: If8e07502bcface53aaac81022f6183c6a147edc8
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-24 11:27:16 -04:00
Dima Zavin f1c03de74e adb: Add Qualcomm USB id
Change-Id: I044a77f14d7a90e9dff191919e4aeb39723ea429
Signed-off-by: Dima Zavin <dima@android.com>
2010-05-24 11:02:17 -04:00
Tim cd64315f72 Add documentation for some adb environmental variables.
The ADB_TRACE one is particularly important.

Change-Id: I125a5930c43065c8cf505eea40d20e3f209bc858
2010-04-29 07:41:50 -07:00
Brian Carlstrom 26bb6e92ba Fixing spelling errors in adb docs
Change-Id: I9376717165a01e207034f84a31f85335d3740f18
2010-04-28 11:38:39 -04:00
Stefan Hilzinger a84a42eb20 Make adb's daemon-port on the host machine configurable.
This is the first CL of a somewhat larger effort which, among other things,
will involve changing the emulator and ddms to talk to adb running on a
configurable port.

The port can be configured using environment variable ANDROID_ADB_SERVER_PORT.

Further CLs will also address the set of ports used for the local transport.

Change-Id: Ib2f431801f0adcd9f2dd290a28005644a36a780a
2010-04-28 11:38:34 -04:00
Mike Lockwood 23e64161be adb: remove obsolete adb.connected system property.
This was used for adb networking, which no longer exists.
This code also failed when adb was not running as root.

Change-Id: Ied86fb1930094d5ae5009684d25e15385fd31d03
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-28 11:35:10 -04:00
Xavier Ducrohet 4f660699bf Add Pantech's USB vendor ID to adb.
Change-Id: I5334f46ee52ca1bd8067860701aef7b93296bedb
2010-04-28 11:34:01 -04:00
Takeshi Kishimoto c22b9bf1a8 Added Kyocera's VID (0x0482), upon their request.
Change-Id: I8f2f2a02c22d618c0b42d4f287d88a98af3ac4fa
2010-04-28 11:33:49 -04:00
Mike Lockwood 505bd6e5fc adb: Add five second timeout for USB writes on Linux host.
This helps us recover when things go wrong during automated testing.

Change-Id: I006dbfaff7f70d51398ff12fbddcaee751453b78
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-28 11:33:13 -04:00
Brian Carlstrom 805c4a7030 Add missing newlines to adb usage message 2010-04-28 11:32:53 -04:00
Mike Lockwood c519c00c36 adb: do not mix printf() with write() when writing to stdout.
Change-Id: I3598cc951778080bec9a21d646656d5aba57120a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-28 11:32:20 -04:00
Takeshi Kishimoto 16f1550b51 Added ZTE's USB Vendor ID (0x19D2) upon ZTE's request. 2010-04-28 11:31:50 -04:00
Takeshi Kishimoto 17273091e9 Added USB vendor id of Sharp, based on Sharp's request.
Sharp's vendor id: 0x04dd
2010-04-28 11:31:37 -04:00
Mike Lockwood 05f202a94b Merge "adb: Add persistent system property for running adb in TCPIP mode" 2010-04-20 11:09:49 -07:00
Mike Lockwood 8e2ceaeacf adb: Add persistent system property for running adb in TCPIP mode
In addition to service.adb.tcp.port, you can now set persist.adb.tcp.port
to specify the port number for adb to listen to instead of USB.
This allows the adb TCP configuration to persist across reboots.

Change-Id: I897ffcb019e8dd1785996d2f3c571cfc2f8ded38
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-20 14:06:40 -04:00
Anthony Newnam 705c944c0e Add -l option to `adb sync`
Change-Id: I87c01663dff319dde24b70560e6fe5647ebf9d49
2010-04-19 16:36:57 -07:00
Matt Fischer 457d81cec1 Allow 'adb pull' to pull symlinked files
Change-Id: I02f31334e4ee0c7b0e7b379016629a465e711905
2010-04-15 13:36:16 -05:00
The Android Open Source Project d6391c6aaa merge from open-source master 2010-02-23 07:32:01 -08:00
Raphael 5a912bf03e ADB: Garmin-Asus's USB Vendor ID
Change-Id: I3249d629f59d40f291079fc214b643ac6c927f76
2010-02-15 12:00:48 -05:00
Erik Gilling 2f6c2b04fb adb: add Nvidia's vendor id to adb
Signed-off-by: Erik Gilling <konkers@android.com>
2010-02-15 11:59:54 -05:00
Dan Egnor 7eced2b86a make "adb bugreport" run "bugreport" (which invokes "dumpstate"
indirectly via system service) rather than "dumpstate", that way
even when adb is not running as root, dumpstate does run as root,
and can do things like collect VM traces.
2010-02-15 11:59:47 -05:00
Mike Lockwood 429c5ae461 adb: Fix problems detecting adb in more complicated USB configurations.
Change-Id: Ib5b13960a1c75efc97abeca46204c85bba905c71
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-15 11:59:04 -05:00
Joe Onorato 8071a4bdb6 Make adb pull use . as the target file directory if you don't supply one. 2010-02-15 11:58:56 -05:00
Raphael 190cabb376 am 1873adc2: ADB: Garmin-Asus\'s USB Vendor ID
Merge commit '1873adc2b12d5a9045bae90650bb331c7c7aa3c7' into eclair-plus-aosp

* commit '1873adc2b12d5a9045bae90650bb331c7c7aa3c7':
  ADB: Garmin-Asus's USB Vendor ID
2010-02-01 15:34:16 -08:00
Raphael 1873adc2b1 ADB: Garmin-Asus's USB Vendor ID
Change-Id: I3249d629f59d40f291079fc214b643ac6c927f76
2010-02-01 09:56:47 -08:00
Xavier Ducrohet f71f068fb9 Add DELL's USB Vendor ID to adb - DO NOT MERGE
Change-Id: Ie1a6b6a81f50956362aee2a2d6d1b805f0e85b7a
2010-01-21 17:24:36 -08:00
Mike Lockwood cc7a5dc770 adb: Add Dell's USB vendor ID.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-19 11:46:08 -05:00
Mike Lockwood a1871d2a72 adb: Add USB vendor ID for Foxconn
Change-Id: I88e4051b6e5cd820cab7e3ec417a545f50925a33
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-12-23 07:45:07 -05:00
Romain Guy a48d43a077 Add adb reboot-bootloader to match fastboot reboot-bootloader.
Also fix the formatting of one of the options in the help message.
2009-12-23 07:44:50 -05:00
Mike Lockwood a59387b508 adb: fix -d and -e options for "adb forward" command.
Change-Id: I9166572a1c398ce5ef1423d19a30895385118ee5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-12-23 07:44:03 -05:00
Jean-Baptiste Queru 333a80cf9f merge from eclair 2009-11-15 12:07:12 -08:00
Jean-Baptiste Queru 4b29fe640a eclair snapshot 2009-11-12 18:46:23 -08:00
Xavier Ducrohet 23433b93d1 Add Sony-Ericsson to adb. 2009-10-30 13:09:39 -07:00
Alexey Tarasov 3b226f9e3b FreeBSD support for usb-connected devices in adb
FreeBSD (and other systems as well) may use libusb to work with USB devices.
libusb is integrated in FreeBSD base system in recent builds (8.0+),
however in other systems it may need include libusb.h like <libusb/libusb.h>
and install library from devel/libusb port or other repository.

Submitted change not supports events (attach/detach) as libusb 1.0 lacks
such functionality and in order to make code more portable I've not used
workarounds as in earlier changeset.

Code was tested on FreeBSD 8.0-RC1, HTC Hero (1.0.0.A6288, Android 1.5)
2009-10-25 01:56:35 +11:00
Alexey Tarasov 3166410a82 Make get_my_path() safer
Adds maxLen parameter to get_my_path().
Some small cosmetic fixes.
2009-10-22 02:55:00 +11:00
Mike Lockwood 74d7ff8cfd adb: Add "adb disconnect" command for disconnecting TCP/IP devices.
Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-13 10:45:39 -04:00
Robert CH Chou 1fbf27bf22 Add support for Acer devices
Change-Id: I7045249f86e2b628c31c888e95eb5ba6f6c47251
2009-10-13 10:45:34 -04:00
Mike Lockwood 89f9a84af0 adb: Add USB Vendor IDs for LG and Huawei
Change-Id: Ib47e3e39609bac9cf34f2b9334aa95184b3db71d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-13 10:45:29 -04:00
Jean-Baptiste Queru 4a0da39db4 Add NOTICE file and license tag for adb
BUG=1716164
2009-10-13 10:45:22 -04:00
Mike Lockwood d6e3ecb70f adb: Clean up argument passing for create_service_thread()
Change-Id: Id68b312e76215e8e217b42ca0301713dbddfee9e
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-13 10:45:14 -04:00
Joe Onorato e5c8b6dd79 Revert "adb: Another attempted workaround for the adb disconnect problem."
This reverts commit cc1de48dcd.

lockwood says to take this out.
2009-10-13 10:45:04 -04:00
Mike Lockwood 8cf0d59f61 adb: Add "adb disconnect" command for disconnecting TCP/IP devices.
Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-11 23:04:18 -04:00
Android (Google) Code Review ff7d5835d9 Merge change 26093 into eclair
* changes:
  Add NOTICE file and license tag for adb
2009-09-24 12:45:49 -04:00
Robert CH Chou 7953b89e8d Add support for Acer devices
Change-Id: I7045249f86e2b628c31c888e95eb5ba6f6c47251
2009-09-22 13:03:14 -07:00
Mike Lockwood 6ae9256322 adb: Add USB Vendor IDs for LG and Huawei
Change-Id: Ib47e3e39609bac9cf34f2b9334aa95184b3db71d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-09-21 08:09:59 -04:00