Android uses adb pull or push to copy the mobile phone file to the computer, copy the mobile phone database to the computer, and copy the computer database to the mobile phone,

Source: Internet
Author: User

Android uses adb pull or push to copy the mobile phone file to the computer, copy the mobile phone database to the computer, and copy the computer database to the mobile phone,

Let's talk about the adb command configuration first. If adb is not an internal or external command, it is not a runable program or batch file. Configure Environment Variables

1. adb is not an internal or external command, or a program or batch file that can be run.

Solution: In my computer-properties-advanced computer configuration-environment variables, find the path in the system variables and add the sdk's platform-tools.

D:\Java\android\android-sdk\platform-tools


2. Run the command line to copy the files on the host to the computer.

adb pull sdcard/1222073679.png



Copy the folder command, such as copying the log folder to the current directory of the computer

adb pull sdcard/log/


3. How to copy database files of an app to a computer

This method requires the root mobile phone

Copy the database file to the mobile phone sdcard.

E:\test>adb shellshell@hwC199:/ $ susuroot@hwC199:/ # cd /data/data/com.android.contacts/databases/cd /data/data/com.android.contacts/databases/root@hwC199:/data/data/com.android.contacts/databases # lslscontacts_app.dbcontacts_app.db-journalroot@hwC199:/data/data/com.android.contacts/databases # cp contacts_app.db /mnt/sdcard/_app.db /mnt/sdcard/                                                          <root@hwC199:/data/data/com.android.contacts/databases #


That is, after entering the su command, execute this command (copy contacts_app.db to the sdcard)

cp /data/data/com.android.contacts/databases/contacts_app.db /mnt/sdcard/

In this way, the contacts_app.db database file is copied to the mobile phone sdcard. Right-click a terminal in a folder on the computer and copy the following statement to the computer.

adb pull sdcard/contacts_app.db

4. Learn the push command by the way.

adb push aaa/contacts_app.db /sdcard/

Copy the contacts_app.db file to the mobile phone sdcard.

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.