The National Council approved the legal basis needed for the SwissCovid app by 156 votes to 22, allowing it to be rolled out to the general public.
The smartphone application uses Bluetooth wireless technology to register other phones that come into close proximity.
It works by tracing people who may unwittingly have been in prolonged contact with someone who later tested positive for the novel coronavirus.
The test phase was launched in mid-May.
Health Minister Alain Berset said it should not extend beyond the end of June. Berset said the test period was needed to find and fix any defects.
The app is optional and no personal data or location information is used.
Some 1,660 people have died in Switzerland — a country of 8.5 million people — out of nearly 30,900 infected with the virus.
Switzerland stopped short of imposing strict confinement when it introduced measures in mid-March aimed at stopping the spread of the new coronavirus.
It began gradually easing its restrictions on April 27, and lifted most of the remaining measures on Saturday, with infection, hospitalisation and death rates having been low and stable for some weeks.
Nevertheless, people are encouraged to maintain physical distancing, wear a mask when that is not possible, stick to hand hygiene rules, and continue to work from home if possible.