Introducing the Twilio Dev Phone

May 02, 2022
Written by
Reviewed by

dev-phone-banner

I used to be an adjunct professor at Berkeley City College. My class was learning about 3rd party APIs, and so I set aside a classroom day to work on Twilioquest. On the day of the event, my students showed up and fired up their laptops...

And I learned that my classroom had no cell service.

While it was funny to watch my students run outside to a window to try and get some service and "catch" the text message, situations like this show us a clear issue: sometimes, our personal cell phones can be a blocker to our Twilio development. That's why Twilio's Developer Advocacy team is excited to announce the Twilio Dev Phone, a Twilio CLI plugin that allows you to send and receive calls and SMS straight from your local development environment.

A screenshot of the dev phone UI

You can learn more about the dev phone and how to use it in our documentation. Additionally, the dev phone is fully open source, so feel free to peruse the code and open a pull request! If you already have the Twilio CLI installed, however, it's as easy as running the following commands:

twilio plugins:install @twilio-labs/plugin-dev-phone
twilio dev-phone

Why do I need the Dev Phone?

If your Twilio development involves SMS or Voice, the issues my students ran into may be familiar to you. There are other examples, though:

  • You find yourself without cell service while developing your Twilio app.
  • You're living in or visiting a country where purchasing a phone number requires weeks or months to get through the appropriate approvals, and so you haven't been able to reliably test your app.
  • It's the end of the month and you're fresh out of minutes and running low on messages.
  • Your phone is just out of reach, and you're annoyed that you have to get up from your development cocoon to send a test SMS to your app.

In all of these scenarios, having a phone as a developer tool, rather than a personal device, can help unblock your development process.

Use the Dev Phone

The following examples are snippets from the Dev Phone documentation:

Configure a Phone Number

In order to be accessible on the telephone network, your Dev Phone needs a phone number. The dev phone will show you a list of all the phone numbers in your account, with a warning next to numbers that currently have their webhooks configured. Currently, using the Dev Phone means that a phone number's webhooks will be overwritten, which is why we recommend NOT using phone numbers that are currently configured. Especially if a number is being used in production, your customers' communications could land in your Dev Phone tab in your browser, instead of in your server, where they belong.

Send a Message

A gif showing a message being sent with the Dev Phone UI

To send a message, fill out the Destination number field. Then, type in a message in the SMS interface (on the lower right-hand corner of the Dev Phone) and then click "Send".

Make an Outbound Call

A gif showing a call being made with the Dev Phone UI

To make an outbound call, fill out the Destination number field and then click the "Call" button.

Receive Inbound Calls/SMS

To receive inbound calls and SMS, call or text the Dev Phone's configured phone number. Your communications should pass directly through to the Dev Phone, where you can click to accept.

Next Steps

While we work on further feature development, remember that the Dev Phone is open for contributions. Install it today and let us know what you think!