向Android模擬器中大量匯入通訊錄連絡人

來源:互聯網
上載者:User

標籤:

使用adb命令向Android模擬器中大量匯入通訊錄連絡人的方法:

使用adb提供的命令, 可以非常方便地從PC中將通訊錄大量匯入android模擬器中.

首先要先準備好固定格式的vcf檔案, 該檔案即android中的通訊錄儲存格式檔案.

格式如下:

BEGIN:VCARDVERSION:2.1N:;Qiqi;;;FN:QiqiTEL;HOME:7474EMAIL;HOME:qiqi.comADR;HOME:;;Qiqi;;;;END:VCARDBEGIN:VCARDVERSION:2.1N:;Re;;;FN:ReTEL;HOME:73EMAIL;HOME:re.comADR;HOME:;;Re;;;;END:VCARDBEGIN:VCARDVERSION:2.1N:;Staill;;;FN:StaillTEL;HOME:782-455EMAIL;HOME:staill.comADR;HOME:;;Staill;;;;END:VCARDBEGIN:VCARDVERSION:2.1N:;Tian;;;FN:TianTEL;HOME:8426EMAIL;HOME:tian.comADR;HOME:;;Tian;;;;END:VCARDBEGIN:VCARDVERSION:2.1N:;Uuu;;;FN:UuuTEL;HOME:888EMAIL;HOME:uuu.comADR;HOME:;;Uuu;;;;END:VCARDBEGIN:VCARDVERSION:2.1N:;Victory;;;FN:VictoryTEL;HOME:842-8679EMAIL;HOME:victory.comADR;HOME:;;Victory;;;;END:VCARD

  匯入的命令如下:

 1 // 清除原通訊錄連絡人 2  3 adb -s emulator-5554 shell pm clear com.android.providers.contacts   4  5  6 // 將正確格式的通訊錄檔案contacts.vcf, 匯入android模擬器中, 並等待模擬器重新整理幾秒鐘  7  8 adb -s emulator-5555 push contacts.vcf /sdcard/contacts.vcf   9 10 11 // 從檔案中, 將連絡人import到android模擬器的通訊錄中, 匯入處理程序耗時依連絡人數量而定.  12 13 adb -s emulator-5554 shell am start -t "text/x-vcard" -d "file:///sdcard/contacts.vcf" -a android.intent.action.VIEW com.android.contacts  
View Code

 

向Android模擬器中大量匯入通訊錄連絡人

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.