Difference between pages "Doc: adb intro/ja" and "Translations:Doc: adb intro/2/ja"

From CyanogenMod
(Difference between pages)
Jump to: navigation, search
 
 
Line 1: Line 1:
<languages />
+
[[wikipedia:Android_Debug_Bridge|ADB]] ("<code>adb</code>"), or the Android Debug Bridge, is a development tool included with the [[sdk|Android SDK]] (Software Developer Kit), which allows for communication from an Android device (such as a phone or tablet) to a personal computer, and vice-versaThis communication can be made over a wifi connectionHowever more commonly, it is made via a USB cable.  <code>adb</code> can also be used by developers for communicating from a computer to a virtual android machine that is also running on the computer.
 
+
== What is adb? ==
+
 
+
[[wikipedia:Android_Debug_Bridge|ADB]] (<code>adb</code>),或 Android 调试桥,是包含在 [[sdk|Android SDK]] (软件开发者工具包) 中的一款开发工具,它允许 Android设备(比如手机或平板)与个人电脑相互通讯。通讯可以通过 wifi 连接进行。不过,更普遍的方式是通过 USB 线通讯。<code>adb</code> 也可被开发者用于计算机与在计算机中运行的 Android 虚拟机之间进行通讯。
+
 
+
<code>adb</code> 是 Android 开发时的“瑞士军刀”。它提供了大量的功能,可以通过这个命令查看详情:<code>[[adb --help]]</code>
+
 
+
== 常用的 adb 命令 ==
+
 
+
CyanogenMod 中包括的,可以在计算机附属的终端程序中执行的,最常用命令如下:
+
 
+
* <code>adb shell</code> —— 该命令在计算机中提供了与设备的[[wikipedia:command-line interface|命令行]]会话相应的[[wikipedia:shell (computing)|shell]]接口。在实际使用中,这使用户可以“进入”他们设备,就像使用 Linux 或者 Mac OS X计算机一样。个别的外壳命令可以通过键入 <code>adb shell <要在设备上执行的命令></code> 发送到设备来执行。
+
 
+
* <code>adb push <local> <remote></code> -- this command pushes a local file on the computer to a remote file on the device.  You can include the full path to either the local or remote file.
+
 
+
* <code>adb pull <remote> [<local>]</code> -- this command will pull a remote file on the device (you can include the path) to either a specified location on the computer or, if no destination is specified, to the current directory where the command was issued.
+
 
+
* <code>adb logcat</code> -- this command allows you to view the device log in real time.  It is also very [[Doc:_debugging_with_logcat|useful for discovering and reporting bugs]].
+
 
+
* <code>adb install <file></code> -- this is used to "[[Basic_concepts#"side-loading"|side-load]]" apps (in their .apk format) to the device.
+
 
+
There are many more useful commandsCheck out the full instruction list [[adb --help|here]].
+
 
+
== Downloading and installing <code>adb</code> ==
+
 
+
Although <code>adb</code> can be downloaded as a simple binary executable file, perhaps the best way to get adb is to install the [[sdk|Android SDK]] directly from GoogleThat will ensure that, as <code>adb</code> is updated with the rest of the SDK, you can always have the latest version.  <code>adb</code> will be located in the <code>/platform-tools</code> directory inside the SDK directory.
+
 
+
==Secure USB Debugging (NEW in Android 4.2.2)==
+
 
+
In Android 4.2.2 (which corresponds to CyanogenMod 10.1), Google implemented some [http://nelenkov.blogspot.com/2013/02/secure-usb-debugging-in-android-422.html new security features] for using <code>adb</code>.  The new "secure debugging" feature requires that you manually approve your computer for an adb connection.  This approval must be done from within the device, and only after any screen lock has been bypassed.
+
 
+
To access your 4.2.2 or higher device via <code>adb</code>, you '''MUST''' ensure you are using a recently-updated [[sdk|Android SDK]].  Once the sdk (and therefore adb) has been updated, you must '''adb kill-server''' and '''adb start-server''' any existing <code>adb</code> daemon running on your computer.  The first time you try to connect via adb, you should receive a prompt on your device to '''Allow usb debugging?''' for this device (along with an RSA fingerprint identifying the computer).  You may select the '''Always allow from this computer''' check box if you want the device to remember this computer, in which case you will not be prompted again when connecting your device to that specific PC.
+
 
+
== Troubleshooting <code>adb</code> ==
+
 
+
{{Paths}}
+
 
+
=== "Device not found" errors ===
+
 
+
Sometimes adb can't find your device.  One solution is to run <code>adb kill-server</code> and then <code>adb start-server</code> as root or Administrator to restart the adb daemon with elevated privileges.
+
 
+
Also, you should make sure that the '''USB debugging''' or '''Android Debug Bridge''' option (this will vary depending on the version of Android) is checked in the '''Settings''' under '''Developer Options'''.
+
 
+
{{note|note=Some devices require a file at <code>.android/adb_usb.ini</code> be added to help your computer find the correct device.  For example, the "encore" device requires that this file include a line containing <code>0x2080</code>, the identification code for the device.  If you have installed adb and are unable to find the device, you may wish to inquire as to whether this may be the case for your device.}}
+
 
+
=== libncurses.so.5 64-bit troubles ===
+
Under 64bits version of Linux Mint 14 and maybe other Debian/Ubuntu flavours <code>adb</code> shows the following error:
+
./adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
+
 
+
You can solve it by installing '''libncurses5''' i386's version. Just type <code>apt-get install libncurses5:i386</code> as root.
+

Revision as of 07:33, 5 November 2013

ADB ("adb"), or the Android Debug Bridge, is a development tool included with the Android SDK (Software Developer Kit), which allows for communication from an Android device (such as a phone or tablet) to a personal computer, and vice-versa. This communication can be made over a wifi connection. However more commonly, it is made via a USB cable. adb can also be used by developers for communicating from a computer to a virtual android machine that is also running on the computer.