With the continuous development of science and technology, electronic devices have begun to enter all aspects of human life, becoming increasingly closely related to human life. Users have higher quality requirements for electronic devices. Electronic device testing has gradually become an irreplaceable engineering process in modern manufacturing enterprises to guarantee the quality of products while preventing inferior products from entering the market. Considering the large output of electronic devices, improving the testing efficiency while reducing the testing cost has become an urgent problem to be solved. This study investigates the electronic device testing machine allocation problem (EDTMAP), aiming to improve the production of electronic devices and reduce the scheduling distance among testing machines through reasonable machine allocation. First, a mathematical model was formulated for the EDTMAP to maximize both production and the scheduling distance among testing machines. Second, we developed a discrete multi-objective artificial bee colony (DMOABC) algorithm to solve EDTMAP. A crossover operator and local search operator were designed to improve the exploration and exploitation of the algorithm, respectively. Numerical experiments were conducted to evaluate the performance of the proposed algorithm. The experimental results demonstrate the superiority of the proposed algorithm compared with the non-dominated sorting genetic algorithm II (NSGA-II) and strength Pareto evolutionary algorithm 2 (SPEA2). Finally, the mathematical model and DMOABC algorithm were applied to a real-world factory that tests radio-frequency modules. The results verify that our method can significantly improve production and reduce the scheduling distance among testing machines.