gnirehtet install [serial] Install the client on the Android device and exit. If several devices are connected via adb, then serial must be specified.
gnirehtet uninstall [serial] Uninstall the client from the Android device and exit. If several devices are connected via adb, then serial must be specified.
gnirehtet reinstall [serial] Uninstall then install.
gnirehtet run [serial] [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Enable reverse tethering for exactly one device: - install the client if necessary; - start the client; - start the relay server; - on Ctrl+C, stop both the relay server and the client.
gnirehtet autorun [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Enable reverse tethering for all devices: - monitor devices and start clients (autostart); - start the relay server.
gnirehtet start [serial] [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Start a client on the Android device and exit. If several devices are connected via adb, then serial must be specified. If -d is given, then make the Android device use the specified DNS server(s). Otherwise, use 8.8.8.8 (Google public DNS). If -r is given, then only reverse tether the specified routes. Otherwise, use 0.0.0.0/0 (redirect the whole traffic). If -p is given, then make the relay server listen on the specified port. Otherwise, use port 31416. If the client is already started, then do nothing, and ignore the other parameters. 10.0.2.2 is mapped to the host 'localhost'.
gnirehtet autostart [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Listen for device connexions and start a client on every detected device. Accept the same parameters as the start command (excluding the serial, which will be taken from the detected device).
gnirehtet stop [serial] Stop the client on the Android device and exit. If several devices are connected via adb, then serial must be specified.
gnirehtet tunnel [serial] [-p PORT] Set up the 'adb reverse' tunnel. If a device is unplugged then plugged back while gnirehtet is active, resetting the tunnel is sufficient to get the connection back.
gnirehtet relay [-p PORT] Start the relay server in the current terminal.
D:\Desktop>
安装apk
在您的Android设备上安装APK:
1
gnirehtet install [serial]
启动手机客户端
在另一个终端中,对于每个客户端,执行:
1
gnirehtet start [serial]
停止手机客户端
要停止客户端,请执行以下操作:
1
gnirehtet stop [serial]
恢复连接
要重置通道(在gnirehtet处于活动状态时拔下设备并重新插入时,有助于恢复连接):
1
gnirehtet tunnel [serial]
只有当adb devices输出多个设备时,才需要serial参数。
启动电脑服务端
1
gnirehtet relay
多功能命令
gnirehtet run
1 2 3 4 5 6
gnirehtet run [serial] [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Enable reverse tethering for exactly one device: - install the client if necessary; - start the client; - start the relay server; - on Ctrl+C, stop both the relay server and the client.
gnirehtet run功能如下命令
会在必要的时候安装手机客户端,
启动手机客户端
启动电脑服务端
当按下Ctrl+C时,手机客户端和电脑服务端都会停止
gnirehtet autorun
连接多个手机客户端
1 2 3 4
gnirehtet autorun [-d DNS[,DNS2,...]] [-p PORT] [-r ROUTE[,ROUTE2,...]] Enable reverse tethering for all devices: - monitor devices and start clients (autostart); - start the relay server.
示例 使用USB数据线给多个手机上网
使用USB数据线连接两个手机,执行adb devices -l命令,结果如下:
1 2 3 4
D:\Desktop>adb devices -l List of devices attached 75aed56d device product:R9PlusmA model:OPPO_R9_Plusm_A device:R9PlusA transport_id:27 U8ENW18117021408 device product:LLD-AL10 model:LLD_AL10 device:HWLLD-H transport_id:28