Как настроить ADB для работы с Windows. Установка и использование ADB и fastboot. Команды для работы с ADB Скачать архив adb fastboot zip

Android SDK Platform-Tools is a component for the Android SDK. It includes tools that interface with the Android platform, such as adb , and systrace . These tools are required for Android app development. They"re also needed if you want to unlock your device bootloader and flash it with a new system image.

Although some new features in these tools are available only for recent versions of Android, the tools are backward compatible, so you need only one version of the SDK Platform-Tools.

Downloads

If you"re an Android developer, you should get the latest SDK Platform-Tools from Android Studio"s SDK Manager or from the sdkmanager command-line tool. This ensures the tools are saved to the right place with the rest of your Android SDK tools and easily updated.

But if you want just these command-line tools, use the following links:

  • Download SDK Platform-Tools for Windows
  • Download SDK Platform-Tools for Mac
  • Download SDK Platform-Tools for Linux

Although these links do not change, they always point to the most recent version of the tools.

Revisions

29.0.5 (October 2019)

  • adb
    • Slight performance improvement on Linux when using many simultaneous connections.
    • Add --fastdeploy option to adb install , for incremental updates to APKs while developing.

29.0.4 (September 2019)

  • adb
    • Hotfix for native debugging timeout with LLDB (see issue #134613180). This also fixes a related bug in the Android Studio Profilers that causes an AdbCommandRejectedException , which you can see in the idea.log file.

29.0.3 (September 2019)

  • adb
    • adb forward --list works with multiple devices connected.
    • Fix devices going offline on Windows.
    • Improve adb install output and help text.
    • Restore previous behavior of adb connect without specifying port.

29.0.2 (July 2019)

  • adb
    • Fixes a Windows heap integrity crash.
  • fastboot
    • Adds support for partition layout of upcoming devices.

29.0.1 (June 2019)

  • adb
    • Hotfix for Windows crashes (https://issuetracker.google.com/134613180)

29.0.0 (June 2019)

  • adb
    • adb reconnect performs a USB reset on Linux.
    • On Linux, when connecting to a newer adb server, instead of killing the server and starting an older one, adb attempts to launch the newer version transparently.
    • adb root waits for the device to reconnect after disconnecting. Previously, adb root; adb wait-for-device could mistakenly return immediately if adb wait-for-device started before adb noticed that the device had disconnected.
  • fastboot
    • Disables an error message that occurred when fastboot attempted to open the touch bar or keyboard on macOS.

28.0.2 (March 2019)

  • adb
    • Fixes flakiness of adb shell port forwarding that leads to "Connection reset by peer" error message.
    • Fixes authentication via ADB_VENDOR_KEYS when reconnecting devices.
    • Fixes authentication-when the private key used for authentication does not match the public key-by calculating the public key from the private key, instead of assuming that they match.
  • fastboot
    • Adds support for dynamic partitions.
  • Updated Windows requirements
    • The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package .

28.0.1 (September 2018)

  • adb
    • Add support for reconnection of TCP connections. Upon disconnection, adb will attempt to reconnect for up to 60 seconds before abandoning a connection.
    • Fix Unicode console output on Windows. (Thanks to external contributor Spencer Low!)
    • Fix a file descriptor double-close that can occur, resulting in connections being closed when an adb connect happens simultaneously.
    • Fix adb forward --list when used with more than one device connected.
  • fastboot
    • Increase command timeout to 30 seconds, to better support some slow bootloader commands.

28.0.0 (June 2018)

  • adb :
    • Add support for checksum-less operation with devices running Android P, which improves throughput by up to 40%.
    • Sort output of adb devices by connection type and device serial.
    • Increase the socket listen backlog to allow for more simulataneous adb commands.
    • Improve error output for adb connect .
  • fastboot :
    • Improve output format, add a verbose output mode (-v).
    • Clean up help output.
    • Add product.img and odm.img to the list of partitions flashed by fastboot flashall .
    • Avoid bricking new devices when using a too-old version of fastboot by allowing factory image packages to require support for specific partitions.

27.0.1 (December 2017)

  • adb: fixes an assertion failure on MacOS that occurred when connecting devices using USB 3.0.
  • Fastboot: On Windows, adds support for wiping devices that use F2FS (Flash-Friendly File System).

27.0.0 (December 2017)

  • Re-fixes the macOS 10.13 fastboot bug first fixed in 26.0.1, but re-introduced in 26.0.2.

26.0.2 (October 2017)

  • Add fastboot support for Pixel 2 devices.

26.0.1 (September 2017)

  • Fixed fastboot problems on macOS 10.13 High Sierra (bug 64292422).

26.0.0 (June 2017)

  • Updated with the release of Android O final SDK (API level 26).

25.0.5 (April 24, 2017)

    Fixed adb sideload of large updates on Windows, manifesting as "std::bad_alloc" (bug 37139736).

    Fixed adb problems with some Windows firewalls, manifesting as "cannot open transport registration socketpair" (bug 37139725).

    Both adb --version and fastboot --version now include the install path.

    Changed adb to not resolve localhost to work around misconfigured VPN.

    Changed adb to no longer reset USB devices on Linux, which could affect other attached USB devices.

25.0.4 (March 16, 2017)

  • Added experimental libusb support to Linux and Mac adb

To use the libusb backend, set the environment variable ADB_LIBUSB=true before launching a new adb server. The new adb host-features command will tell you whether or not you"re using libusb.

To restart adb with libusb and check that it worked, use adb kill-server; ADB_LIBUSB=1 adb start-server; adb host-features . The output should include "libusb".

In this release, the old non-libusb implementation remains the default.

    Fixed Systrace command line capture on Mac

25.0.3 (December 16, 2016)

  • Fixed fastboot bug causing Android Things devices to fail to flash

25.0.2 (December 12, 2016)

  • Updated with the Android N MR1 Stable release (API 25)

25.0.1 (November 22, 2016)

  • Updated with the release of Android N MR1 Developer Preview 2 release (API 25)

25.0.0 (October 19, 2016)

  • Updated with the release of Android N MR1 Developer Preview 1 release (API 25)

24.0.4 (October 14, 2016)

  • Updated to address issues in ADB and Mac OS Sierra

Terms and Conditions

1. Introduction

3. SDK License from Google

4. Use of the SDK by You

5. Your Developer Credentials

6. Privacy and Information

7. Third Party Applications

8. Using Android APIs

https://privacy.google.com/businesses/gdprprocessorterms/

10. DISCLAIMER OF WARRANTIES

11. LIMITATION OF LIABILITY

12. Indemnification

14. General Legal Terms

January 16, 2019

Download Android SDK Platform-Tools

Before downloading, you must agree to the following terms and conditions.

Terms and Conditions

This is the Android Software Development Kit License Agreement

1. Introduction

1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. 1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. 1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). 1.4 "Google" means Google LLC, a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.

2. Accepting this License Agreement

2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement. 2.2 By clicking to accept, you hereby agree to the terms of the License Agreement. 2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK. 2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.

3. SDK License from Google

3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose. 3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. 3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google"s sole discretion, without prior notice to you. 3.7 Nothing in the License Agreement gives you a right to use any of Google"s trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. 3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.

4. Use of the SDK by You

4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user"s Google Account when, and for the limited purposes for which, the user has given you permission to do so. 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.

5. Your Developer Credentials

5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.

6. Privacy and Information

6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google"s Privacy Policy.

7. Third Party Applications

7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.

8. Using Android APIs

8.1 Google Data APIs 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. 8.1.2 If you use any API to retrieve a user"s data from Google, you acknowledge and agree that you shall retrieve data only with the user"s explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: , as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/ , as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.

9. Terminating this License Agreement

9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below. 9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. 9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google"s sole discretion, no longer commercially viable. 9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.

10. DISCLAIMER OF WARRANTIES

10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

11. LIMITATION OF LIABILITY

11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.

12. Indemnification

12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.

13. Changes to the License Agreement

13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.

14. General Legal Terms

14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google"s rights and that those rights or remedies will still be available to Google. 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. 14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party. 14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. January 16, 2019

Download Android SDK Platform-Tools

Before downloading, you must agree to the following terms and conditions.

Terms and Conditions

This is the Android Software Development Kit License Agreement

1. Introduction

1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. 1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. 1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). 1.4 "Google" means Google LLC, a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.

2. Accepting this License Agreement

2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement. 2.2 By clicking to accept, you hereby agree to the terms of the License Agreement. 2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK. 2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.

3. SDK License from Google

3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose. 3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. 3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google"s sole discretion, without prior notice to you. 3.7 Nothing in the License Agreement gives you a right to use any of Google"s trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. 3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.

4. Use of the SDK by You

4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user"s Google Account when, and for the limited purposes for which, the user has given you permission to do so. 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.

5. Your Developer Credentials

5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.

6. Privacy and Information

6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google"s Privacy Policy.

7. Third Party Applications

7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.

8. Using Android APIs

8.1 Google Data APIs 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. 8.1.2 If you use any API to retrieve a user"s data from Google, you acknowledge and agree that you shall retrieve data only with the user"s explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: , as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/ , as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.

9. Terminating this License Agreement

9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below. 9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. 9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google"s sole discretion, no longer commercially viable. 9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.

10. DISCLAIMER OF WARRANTIES

10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

11. LIMITATION OF LIABILITY

11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.

12. Indemnification

12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.

13. Changes to the License Agreement

13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.

14. General Legal Terms

14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google"s rights and that those rights or remedies will still be available to Google. 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. 14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party. 14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. January 16, 2019

Если у вас есть смартфон с операционной системой Android и вы часто с ним экспериментируете, что-то настраиваете или перепрошиваете, то, скорее всего, вы уже знакомы с инструментом ADB или (Android Debug Bridge). Это программа для управления смартфоном через компьютер по USB, которая содержит множество полезных команд.

Вы можете просматривать журналы, устанавливать и удалять приложения, управлять устройством и выполнять множество других полезных команд. Из этой статьи вы узнаете как пользоваться ADB в Linux, мы рассмотрим полезные команды ADB для пользователей Android и подробно разберем эту утилиту. Но сначала рассмотрим как установить сам инструмент на компьютер.

Программа ADB входит в стандартный набор утилит Android SDK. Вы можете установить эту среду и получите нужную утилиту. Но не всегда хочется тянуть на компьютер целую среду исполнения. Иногда нужна только одна программа. Ее можно очень просто установить отдельно. В Ubuntu для этого можно выполнить команду:

sudo apt install android-tools-adb

Для Red Hat, CentOS команда будет немного отличаться:

sudo yum install android-tools-adb

Если вам нужно установить ADB в Windows, то придется скачать пакет SDK Platform Tools из официального сайта.

Подготовка смартфона

Для того чтобы вы смогли использовать adb вместе со своим смартфоном вам необходимо включить режим отладки по USB. Эта возможность скрыта во всех версиях Android начиная с 4.2. Чтобы стать разработчиком сначала зайдите в "Настройки" -> "О телефоне" и семь раз нажмите на пункте "Номер сборки" :

Затем в главном меню настроек появится пункт "Для разработчиков" :

Тут необходимо поставить галочку напротив раздела "Разрешить отладку по USB" :


Теперь ваш телефон готов к работе с adb. Подключите его по USB к вашему компьютеру и начнем работать.

Полезные команды ADB

Перед тем как мы сможем управлять устройством, необходимо еще кое-что сделать. Команде adb требуется специальная служба для связи с Android необходимо ее запустить. Для этого используйте такую команду:

adb start-server

После завершения работы вы можете отключить службу чтобы она не потребляла лишние ресурсы:

Теперь можно выполнять adb команды для android.

Список устройств

Первым делом, посмотрим список подключенных устройств к нашему компьютеру. Для этого используется команда devices:

Если к системе подключено несколько смартфонов, то по умолчанию действия будут применяться к первому. Но вы можете задать нужное имя устройства с помощью опции -s. Например:

adb -s 0123456789ABCDEF logcat

Также указать имя устройства, к которому необходимо применять команды программы adb можно с помощью переменной ANDROID_SERIAL:

export ANDROID_SERIAL=0123456789ABCDEF

Тогда все команды adb будут применяться к устройству, указанному в этой переменной.

Состояние устройства

С помощью команды get-state вы можете узнать состояние устройства:

Команда вернет одно из значений: device - работает, bootloader - загружается, offline - выключено. С помощью команды status-window можно постоянно отслеживать состояние:

adb status-window

Просмотр журналов

Самое частое действие, которое приходится делать разработчикам и тестировщикам мобильных приложений в поиске ошибок - это просмотр журналов системы и приложений. Для этого применяется команда logcat:

Утилита выводит содержимое логов Android в реальном времени, так что вы сразу увидите все сообщения об ошибках. Также можно записать все в файл:

adb logcat -d > ~/android.log

С помощью опции -c можно очистить все логи на устройстве:

Не всегда нужно смотреть полный системный лог, иногда будет достаточно только увидеть сообщения нужной программы.. Для этого просто укажите имя пакета:

adb logcat com android.settings

С помощью опции --log-level можно установить уровень подробности сообщений, доступны такие варианты: V, D, I, W, E, F, S. Для выбора подробности вывода укажите нужную букву через двоеточие после имени приложения:

adb logcat com android.settings:E

Или выведем только ошибки для всей системы целиком:

Передача файлов на устройство

Если вам нужно быстро отправить файл на устройство, для этого можно использовать команду push. Вот ее синтаксис:

$ adb push /адрес/локального/файла /адрес/удаленного/файла

Например, загрузим файл из домашней папки на устройство:

adb push ~/file /sdcard/file

Файл будет мгновенно передан на устройство и вы можете в этом убедиться. Дополнительно можно использовать опцию -p для отображения прогресса, а также опцию -a чтобы сохранить оригинальный timestamp.

Таким же образом вы можете скачать файл с устройства. Синтаксис команды pull:

$ adb push /адрес/удаленного/файла /адрес/локального/файла

Например, скопируем отправленный файл обратно:

adb pull /sdcard/file ~/file1

Установка приложений

С помощью adb можно напрямую устанавливать приложения. Эта возможность может быть очень удобной для разработчиков. Команде install нужно передать только адрес apk файла:

adb install ~/Momentum_apkpure.com.apk

После этого приложение установлено и готово к работе на вашем устройстве. Если вам нужно обновить приложение до более новой версии, тогда используйте опцию -r. Это очень важно. Иначе получите ошибку:

adb -r install~/Momentum_apkpure.com.apk

Еще доступны опции -s - для установки на флешку и -d - для понижения версии программы.

Удаление приложений

Удалить приложение тоже очень просто. Для этого достаточно передать имя его пакета команде uninstall. Например, удалим браузер Firefox:

adb uninstall org.mozilla.firefox

Резервное копирование

Вы можете создать резервную копию своей прошивки и всех системных файлов Android для того, чтобы ее потом очень просто и быстро восстановить. Для этого используется команда backup. Сначала рассмотрим ее синтаксис:

$ adb backup опции пакеты

Опции указывают какие данные нужно копировать. Каждая опция может иметь приставку no, которая означает, что эти данные копировать не нужно. Рассмотрим основные опции:

  • -apk - сохранять apk файлы для программ, по умолчанию отключено;
  • -obb - сохранять расширения установленные расширения apk файлов в формате obb. По умолчанию отключено;
  • -shared - сохранять данные приложений из SD карты или памяти телефона, отключено;
  • -all - сохранить все установленные приложения;
  • -system - сохранить системные приложения, эти приложения уже входят в список all.

Последний параметр позволяет указать какие приложения нужно сохранять. Если указана опция all, то, естественно, что этот параметр не нужен. Таким образом, команда для резервного копирования системы будет выглядеть вот так:

adb backup -apk -obb -shared -all -f backup.ab

С помощью опции -f мы задаем имя файла архива, он будет сохранен в текущей папке. Если его не задать, то имя по умолчанию будет backup.ab. Вам нужно будет подтвердить создание копии на телефоне, можно ввести пароль для шифрования:

Для восстановления из резервной копии используйте команду restore. Ей достаточно передать адрес файла:

adb restore android.ab

В утилиты adb есть даже команды для перезагрузки устройства. Можно просто перезагрузить смартфон с помощью команды reboot:

Можно загрузиться в режим recovery:

adb reboot recovery

Или в режим настройки загрузчика:

adb reboot bootloader

Консоль Android

С помощью команды shell вы можете войти в консоль Android и выполнять там необходимые действия. Здесь доступно большинство привычных нам команд linux. Мы подробно рассматривали все доступные команды в статье . Сейчас же поговорим про саму команду shell и приведем несколько примеров. Чтобы войти в консоль наберите:

adb shell ls /system

Например, с помощью такой команды вы можете сделать снимок экрана:

adb shell screencap -p /sdcard/screenshot.png

А так можно снять экран смартфона на видео:

adb shell screenrecord /sdcard/video.mp4

Выводы

В этой статье мы рассмотрели как пользоваться утилитой adb для управления Android смартфоном, а также основные команды программы adb, которые вы можете применять. Команды adb shell - это те же команды, что вы можете выполнять в терминале Android, поэтому нет смысла их разбирать еще раз. Надеюсь, информация из этой статьи была вам полезной.

Об авторе

Основатель и администратор сайта сайт, увлекаюсь открытым программным обеспечением и операционной системой Linux. В качестве основной ОС сейчас использую Ubuntu. Кроме Linux интересуюсь всем, что связано с информационными технологиями и современной наукой.

(4 Голоса (ов))
Подробности Категория: Разное

Adb Run - это удобная программа на русском языке, которая поможет вам в управлении всеми командами ADB для android. С помощью этого приложения вы сможете связать компьютер со своим телефоном или планшетом. Для этого подойдет практически любой PC с установленным Windows любой версии: XP, 7, 8, 10. Перед установкой убедитесь, что у вас установлены все необходимые последние драйвера. Только в таком случае гарантируется корректная работа. Установщик Adb Run распаковывается в корень диска С. Это значительно упрощает использованию, без необходимости указания куда его ставить. В управлении вам поможет уникальный менеджер, в который уже внесены самые популярные команды и вам не нужно вводить их вручную, всего лишь выберите необходимую и отправьте запрос автоматически. Это значительно облегчит вам жизнь. Включите обновления и сможете первыми получить последнее обновление Adb Run и скачать себе на устройство. Не забудьте в настройках включить отладку по USB, иначе приложение работать не будет.

Особенности Adb Run:

  • Быстрая установка
  • Автоматизированная панель
  • Помощь новичкам
  • Приятный интерфейс
  • Правильный русский перевод

Утилиты ADB и Fastboot входят в состав комплекта разработки Android SDK (не стоит путать с Android Studio и уж тем более скачивать ее громоздкий установочный файл, если вы, конечно, не собираетесь заниматься разработкой под Android). ADB является инструментом для отладки, который позволяет получить доступ к консоли Андроид с компьютера (), подключив гаджет к ПК по USB. При этом должна быть . Fastboot предназначен для работы с устройством, когда то загружено в одноименном режиме (если такой есть на вашем аппарате).

При помощи ADB можно управлять смартфоном/планшетом с компьютера: сделать бэкап приложений, записать скринкаст, перевести смартфон в режим Recovery и многое другое. Кроме того с ADB можно работать и через Wi-Fi. Для этого на вашем устройстве должны быть получены root-права, а также понадобится специальное приложение, осуществляющее подключение к компу по сети. Например, ADB Wireless либо WiFi ADB. Но это уже материал для отдельной статьи.

Используя Fastboot, вы сможете , кастомные Рекавери ( или ), разблокировать Bootloader (на аппаратах HTC, Motorola, Sony, Nexus, Huawei, последних LG он заблокирован), очищать разделы системы.

Как установить ADB и Fastboot: инструкция

1. Перейдите на официальный сайт, откуда можно скачать Android SDK: https://developer.android.com/studio/index.html . Спуститесь вниз страницы к разделу «Command line tools only» и выберите архив для Windows.

2. Установите галочку в чекбоксе «I have read and agree with the above terms and conditions» и нажмите кнопку «Download Android Command Line Tools for Windows». Начнется загрузка архива.

3. Скачайте его и разархивируйте в корень Диска «C:».

4. Также необходимо загрузить Java Development Kit с официальной страницы . Перейдите на сайт, согласитесь с условиями лицензионного соглашения, отметив пункт «Accept License Agreement», и скачайте версию JDK, соответствующую разрядности вашей системы.

Первый способ

Вернитесь к папке c Android SDK, откройте «tools» и запустите «android».

Отметьте пункт «Android SDK Platform-tools» (а также «Google USB driver», если у вас устройство Nexus) и нажмите «Install Packages».

Про установку драйверов для других аппаратов читайте ниже.

Выберите «Accept License» и нажмите «Install».

Мой лог показал, что возникла ошибка. Но в итоге все завершилось успешно.

По завершении выполнения вышеописанных действий в папке «sdk-tools-windows-version » появится «platform-tools», а в ней будут интересующие нас «ADB» и «Fastboot».

Второй способ

Перейдите в папку «sdk-tools-windows-версия » → «tools» → «bin» и, зажав клавишу «Shift», щелкните правой кнопкой мышки по пустой области. Выберите «Открыть окно команд» либо «Открыть окно PowerShell здесь», если на ПК или ноутбуке установлена одна из последних сборок Windows 10.

Вставьте команду в PowerShell или командную строку (в PowerShell добавьте./ вначале):

Щелкните «Enter», чтобы выполнить команду. Произойдет загрузка файлов и появится запрос на установку:

Чтобы разрешить, введите y , то есть «yes», и нажмите «Enter», после чего начнется установка «platform-tools».

В конце в командной строке отобразится сообщение, что процедура завершилась успешно. А папка «platform-tools» с ADB и Fastboot внутри появится в «sdk-tools-windows-version ».

(!) Если по какой-либо причине не удается установить ADB и Fastboot предыдущими способами, воспользуйтесь третьим вариантом – просто скачайте архив «platform-tools» и разархивируйте на диск «C:».

Устанавливаем драйверы ADB и Fastboot для Windows

Чтобы компьютер смартфон либо планшет, необходимо загрузить драйвер USB:

  • Samsung – драйвер входит в состав утилиты Kies: http://www.samsung.com/ru/support/usefulsoftware/KIES/ либо же его можно скачать отдельно, выбрав нужную модель: http://www.samsung.com/us/support/downloads
  • HTC – в составе HTC Sync Manager: http://www.htc.com/ru/software/htc-sync-manager/
  • Nexus – драйвер Android устанавливается вместе с Android SDK, о чем писалось выше.
  • Huawei – совместно с утилитой HiSuite: http://consumer.huawei.com/minisite/HiSuite_en/index.html
  • LG – установите LG PC Suite: http://www.lg.com/ru/support/software-firmware
  • Motorola – смотрите на этой странице: https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481
  • Sony Xperia – драйверы FastBoot для всех моделей находятся здесь: http://developer.sonymobile.com/downloads/drivers/
  • Xiaomi – Mi PC Suite: http://pcsuite.mi.com
  • MTK – для китайских аппаратов на чипах MediaTek: http://online.mediatek.com/Public%20Documents/MTK_Android_USB_Driver.zip
  • Lenovo – выберите модель смартфона, планшета и загрузите ADB драйвер: http://support.lenovo.com/us/en/GlobalProductSelector
  • Решения для девайсов других производителей ищите на их официальных сайтах.

Существуют различные универсальные установщики ADB драйверов (к примеру, этот: http://adbdriver.com/downloads/) – ими тоже можно пользоваться, например, когда по какой-то причине не удалось установить официальное решения.

Если для вашей модели идет драйвер без установщика, придется выполнить следующие действия:

1. Зайдите в «Панель управления» → «Диспетчер устройств». В Windows 10 достаточно нажать правой кнопкой мышки по меню «Пуск» и выбрать «Диспетчер устройств».

2. Найдите в списке девайс для которого нужно установить драйверы. Щелкните правой кнопкой мышки и нажмите «Обновить драйверы».

Как видите, компьютер корректно распознает мой планшет Nexus 7. Если ваш ПК определяет смартфон неправильно или напротив устройства стоит желтый треугольник с восклицательным знаком внутри, «ручная» установка драйверов Android для вас обязательна.

3. Выберите пункт «Выполнить поиск драйверов на этом компьютере».

4. Укажите путь к папке с драйверами на ПК.

Дождитесь завершения установки и затем заново подключите гаджет к компьютеру по USB.

Как начать работать с Fastboot и ADB

Работа с ADB или Fastboot осуществляется из командной строки, утилиты запускаются двумя способами:

1: Правой клавишей мышки щелкните на «Пуск» и выберите «Командная строка (администратор)» либо «Windows PowerShell (администратор)». Далее при помощи команд укажите путь к папке с ADB и Fastboot (после ввода каждой нажимайте «Enter»).

Чтобы вернуться в корень диска «C:\», используйте:

Благодаря этой команде открываем нужную папку:

В моем случае получилось так:

cd \tools_версия -windows\platform-tools

У вас выйдет (разработчики Google изменили название архива уже после написания первоначальной редакции этой инструкции):

cd \sdk-tools-windows-version \platform-tools

Путь к Fastboot и ADB указан, теперь работаем с ними из консоли.

Чтобы не выполнять эти действия каждый раз, добавьте путь к «platform-tools» в переменную «Path». Сначала зайдите в папку, в строке навигации щелкните правой кнопкой мыши по «platform-tools» и выберите «Копировать адрес».

Перейдите в «Панель управления». Для этого нажмите «Win» + «R» и в поле «Открыть:» вставьте control . Нажмите «ОК».

Выберите «Система» → «Дополнительные параметры системы» → «Переменные среды…».

Найдите перемененную «Path», выделите ее и выберите «Изменить…».

Нажмите «Создать», вставьте путь к папке «platform-tools» и щелкните «ОК».

2: Зайдите в «sdk-tools-windows-version » → «platform-tools», затем, удерживая «Shift», щелкните правой кнопкой мыши по пустому месту и выберите пункт «Открыть окно команд» или «Открыть окно PowerShell здесь».

Введите следующее, чтобы проверить как ПК видит Android (в Windows PowerShell вставьте./ перед командой):

Не забывайте, что для работы с ADB должна быть включена отладка по USB! Больше полезных команд вы найдете в прошлой статье, ссылка есть в начале данного поста.

В статье рассмотрим стандартную утилиту ADB для управления с персонального компьютера устройствами с мобильной операционной системой Android .


Введение в ADB

Управлять всеми аспектами мобильных устройств с операционной системой Android - памятью, файловой системой, установкой и удалением программ и т.д. - можно не только на самом мобильном устройстве, но и с персонального компьютера, подключив к нему через USB-шнур смартфон или планшет . Для этого к мобильному устройству часто прилагается специальное фирменное ПО .

Программа adb устанавливает связь между устройством и компьютером, позволяет посылать команды на устройство через USB соединение и выполнять различные манипуляции с системой Android . Продвинутые пользователи сталкивались с ней при получении прав root, установке ClockworkMod Recovery.

Утилита является составной частью Android SDK, предназначенного для разработчиков. Также эту утилиту производитель смартфона может поставлять вместе с драйверами конкретного мобильного устройства. Но более подробно об установке утилиты чуть ниже.

Основные возможности интерфейса ADB:

  • просмотр подключенных к ПК устройств Android;
  • просмотр лога системы Android;
  • копирование файлов с/на устройство Android;
  • установка и удаление приложений на устройстве Android;
  • очищать раздел data на устройстве Android;
  • запускать различные скрипты управления устройством Android.


Подготовка к работе

Для начала нужно установить саму консольную утилиту adb. Существует несколько вариантов её получения.

1. Обычно в системах Windows она может установиться вместе с фирменными драйверами смартфона или планшета. Искать её обычно следует в папке Program Files в каталоге, имеющем название марки смартфона.

2. Универсальным способом получения adb для пользователей всех операционных систем является установка утилиты через менеджер Android SDK.

Для пользователей Linux драйвера устанавливать не нужно, но надо написать правило для udev. Ниже приведена последовательность создания правила для Ubuntu.

Для этого сначала нужно узнать значения переменных idVendor и idProduct вашего мобильного устройств. Сделать это можно при помощи команды lsusb в терминале, подключив устройство через USB-шнур, в результате чего должна отобразиться информация примерно такого вида:

Bus 002 Device 006: ID 12d1:1038 Huawei Technologies Co., Ltd.

Здесь idVendor - это шестнадцатеричные цифры после ID и до двоеточия. IdProduct - это следующие четыре цифры после двоеточия.

После этого создаём файл /etc/udev/rules.d/51-android.rules с правами chmod 644 и со следующим содержанием (подставлять свои значения ID и пользователя):

SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct} =="1038", MODE="0666", OWNER="пользователь"

$ sudo /etc/init.d/udev reload

В первом и втором случае получения adb очень желательно настроить переменные окружения , чтобы не вводить при запуске в консоли полный путь к установленной утилите. О том, как это делать, не раз писалось и на страницах "КВ", поэтому не будем подробно устанавливаться на этом вопросе.

Настройка персонального компьютера на этом закончена. На мобильном устройстве должна быть включена отладка по USB: "Настройки - Приложения - Разработка - Отладка по USB". Подключите ваш телефон через кабель USB и НЕ МОНТИРУЙТЕ как SD!

Для получения абсолютно всех возможностей adb мобильное устройство должно уже иметь root, и также должен быть установлен пакет Busybox (имеется в Google Play). Но всегда следует помнить, что установка прав root в некоторых случаях может лишить гарантии на ваше устройств.

Вот теперь можно приступать к работе с adb.


Работа с adb

Рассмотрим некоторые команды adb. Открываем консоль и запускаем команду

$ adb devices

Данная команда выведет список устройств, подключенных к ПК. Должно появиться что-то вроде

List of devices attached
4CA94Dxxxxx device

$ adb reboot

$ adb reboot recovery

Установка с компьютера пакета apk

$ adb install <путь_к_apk>

Удаление пакета

$ adb uninstall

Просмотреть лог работы устройства

$ adb logcat

После чего вы увидите динамический вывод системных сообщений Android. Если производить с устройством какие-либо манипуляции, это тут же будет отображаться через вывод соответствующих сообщений. Выход из режима отладки через комбинацию клавиш Ctrl+C.

И при помощи ADB можно запустить на мобильном устройстве самый настоящий шелл Unix.

$ adb shell

Запустив шелл, можно использовать все доступные на устройстве команды UNIX - cat, ls, df и другие, а также запускать сценарии.

Если есть root и Busybox, то с мобильным устройством вообще можно делать всё, что захочется. Так что, используя ADB, следует быть осторожным.

Полный список всех команд ADB можно получить, запустив adb без параметров.

Возможно, для многих утилита adb покажется сложной. В дальнейших статьях мы рассмотрим разные программы-оболочки, которые упрощают работу с этой утилитой.

Михаил АСТАПЧИК

Понравилась статья? Поделитесь ей
Наверх