noun
substitute device; replacement unit
Used for a device (e.g., phone, tablet, laptop) provided as a temporary replacement when the original is being repaired or is unavailable.
修理中は代替機を貸してもらえますか?
Can I borrow a replacement device while mine is being repaired?
noun
replacement aircraft; substitute plane
Specifically refers to an aircraft substituted for the originally scheduled one, often due to maintenance or operational reasons.
機材繰りの都合で、本便は代替機での運航となります。
Due to aircraft scheduling, this flight will be operated with a substitute aircraft.
代わり is a general term for a substitute or replacement, not limited to devices or aircraft.
Compound of 代替 (substitution) and 機 (machine/aircraft). The exact historical derivation is uncertain, but the word follows standard Sino-Japanese compounding patterns.