Ways to import address book contacts to the Android emulator using the ADB command _android

Source: Internet
Author: User
Tags vcard

The example in this article describes how to import address book contacts to the Android emulator using the ADB command. Share to everyone for your reference. The implementation methods are as follows:

Using the commands provided by ADB, you can easily import the address book from your PC into the Android emulator.

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

Copy Code code as follows:
Begin:vcard
version:3.0
n:15200000000;;;;
TEL; type=cell:15200000000
End:vcard
Begin:vcard
version:3.0
n:15200000011;;;;
TEL; type=cell:15200000011
End:vcard

The imported commands are as follows:
Copy Code code as follows:
# clear the original address book contact first
Adb-s emulator-5554 Shell pm Clear com.android.providers.contacts
# CONTACTS.VCF The Address Book file in the correct format, import into 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, import the contact into the Android emulator's address book, and the process will take time depending 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 the case, the emulator's address book adds new contact information.

I hope this article will help you with your Android program.

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.