@Shimon Elbazは正しいです。
「戻るキー」は、変更を保存するのに役立ちます。
私にとって(Android 4.4.2で)次のスクリプトは機能します:
adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Android Auto22232342' -e phone 51115111
adb shell input keyevent 4
adb shell input keyevent 4
adb shell input keyevent 4
HW戻るボタンを 3 回押す必要があります
。
私の仕事は、デバイスに 50 の連絡先を追加することでした。そのために、単純な bash スクリプトを作成しました。
contactCount=50
if (( $# != 0 ))
then
let contactCount=$1
fi
for (( c=0; c<contactCount; c++))
do
adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Test'$c -e phone 511151$c
adb shell input keyevent 4
adb shell input keyevent 4
adb shell input keyevent 4
wait $pid
done
adb shell input keyevent 4
50 件の連絡先を追加するには、パラメーターを指定せずにスクリプトを実行します。
./script.sh
他の数の連絡先を追加するには、パラメーターを追加します。
./script.sh
元。3 つの連絡先を追加するには:
./script.sh 3
また、このアクションを行うための簡単な方法があると思います。喜んで見ていきます =)
ご清聴ありがとうございました。