When his personal appearance is necessary, if he is in custody, the court may direct and the officer in whose custody he is must bring him before it to be arraigned.