The Twilio Dev Phone makes it easier for you to test your Twilio apps when you don't have reliable, easy access to SMS and calling capabilities. It uses existing Twilio products to send and receive calls and SMS from your local development environment.
_10twilio plugins:install @twilio-labs/plugin-dev-phone
Once it's installed, you can run the Dev Phone with the following command:
_10twilio dev-phone
You should see output that looks something like this:
_39# OUTPUT_39_39Hello 👋 I'm your dev-phone and my name is dev-phone-XXXXXX_39_39_39_39✅ I'm using your profile API key._39_39_39_39💻 Creating a new conversation..._39_39✅ I'm using the conversation CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX from service ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_39_39_39_39💻 Creating a new sync list for call history..._39_39✅ I'm using the sync service ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_39_39_39_39💻 Deploying a Functions Service to handle incoming calls and SMS..._39_39✅ I'm using the Serverless Service ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_39_39_39_39💻 Creating a new TwiML App to allow voice calls from your browser..._39_39✅ I'm using the TwiML App APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_39_39_39_39🚀 Your local webserver is listening on port 3001_39_39🌐 Opening http://localhost:3001/ your browser_39_39▶️ 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!