summaryrefslogtreecommitdiffstats
path: root/adb
Commit message (Collapse)AuthorAgeFilesLines
* Merge "adb: "support" O_CLOEXEC in adb_open on Windows."Treehugger Robot2019-02-081-0/+3
|\
| * adb: "support" O_CLOEXEC in adb_open on Windows.Josh Gao2019-02-071-0/+3
| | | | | | | | | | | | | | | | | | Previously, we were rejecting the flag and failing with EINVAL. File handles aren't inherited by default, so just ignore the flag. Bug: http://b/123753498 Test: adb install --streaming foo.apk Change-Id: I17401fcdd58024956d47a5c4c0c57b06831d9817
* | adb: hopefully deflake test_adb.py.Josh Gao2019-02-071-0/+3
|/ | | | | | | | | | | The reconnection test is spuriously failing on test infrastructure for unclear reasons, which might be due to a race between the connection attempt and the first command we send. Insert a sleep to hopefully reduce the flakiness. Bug: http://b/123247844 Test: ./test_adb.py (but it didn't fail for me in the first place) Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
* adb: don't close sockets before hitting EOF.Josh Gao2019-01-313-4/+116
| | | | | | | | | | | | | | | Reimplement commit ffc11d3cf3643c24780f902386be61851531f022 using fdevent. The previous attempt was reverted because we were blindly continuing when revents & POLLIN == 0, which ignored POLLHUP/POLLERR, leading to spinloops when the opposite end of the file descriptor was shutdown when we had no data left to read. This patch reimplements the functionality implemented by that commit using fdevent, which gets us detection of spin loops for free. Bug: http://b/74616284 Test: ./test_device.py Change-Id: I1abd671fef4c29e99dad968aa66bb754ca382578
* adb: implement fdevent_set_timeout.Josh Gao2019-01-314-35/+177
| | | | | Test: adb_test Change-Id: I9ae61465617b6a2fe0a1c161ad88c4feae49ec80
* Merge changes If8747ba1,Id1943ebdJosh Gao2019-01-314-18/+32
|\ | | | | | | | | | | * changes: adb: improve network_connect error messages. adbd: fix TCP bind address.
| * adb: improve network_connect error messages.Josh Gao2019-01-301-4/+7
| | | | | | | | | | Test: manual Change-Id: If8747ba1951d3c87561fbd3fb4968821243b2ee2
| * adbd: fix TCP bind address.Josh Gao2019-01-303-14/+25
| | | | | | | | | | | | | | | | | | The switch to socket_spec_listen broke adbd over TCP, because socket_spec_listen only listens on localhost. Bug: http://b/123592649 Test: manual Change-Id: Id1943ebd7f0059db05ad756fe96189c60ebde337
* | Merge "Add android::fs_mgr namespace for new Fstab code"Tom Cherry2019-01-312-2/+4
|\ \
| * | Add android::fs_mgr namespace for new Fstab codeTom Cherry2019-01-302-2/+4
| |/ | | | | | | | | | | | | Should have been done a while ago, but better late than never. Test: treehugger Change-Id: I0ea6e8d459cd3f3b3ce2d00a7a6a9786d52c52dd
* | Merge changes Ief3dbf8e,Ib06e6f65Josh Gao2019-01-313-66/+117
|\ \ | | | | | | | | | | | | | | | * changes: adb: add fdevent callback that passes the fdevent. base: don't overwrite errno in unique_fd::~unique_fd.
| * | adb: add fdevent callback that passes the fdevent.Josh Gao2019-01-303-66/+117
| |/ | | | | | | | | | | | | | | | | This is useful for when we don't want to actually store the fdevent into a separate struct to be able to destroy it, but instead want to destroy it immediately from the callback. Test: adb_test Change-Id: Ief3dbf8ea6a6bd72dc7e73f9ab9b7429e48fc181
* | Merge changes from topic "move_bionic_to_apex3"Treehugger Robot2019-01-312-0/+105
|\ \ | |/ |/| | | | | | | * changes: Handle adb sync with Bionic under /bionic Proper mount namespace configuration for bionic
| * Handle adb sync with Bionic under /bionicJiyong Park2019-01-302-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: We now have two sets of Bionic: the bootstrap Bionic which is at /system/{lib|bin}/bootstrap for early processes and the default Bionic which is from the runtime APEX for all the others. In order to give the same path for Bionic to both categories of processes, the init prepares two mount namespaces and bind-mount appropriate Bionic files onto the common mount points under /bionic. For example, /system/bin/bootstrap/linker is bind-mounted to /bionic/bin/linker for the early processes. Likewise, /apex/com.android.runtime/bin/linker is bind-mounted to the same path for rest of the processes. In addition, in order not to propagate mount events in one mount namespace to the other namespace, /bionic itself is created as a mount namespace (via self bind-mount) and its propagation type is set to private. Changes required: This however requires some adjustments to adb sync and remount mechanism. For remounting, /bionic path should also be re-mounted for RW, because it is a RO mount in the beginning. This remounting is done only for the system-as-root devices where entire / can be re-mounted as RW. For synching, the sync thread creates a temporary mount namespace where there is no bind-mount. This ensures that a path that the thread handles is pointing to the correct file that is expected from the client side. In addition, push operation to /bionic path is done without unlinking. This is required because the mount points under /bionic are gone in the current mount namespace but are still active in other mount namespaces. If unlinked, the existing mounts on the path are all silently removed. In order to prevent the unwanted situation, the moint points are not unlinked but truncated to 0. This however is not a significant problem because the files that serve as mount points do not carry any useful information (i.e. the content is meaningless). Bug: 879416 Test: adb sync adb push <random_file> /bionic/bin/linker64 adb push <random_file> /system/bin/bootstrap/bin/linker64 system/core/fs_mgr/tests/adb-remount-test.sh Change-Id: Id87dc9ee7ec5c43d06b54969b55e2cb394329317
* | Fix: Propagate cmd args to multi-package sessions.Dario Freni2019-01-301-0/+4
|/ | | | | | | Test: adb install-multi-package --staged file1.apk file2.apk. Verified that --staged is propagated. Bug: 118865310 Change-Id: I59cd5c49b4a60ab7bf7481732cd3bd3205820d7a
* Merge "adb: turn off fastdeploy."Josh Gao2019-01-292-8/+20
|\
| * adb: turn off fastdeploy.Josh Gao2019-01-292-8/+20
| | | | | | | | | | | | | | | | | | | | The PDK doesn't have frameworks/base, so having a dependency from adb to a library in there breaks the build. #ifdef out fastdeploy until we figure out what we're going to do here, to unbreak the PDK build. Bug: http://b/118782743 Test: treehugger Change-Id: I638cf09e5013935e112c7a57dae0e7e94e1a4680
* | Merge "Remove the rest of users of the old style fstab"Treehugger Robot2019-01-292-15/+17
|\ \ | |/ |/|
| * Remove the rest of users of the old style fstabTom Cherry2019-01-282-15/+17
| | | | | | | | | | | | | | | | And deprecate one more old style function that is not used after this change. Test: boot, disable and enable verity Change-Id: Id509f479850120352b4ea4dc3b6c40f6e8e2e53e
* | adb: Fix incorrect logging statementGreg Kaiser2019-01-281-1/+2
|/ | | | | | | | | | We were logging "fd.get()" after we had already done a "std::move(fd)". That won't log the value we were hoping for. We instead cache the file descriptor value in a local int prior to the move(), and log that. Test: TreeHugger Change-Id: I715874ac63329280ffb55881fb2590fb31dc2457
* Merge "Add native vsock support to ADB."Treehugger Robot2019-01-267-25/+208
|\
| * Add native vsock support to ADB.Cody Schuffelen2019-01-257-25/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vsock is a socket address family for communicating into and out of virtual machines. Addresses have a port and CID. The CID is unique to each virtual machine on the computer. The VM host always has CID 2. http://man7.org/linux/man-pages/man7/vsock.7.html Inside the android guest, the adb daemon hosts a vsock server with VMADDR_CID_ANY, automatically using the guest CID. The adb server can now connect to addresses of the form vsock:cid:port, where the CID must be specified and the port defaults to 5555. This is a significant speed improvement for ADB connections in Cuttlefish, with 150-200 MB/s for `adb push` and 100-150 MB/s for `adb pull`. It also allows removing some proxying steps from Cuttlefish, simplifying the full connection path, and removes a dependency on the unstable ivshmem protocol. Commands tested against a Cuttlefish VM with CID 3: adb connect vsock:3:5555 adb -s vsock:3:5555 shell adb disconnect vsock:3:5555 Supporting "adb disconnect" and "adb -s" required modifying some of the parts that parse addresses / serials. push/pull trials with native adb vsock support in cuttlefish: 100m: 1 file pushed. 297.6 MB/s (104857600 bytes in 0.336s) 100m: 1 file pushed. 270.3 MB/s (104857600 bytes in 0.370s) 100m: 1 file pushed. 271.7 MB/s (104857600 bytes in 0.368s) 100m: 1 file pushed. 250.5 MB/s (104857600 bytes in 0.399s) 100m: 1 file pushed. 277.1 MB/s (104857600 bytes in 0.361s) 100m: 1 file pushed. 263.5 MB/s (104857600 bytes in 0.379s) 100m: 1 file pushed. 242.6 MB/s (104857600 bytes in 0.412s) 100m: 1 file pushed. 271.8 MB/s (104857600 bytes in 0.368s) 100m: 1 file pushed. 267.1 MB/s (104857600 bytes in 0.374s) /data/local/tmp/100m: 1 file pulled. 212.8 MB/s (104857600 bytes in 0.470s) /data/local/tmp/100m: 1 file pulled. 236.7 MB/s (104857600 bytes in 0.423s) /data/local/tmp/100m: 1 file pulled. 201.2 MB/s (104857600 bytes in 0.497s) /data/local/tmp/100m: 1 file pulled. 255.6 MB/s (104857600 bytes in 0.391s) /data/local/tmp/100m: 1 file pulled. 199.6 MB/s (104857600 bytes in 0.501s) /data/local/tmp/100m: 1 file pulled. 214.6 MB/s (104857600 bytes in 0.466s) /data/local/tmp/100m: 1 file pulled. 254.2 MB/s (104857600 bytes in 0.393s) /data/local/tmp/100m: 1 file pulled. 212.5 MB/s (104857600 bytes in 0.471s) /data/local/tmp/100m: 1 file pulled. 218.9 MB/s (104857600 bytes in 0.457s) /data/local/tmp/100m: 1 file pulled. 223.6 MB/s (104857600 bytes in 0.447s) Bug: 121166534 Change-Id: I50f21fb5c9acafb8daa789df4e28c9e1bbbbf2ef Test: adb connect/shell/disconnect
* | adb: convert more stuff to unique_fd.Josh Gao2019-01-2315-176/+108
|/ | | | | | | Test: adb_test Test: adbd_test Test: test_device.py Change-Id: Ie75f0b811d2c75d508e6ecffb40579308f5789d0
* adbd: compile for host.Josh Gao2019-01-2318-308/+578
| | | | | | | | | Preparatory step for testing adb on GCE on non-linux hosts: instead of pointing them at a device (emulated or otherwise), point them at adbd running on a linux host instead. Test: adbd & adb connect localhost:5555; adb -e wait-for-device shell Change-Id: Ib22d51a4fc9e6e68f71bf1b3b9b2e1b0bd844760
* Merge "Fix fastdeploy failure in Windows"Henry Daitx2019-01-231-4/+9
|\
| * Fix fastdeploy failure in WindowsHenry Daitx2019-01-231-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adb --fastdeploy creates a TemporaryFile to which the stdout for a shell command is redirected. This happens while the file is still open (the TemporaryFile object holds the file handle). In Linux this works, but Windows blocks the operation with an error of "The process cannot access the file because it is being used by another process". This change closes the file before the shell tries to write to it. Test: mm -j 72 Test: adb install --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk Bug: 122592986 Change-Id: Iaaaf62cda43e4714d7f979e6a690549b383a7b82
* | Merge "adb: win32: improve console output on Windows 10"Josh Gao2019-01-231-11/+67
|\ \
| * | adb: win32: improve console output on Windows 10Spencer Low2018-11-061-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Windows 10's improved virtual terminal emulation to handle more terminal sequences, to fix console resize artifacts, and to fix issues with the last column. `top' and `more' work well now. Use a sensible default TERM value of xterm-256color. Test: manual on Windows 10 Bug: https://issuetracker.google.com/issues/37081235 Change-Id: If6612f3bb7db1ecaaa4b7930c9e54075ba7abb3f Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* | | Merge "adb: win32: LinePrinter Unicode support"Josh Gao2019-01-231-7/+8
|\ \ \
| * | | adb: win32: LinePrinter Unicode supportSpencer Low2018-09-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: Win10: adb push, adb install with Unicode filenames, resize console during test Change-Id: I19cb68a09a4e217fe06329185f4ede0656daa5a6 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* | | | Adding new feature to adb "abb".Alex Buynytskyy2019-01-183-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will allow clients to detect if abb is supported. Test: manual BUG: 111621042 Change-Id: Ifddabe49214882a6c6ad898c7e2a0f5cc92458d8
* | | | Merge "Combine tcp_connect and socket_spec_connect."Cody Schuffelen2019-01-186-83/+79
|\ \ \ \
| * | | | Combine tcp_connect and socket_spec_connect.Cody Schuffelen2019-01-176-83/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it easier to add new types of transports by combining the logic the adb server and adb daemon use to connect to things. Bug:121166534 Test: adb connect against a cuttlefish instance over the shm proxy. Change-Id: Ic7fc848c60a85eef968c3735838c87cb7fdaf38b
* | | | | Merge "Disable dexpreopt for deployagent"Treehugger Robot2019-01-171-0/+3
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Disable dexpreopt for deployagentHenry Daitx2019-01-171-0/+3
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platform-tools/deployagent.jar is built incorrectly for userdebug sdk builds (which the build machines in android-build use). In eng builds dexpreopt is disable by default, so the file is built correctly. This change disables dexpreopt for deployagent in all builds, for consistency. Bug: 122831369 Test: lunch sdk-eng Test: make sdk Change-Id: I370f0536d906690b153f114ba3dd589a14d222d4
* | | | Multi-package support for APEX.Dario Freni2019-01-161-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL introduces two changes to adb install-multi-package: - If there is at least one apex package in the list of packages, use the --staged parameter for both the parent and the child sessions - When the package being sent is an apex, use the --apex parameter Bug: 118865310 Test: Printed out the resulting commands and verified that both non-staged and staged workflow are accepted by PackageManager. Tried scheduling install sessions for a mix of APK/APEX, only APKs, only APEX. Change-Id: I8d1a6a7c5408fb95c10d79e38ddaf115a46f5d8b
* | | | Merge "adb: switch install to unique_fd."Treehugger Robot2019-01-161-75/+70
|\ \ \ \ | |/ / / |/| | |
| * | | adb: switch install to unique_fd.Josh Gao2019-01-111-75/+70
| | | | | | | | | | | | | | | | | | | | Test: mma Change-Id: I9474c003e0eb4a8cb183090a2e525d78932d3bea
* | | | Merge "Admit that there's more `adb install` help available."Treehugger Robot2019-01-121-1/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Admit that there's more `adb install` help available.Elliott Hughes2019-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | Test: adb --help Change-Id: I1e4d4250ef8bc55cfa660f87ebdbd7d664509266
* | | | Adds atomic install support to adbPatrick Baumann2019-01-113-1/+199
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an install-atomic command to adb that is shorthand for creating an atomic install session and an individual session for each APK supplied to the command. Bug: 109941548 Test: run command with multiple APKs, observe atomic install Change-Id: I2817a1ed2d312925d9c7bd621e6c82670a6275fd
* | | Merge "Only set mdns_registered on success"Josh Gao2019-01-091-1/+1
|\ \ \
| * | | Only set mdns_registered on successGustav Svensson2019-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In setup_mdns_thread mdns_registered should only be set to true if DNSServiceRegister was successful. Test: N/A Change-Id: I8a2798cced91b05b7d8bf5f0df4d16719c581dee Signed-off-by: Gustav Svensson <gustav.svensson@volvo.corp-partner.google.com>
* | | | Merge "adbd: Automatically disable verity in adb remount."David Anderson2019-01-092-43/+43
|\ \ \ \ | |/ / / |/| | |
| * | | adbd: Automatically disable verity in adb remount.David Anderson2018-12-172-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before overlayfs, we supported deduplicated filesystems by undoing deduplication in recovery. This required an extra reboot cycle, so we changed "adb remount" to disable verity and boot to recovery in one command. After overlayfs, adb remount is still trying to undo deduplication, which leads to very confusing messages. This patch makes things a bit clearer. "adb remount" will disable verity, which installs overlayfs. "adb remount -R" will do the same except automatically reboot. Bug: N/A Test: adb remount on dynamic partitions device Change-Id: Id72f6b9e2297c2f4d5722d5679f6264fe660e631
* | | | Adding Android Binder Bridge (abb) utility launched from adbd.Alex Buynytskyy2019-01-0711-93/+535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once launched, abb will listen for incoming Binder cli requests. Executing in-process provides 6x latency improvement (125ms vs 25ms on PixelXL) for commands like 'package path' Intended usage by Android Studio for fast deployment and patching of APKs. Test: manual BUG: 111621042 Change-Id: Ica84eb2ec9628efa441ecd627b119f3361feaf9f
* | | | adbd: strip nulls from all service strings.Josh Gao2018-12-272-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Other services are checking for exact equality, like jdwp. Test: adb jdwp Change-Id: I1081904621b111b0143a275bd9337f903fe9c111
* | | | adb: switch connect_to_remote to string_view.Josh Gao2018-12-263-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: test_adb.py Test: test_device.py Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: Icce121a4c62bf0fa636a35bcae31d057cdff8fd2
* | | | adb: switch skip_host_serial to string_view.Josh Gao2018-12-263-99/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename it to something more appropriate, while we're at it. Test: test_adb.py Test: test_device.py Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: I0f95d348eeacb45a810696d748c8340d2068f666
* | | | adb: add stroll equivalent for string_view.Josh Gao2018-12-262-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: I1d89913474fcd1aa4a856b5e4583a3c1f076ddd4