Import contacts to the Android emulator with the ADB command

Source: Internet
Author: User
Tags vcard

With the commands provided by ADB, it is very easy to import contacts from your PC into the Android emulator.

You first have to prepare a fixed-format contacts.vcf file, which is the Address Book store file in Android. The format is as follows:

begin:vcardversion:3.0n:15200000000;;;; TEL; type=cell:15200000000end:vcardbegin:vcardversion:3.0n:15200000011;;;; TEL; Type=cell:15200000011end:vcard

The imported commands are as follows:

    # first clear the original address book contact    adb-s emulator-5554 Shell pm Clear com.android.providers.contacts    # will be the correct format of the Address Book file contacts.vcf, Import the Android emulator and wait for the emulator to refresh for a few seconds    adb-s emulator-5554 push contacts.vcf/sdcard/contacts.vcf    sleep 3    # from the file, Importing contacts into the Android emulator's address book, the import process is time dependent on the number of contacts.    Adb-s emulator-5554 Shell am start-t "Text/x-vcard"-D "file:///sdcard/contacts.vcf"-a Android.intent.action.VIEW COM.A Ndroid.contacts    Sleep 10

OK, if none of the above is a problem, the new contact information is added to the emulator's address book.


Import contacts to the Android emulator with the ADB command

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.