If the iPhones turn on, and you have access codes, all you need to do is:
- Turn off iPhone;
- Disconnect battery;
- Install home button;
- Boot iPhone;
- Input code;
- Go to Settings>Touch ID and Passcode> Add Fingerprint. If the buttons scans your fingerprint, you have a matching home button. If not, rinse and repeat.
Besides, if the iPhone is turned on without its matching home button, a pop up message will appear "Unable to Activate Touch ID on this Device" or something similar once you unlock the iPhone.
- It is critical to disconnect the battery before replacing the home button, reconnecting the battery last, and turning on the iPhone after the button is attached. If you replace the button while iPhone is powered on, it will not be recognized and will always say "Unable to Activate..." even if it is the matching Home Button. That and the risk of frying components on the boards by working with the battery connected.
- If the iPhones were already restored with non-matching home buttons, then you have to restore with every new home button that you test.
I know of no other way to match home buttons to their iPhone housing.