The Twilio Dev Phone makes it easier for you to test your Twilio apps when you don't have access to SMS and calling capabilities. It uses existing Twilio products to send and receive calls and SMS from your local development environment.
To use the Dev Phone, you'll need to first have an up-to-date installation of the Twilio CLI, as well as access to a spare Twilio phone number. That means that if you're using a trial account, you'll need to upgrade.
Once you've installed the Twilio CLI, you're ready to add the Dev Phone plugin with the following command:
twilio plugins:install @twilio-labs/plugin-dev-phone
Once it's installed, you can run the Dev Phone with the following command:
twilio dev-phone
You should see output that looks something like this:
1# OUTPUT23Hello 👋 I'm your dev-phone and my name is dev-phone-XXXXXX4567✅ I'm using your profile API key.891011💻 Creating a new conversation...1213✅ I'm using the conversation CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX from service ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX14151617💻 Creating a new sync list for call history...1819✅ I'm using the sync service ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX20212223💻 Deploying a Functions Service to handle incoming calls and SMS...2425✅ I'm using the Serverless Service ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX26272829💻 Creating a new TwiML App to allow voice calls from your browser...3031✅ I'm using the TwiML App APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX32333435🚀 Your local webserver is listening on port 30013637🌐 Opening http://localhost:3001/ your browser3839▶️ Use ctrl-c to stop your dev-phone
These services are created when you start the Twilio Dev Phone. When you stop it (by pressing CTRL + C
), the Twilio Dev Phone will delete the resources from your account. If something happens and you're not able to manually tear down the Dev Phone, then the old resources will be removed the next time you run the Dev Phone plugin.
You may be wondering: is this the tool that I actually need? We think it's best to start with the following question: Am I having issues testing my Twilio app with my personal cell phone?
If the answer is yes, then the Dev Phone might be the right tool for you. Some example use cases include:
In any of these scenarios, you can use the Dev Phone as a replacement for your Twilio phone number.
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 will come in to the Dev Phone tab in your browser!
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".
To make an outbound call, fill out the Destination number field and then click the "Call" button.
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.