Manage incoming connections for Flutter tests
Test Flutter apps that fetch data from localhost, private, internal, or firewalled servers using Local Testing on BrowserStack App Automate.
When your Flutter app depends on data hosted inside your own network, Local Testing lets BrowserStack devices reach those servers securely. The following sections explain how to test apps that pull data from localhost servers, from private or internal servers, and from servers behind a firewall or VPN.
This feature is available on Android devices only.
Test apps that retrieve data from localhost servers
After enabling Local Testing, BrowserStack’s remote devices can access apps that retrieve data from your localhost servers. Use your test scripts to access and interact with your apps. Remember to use the local parameter when executing the test:
Test apps that retrieve data from private or internal servers
You can securely test mobile apps that retrieve data from private or internal servers using --force-local on our remote mobile devices. This option resolves all requests (on our remote devices) through your local machine.
Use the --force-local flag while establishing a Local Testing connection:
After establishing the Local Testing connection, use your test scripts to access and interact with your internally-hosted website, for example, staging.example.com.
Test apps that retrieve data from servers behind a firewall and/or VPNs
With Local Testing, you can test apps that retrieve data/assets from internal servers that are behind firewalls and/or VPNs.
Start by making sure that you can access the app on your machine. Then, set up a Local Testing connection by following the steps listed in Test apps that retrieve data from private or internal servers.
Connection duration and disconnection
The Local Testing connection is persistent. Your machine and BrowserStack Cloud remain connected unless you explicitly end the connection. In the following scenarios, ensure that you open and close the connection by following the steps:
| Setup | Details |
|---|---|
| CI server | Write a script that establishes the Local Testing connection before the build runs. Close the connection after the build finishes. |
| Binary | Run the Local binary from the command line with the appropriate flags before you trigger the build. Close the connection after the build finishes. |
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!