Pheromones attract and help to kill the males  so they cannot mate with the females And without mating  female fruit flies will not be able to lay eggs To attract and kill the male flies with pheromones  you need to use traps to protect the products from the rain