adbをインストール
USBデバッグを有効化
USBテザリングでパソコンとスマホを接続
IPアドレスを自動で変更する
シェルスクリプトで自動化できます
# wifiはオフにしておいてください
.\adb.exe shell svc wifi disable
# IPアドレスを自動で変更する
.\adb.exe shell "svc data disable && svc data enable"
# 以下でも可
#.\adb.exe shell "svc wifi disable && svc data disable && svc data enable"
IPアドレスが変更されたか確認
# IP変更と確認
.\adb.exe shell "svc data disable && svc data enable && sleep 5 && ip -o a"
# 2回変更確認
.\adb.exe shell "svc data disable && svc data enable && sleep 5 && ip -o a && svc data disable && svc data enable && sleep 5 && ip -o a"