mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-25 00:50:15 +08:00
commit
69cbe62c83
@ -1,94 +0,0 @@
|
||||
ucasFL translating
|
||||
How to Back Up Your Android Data with ADB on Ubuntu
|
||||
============================================================
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
Backing up app data, text messages and the like in Android can be incredibly tedious, and sometimes costly too. Many apps on the Play Store promise to back up your data but are hit and miss or cost an arm and a leg. Did you know that there’s a better way to do this and that it can all be done on your computer?
|
||||
|
||||
<small style="box-sizing: inherit; font-size: 16px;">[Ads by Google][9]</small>
|
||||
|
||||
Android comes with a set of development tools. There are many, but the main item of interest is known as ADB (or Android Debug Bridge). It allows a user to gain direct command-line access to any Android device. With this tool anything is possible – including backing up an entire Android device! Here’s how to do it on Ubuntu.
|
||||
|
||||
**Note**: this tutorial is done with a focus on Ubuntu Linux. However, ADB is available on Windows and macOS, and the backup process can be on those platforms as well. [Download for windows and Mac][10].
|
||||
|
||||
### Installing ADB and Enabling USB Debugging
|
||||
|
||||
Open a terminal window and enter this command to install the ADB tool that will interact with Android.
|
||||
|
||||
```
|
||||
sudo apt install adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
With the ADB tool installed on the system, debugging will need to be enabled inside of Android. Start by opening the Settings area of Android. Scroll all the way to the bottom to find “About Phone” and select it. This opens a “Phone status” page. On this page scroll to the bottom again, find “Build number’ and tap on it seven times. This will enable Developer Mode.
|
||||
|
||||

|
||||
|
||||
To get to Developer Settings, press the Back button on the device to go back a page. A new option in settings will appear: “Developer options.” Tap on it to enter the developer settings area. Scroll through till you see “Android debugging” (or some variation of it), and tap it to enable the setting.
|
||||
|
||||
### Backing Up
|
||||
|
||||
Creating a backup with ADB is as simple as running one command. First, take the USB cable that corresponds with the Android device, and plug it into the PC. Then, go to a terminal and enter the following:
|
||||
|
||||
```
|
||||
adb start-server
|
||||
```
|
||||
|
||||
This will start the Android Debugging Bridge server. With this command running, quickly unlock the Android device, as ADB will force a confirmation window that must be accepted to continue.
|
||||
|
||||

|
||||
|
||||
To start the backup process, go to the terminal and enter this backup command. It’ll take text messages and other bits of app data, and store it into an encrypted file.
|
||||
|
||||
```
|
||||
adb backup -apk -shared -all -f backup-file.adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
Running the backup command will prompt the user to look at Android and set a password for the file before Android will run the backup procedure. Enter a strong, memorable password. Then, select the “back up my data” button. The backup may take some time, but when it is finished, a file named “backup-file.adb” will be in “/home/username/.”
|
||||
|
||||
### Restoring
|
||||
|
||||
To restore the backup, enable the ADB server (like mentioned above) and run this command to restore the data.
|
||||
|
||||
```
|
||||
adb restore backup-file.adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
Once again, go to Android, as ADB will prompt the user to enter a password. This time, instead of creating a password, all that is required is entering the one created from earlier. After that select “restore my data,” and the restoration process will begin. Be patient, as this may take a bit of time.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Not many Android users know this, but ADB is incredibly powerful. It can be used for more than gaining root access on a device. In fact, there are so many things that can be done with this tool, it’d take more than one article to cover all of it!
|
||||
|
||||
What tricks do you know with ADB? Let us know below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.maketecheasier.com/back-up-android-data-adb-ubuntu/
|
||||
|
||||
作者:[Derrik Diener][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.maketecheasier.com/author/derrikdiener/
|
||||
[1]:https://www.maketecheasier.com/author/derrikdiener/
|
||||
[2]:https://www.maketecheasier.com/back-up-android-data-adb-ubuntu/#comments
|
||||
[3]:https://www.maketecheasier.com/category/linux-tips/
|
||||
[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F
|
||||
[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F&text=How+to+Back+Up+Your+Android+Data+with+ADB+on+Ubuntu
|
||||
[6]:mailto:?subject=How%20to%20Back%20Up%20Your%20Android%20Data%20with%20ADB%20on%20Ubuntu&body=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F
|
||||
[7]:https://www.maketecheasier.com/download-appx-files-from-windows-store/
|
||||
[8]:https://www.maketecheasier.com/airy-youtube-video-downloader-2/
|
||||
[9]:https://support.google.com/adsense/troubleshooter/1631343
|
||||
[10]:https://developer.android.com/studio/command-line/adb.html
|
@ -0,0 +1,95 @@
|
||||
如何在 Ubuntu 上使用 ADB 备份你的 Android 数据
|
||||
============================================================
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
备份 Android 系统上的应用数据、文本信息和收藏是非常乏味的,有时还要花费很大的代价。电子市场的许多应用都承诺可以备份数据但却效果不佳或者需要付大量费用。你是否知道有一种更好的方法可以来做这件事,并且在你的电脑上就可以完成?
|
||||
|
||||
<small style="box-sizing: inherit; font-size: 16px;">[广告来自谷歌][9]</small>
|
||||
|
||||
Android 自带一套开发工具。有许多种开发工具,但人们最为感兴趣、最有名的项目是 ADB(或者叫做 Android 调试桥)。它允许用户直接通过命令行访问任何 Android 设备。有了这个工具,一切皆有可能 - 包括备份整个 Android 设备。在这篇文章中,将讨论如何在 Ubuntu 系统上完成这件事。
|
||||
|
||||
**注**:这篇教程是针对 Ubuntu Linux 系统的。但是, ADB 在 Windows 系统和 Mac 上也是可用的,也可以在这些平台上对 Android 数据进行备份。[下载针对 Windows 和 Mac 的 ADB 版本][10]
|
||||
|
||||
### 安装 ADB 并启用 USB 调试
|
||||
|
||||
打开一个终端窗口然后输入下面的命令来安装 ADB,它将与 Android 进行会话。
|
||||
|
||||
```
|
||||
sudo apt install adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
在系统上安装好 ADB 工具以后,调试需要在 Android 内部启动。首先打开 Android 的设置区域。然后一直滚动到底部找到“关于手机”并点击。这将打开“电话状态页”。在这一页面上再次滚动到底部,找到“版本号”并点击七次。从而启动“开发者模式”。
|
||||
|
||||

|
||||
|
||||
为了进入开发者设置,按设备上的返回键返回上一页面。在“设置”中将会出现一个新的选项:“开发者选项”。点击“开发者选项”进入开发者设置区域。滚动页面直到看到 “Android 调试”(或它的一些其他名称),点击它,从而启用设置。
|
||||
|
||||
### 备份
|
||||
|
||||
使用 ADB 创建一个备份就如同运行一个命令一样简单。首先,用一根与 Android 设备匹配的 USB 线将 Android 设备连接到电脑上。然后打开终端运行下面的命令:
|
||||
|
||||
```
|
||||
adb start-server
|
||||
```
|
||||
|
||||
这将启动 ADB 服务器。通过运行这个命令,会很快解锁 Android 设备,因为 ADB 将强制出现一个确认窗口,必须选择继续。
|
||||
|
||||

|
||||
|
||||
要启动备份进程,打开终端然后执行下面的备份命令。该命令将读取 Android 上的文本信息以及其他应用数据,然后存入加密文件中。
|
||||
|
||||
```
|
||||
adb backup -apk -shared -all -f backup-file.adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
当运行备份命令时,会在 Android 启动备份进程前提示用户查看 Android 并设置加密文件的密码。请输入一个强大、容易记住的密码。然后,点击“备份我的数据”按钮。备份过程将会花费一定时间。备份完成以后,在目录 “/home/username/” 中会出现一个叫做 “backup-file.adb” 的文件。
|
||||
|
||||
### 恢复备份
|
||||
|
||||
要恢复备份,首先启用 ADB 服务器(像上面提到的一样),然后运行下面这个命令来还原备份数据:
|
||||
|
||||
|
||||
```
|
||||
adb restore backup-file.adb
|
||||
```
|
||||
|
||||

|
||||
|
||||
再次转到 Android, 因为 ADB 将提示用户输入密码。这次,不是创建一个密码,而是需要输入之前创建的那个密码。在点击 “恢复我的数据” 以后,恢复进程就开始了。耐心点,因为这可能需要一定时间。
|
||||
|
||||
### 结论
|
||||
|
||||
没有多少 Android 用户知道这样备份数据,但是 ADB 的确很强大。利用它甚至可以获得对一个设备的 root 访问。事实上,利用这个工具还可以做很多的事情,因此需要更多的文章来讨论它。
|
||||
|
||||
你还知道 ADB 可以用来干什么吗?请在下面的评论区告知我们!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.maketecheasier.com/back-up-android-data-adb-ubuntu/
|
||||
|
||||
作者:[Derrik Diener][a]
|
||||
译者:[ucasFL](https://github.com/ucasFL)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.maketecheasier.com/author/derrikdiener/
|
||||
[1]:https://www.maketecheasier.com/author/derrikdiener/
|
||||
[2]:https://www.maketecheasier.com/back-up-android-data-adb-ubuntu/#comments
|
||||
[3]:https://www.maketecheasier.com/category/linux-tips/
|
||||
[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F
|
||||
[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F&text=How+to+Back+Up+Your+Android+Data+with+ADB+on+Ubuntu
|
||||
[6]:mailto:?subject=How%20to%20Back%20Up%20Your%20Android%20Data%20with%20ADB%20on%20Ubuntu&body=https%3A%2F%2Fwww.maketecheasier.com%2Fback-up-android-data-adb-ubuntu%2F
|
||||
[7]:https://www.maketecheasier.com/download-appx-files-from-windows-store/
|
||||
[8]:https://www.maketecheasier.com/airy-youtube-video-downloader-2/
|
||||
[9]:https://support.google.com/adsense/troubleshooter/1631343
|
||||
[10]:https://developer.android.com/studio/command-line/adb.html
|
Loading…
Reference in New Issue
Block a user