After installing fxa-local-dev the servers should automatically start up. Use ./pm2 status command to check the status of the servers:
To avoid wasting computer resources while not working on FxA make sure to stop the servers using ./pm2 kill.
Once you are back working on FxA just use the ./pm2 start servers.json command to bring the servers back up. Keep in mind that the memory store will restart and all your database data will be brand new.
Verifying email and viewing logs
Use the ./pm2 logs command to get the logs of all servers. You may also use ./pm2 logs [id] to just see the logs for that particular server.
When you signup for an account using the form on 127.0.0.1:3030/signup the (mailer) logs will print out the verification link that you need to copy paste into your browser to verify your account locally:
If you get an error status for any of the servers please verify that you installed all required dependencies. Otherwise file an issue on this repository.
FIREFOX_DEBUGGER=true - open Browser Toolbox on start (NOTE: false by default for speed).
Functional Tests
The following requires the JDK and tests the local servers only.
Use npm test - all functional tests
Use npm run test-oauth - only OAuth functional tests
Android debugging
The following technique works with any Android application and can also be used for Firefox for Android (making the Firefox for Android section optional).
Simply forward the following ports from the host machine to the Android device:
adb reverse tcp:3030 tcp:3030 # Content server
adb reverse tcp:9000 tcp:9000 # Auth server
adb reverse tcp:9010 tcp:9010 # OAuth server
adb reverse tcp:1111 tcp:1111 # Profile server
adb reverse tcp:5000 tcp:5000 # Sync server
adb reverse tcp:8058 tcp:8058 # Pairing server
Then run ./pm2 start servers.json and get to work!
Firefox for Android
Skip this if you are not working on Firefox for Android and FxA.
You can test sync locally in Firefox for Android using an emulator or a device on the same network. These docs were tested with the Genymotion simulator.
Install Firefox on the device or emulator.
Run npm run start-android this will: stop all local FxA servers, create a local PM2 configuration and rerun the servers.
The script will tell you which IP to use to work with FxA.
Follow the instructions of the script to update values in about:config.
Firefox for iOS
Skip this if you are not working on Firefox for iOS and FxA.
fxa-local-dev

Getting Started
Manually install the system dependencies for OS X or Ubuntu.
Clone this repository.
Run:
Visit 127.0.0.1:3030.
Use the PM2 tool to stop and start the servers, and read server logs.
To start all servers with mysql database
./pm2 start mysql_servers.jsonTo start all servers with memory
./pm2 start servers.jsonThe most common commands are:
./pm2 kill- stop all servers../pm2 status- display running servers../pm2 logs- logs for all servers (note: this must be used to verify accounts)../pm2 logs 1- display logs for process1../pm2 stop 1- stop process1../pm2 restart 1- restart process1.More commands in the PM2 Readme.
When you want to fetch the latest changes to all servers:
Workflow
After installing fxa-local-dev the servers should automatically start up. Use
./pm2 statuscommand to check the status of the servers:To avoid wasting computer resources while not working on FxA make sure to stop the servers using
./pm2 kill. Once you are back working on FxA just use the./pm2 start servers.jsoncommand to bring the servers back up. Keep in mind that the memory store will restart and all your database data will be brand new.Verifying email and viewing logs
Use the
./pm2 logscommand to get the logs of all servers. You may also use./pm2 logs [id]to just see the logs for that particular server.When you signup for an account using the form on
127.0.0.1:3030/signupthe (mailer) logs will print out the verification link that you need to copy paste into your browser to verify your account locally:If you get an
errorstatus for any of the servers please verify that you installed all required dependencies. Otherwise file an issue on this repository.Dependencies
OS X (with Brew):
Xcode and OS X Command Line Tools are required, install it and verify that command line tools installed:
then:
Install Docker for Mac | Docs
Ubuntu:
Docker commands require sudo, to avoid it, follow steps below:
Installing Node.js
Ubuntu / Debian:
Installing Java
OS X:
Download from java.com/en/download/
Ubuntu:
Firefox Custom Profile
Use
npm startto start Firefox with local server configurations. Available options:FXA_ENV=localorlatestorstableorstage(NOTE:localis default).FXA_E10S=true- add this flag to turn on E10S. (NOTE:falseby default).FXA_DESKTOP_CONTEXT-context=value. (NOTE:fx_desktop_v2is default).FIREFOX_BIN=/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin npm startFIREFOX_DEBUGGER=true- open Browser Toolbox on start (NOTE:falseby default for speed).Functional Tests
The following requires the JDK and tests the local servers only.
Use
npm test- all functional testsUse
npm run test-oauth- only OAuth functional testsAndroid debugging
The following technique works with any Android application and can also be used for Firefox for Android (making the Firefox for Android section optional).
Simply forward the following ports from the host machine to the Android device:
Then run
./pm2 start servers.jsonand get to work!Firefox for Android
You can test sync locally in Firefox for Android using an emulator or a device on the same network. These docs were tested with the Genymotion simulator.
npm run start-androidthis will: stop all local FxA servers, create a local PM2 configuration and rerun the servers.The script will tell you which IP to use to work with FxA.
Follow the instructions of the script to update values in
about:config.Firefox for iOS
You can test sync locally in Firefox iOS using the XCode simulator. Follow the steps at github.com/mozilla/firefox-ios and setup firefox-ios build locally. Currently there is no way to dynamically switch servers in Firefox for iOS, to use local servers you need to run the script below:
After the script you need to rebuild firefox-ios.
Running with MailDev
If you want to inspect emails, you can run fxa-local-dev with MailDev.
Install
Run
Once services have started, you can start MailDev on port 9999. You might have to start MailDev with sudo permissions.
All emails sent can be viewed from
http://localhost:1080.Other tasks
npm-shrinkwrap.jsonfiles.