Since i changed my phone number, i want to send most of my contacts a sms with my new number. On Ubuntu Phone this is very unconvient because the application has to switch to the contact register for every name i want to add. With over 100 of contacts this gets pretty annoying. Anybody knows a more elegant solution? Something like a check box for the conctacs register?


This is a slightly hack-ish solution and I haven't actually tested all of it (and due to the lack of a SIM card won't be able to, in the near future), but it might be helpful.

Firstly, you'll either need to either install the terminal app on your phone, if you haven't already, or connect to your phone from your computer (simply via adb shell or using ssh — for details see here). In any case, you'll need to enable developer mode on your phone.

Sending text messages via cli

According to this "Ubuntu phone gitbook", you can send sms from the command-line using /usr/share/ofono/scripts/send-sms. If you run the program without any arguments, you'll get the rather terse help message:

Usage: /usr/share/ofono/scripts/send-sms [modem] <to> <message> <delivery report>

It seems that "modem" can take the values /ril_0 and /ril_1 (for two SIM-cards — run mc-tool dump and inspect the lines "modem-objpath" if for other models these are different), "to" and "message" are self-explanatory (the telephone number and content of the message) and "delivery report" is presumably a boolean that determines whether you get a delivery report(?) — the guide sets it to 0, so we can probably do that as well.

Listing contacts via cli

Again, on the basis of the gitbook, it's possible to export your list of contacts cli to the file list_of_contact_telephone_numbers with this command:

syncevolution --export - backend=evolution-contacts | sed -n 's/^TEL;TYPE=[a-z,]*://p' | tr -d ' ' > list_of_contact_telephone_numbers

I suggest that you edit/inspect this file to remove any special numbers and check for errors.

Send SMS to all contacts

As a result, you should be able to send an SMS to all your contacts with the following:

cat list_of_contact_telephone_numbers | while read contact
    /usr/share/ofono/scripts/send-sms /ril_0 "$contact" "This is xxxx. My new phone number is +xxxx." 0

(I suggest you first test this with only one line in list_of_contact_telephone_numbers to see if it works.)

  • I tried it and worked, tough it was very hacky and i took me some hours! Thank you very much! Since i'm new to the forum, I don't know now if i should mark this answer as accepted? – morast Jul 23 '16 at 13:12
  • This sure is a good and detailed answer and from the last comments it seems to of worked. However, I sure look forward to the more user friendly solution coming. – Phil UK Jul 23 '16 at 22:37

If you type in the To field of a new message it will suggest matching contacts and you can tap to select one. Then you can type another name in the same To field and so on.

  • No solution for me because i would have to type every name, at least the first letters and i will have to remeber all the names in my phone. Still very annoying – morast Jul 19 '16 at 14:10
  • 2
    I had a look today to see if there is another method to do this, along with what Pomsky has already added. The bad news is that it does not appear that there is. I looked at trying to select all the people needed in the contacts among other things. None were any success. As Ubuntu Touch is still new and things are developing all the time, this would be a good thing to raise in Launchpad, so we know the developers are aware of it and hopefully will develop it. – Phil UK Jul 20 '16 at 2:19
  • 2
    Well, I found this bug report: pad.lv/1474292 – pomsky Jul 20 '16 at 4:19
  • Cool, at least it is logged and hopefully the developers are looking into it. @morast - it looks like at the moment typing all contacts is the best that can be done until the bug Pomsky has listed is addressed. Possibly go to the bug and mark it as affecting you. – Phil UK Jul 20 '16 at 6:07
  • 1
    Cool, thanks a lot for you help! Hope this stuff gets fixed in the next updates for Ubuntu Touch! – morast Jul 20 '16 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.