网络延迟模拟
第一种方式是在启动模拟器的时候,设置延迟,使用-netdelay选项,后面跟一个合法的<delay>值
- emulator -netdelay gprs
- emulator -netdelay 40 100 延迟的值
第二种方式是模拟器运行期间修改网络延迟,需要再控制台中使用netdelay命令,后面跟上合法的<delay> 值
- network delay gprs<delay>
可以设置的值列表(单位为毫秒)
值 | 描述 | 注释 |
---|---|---|
gsm | GSM/CD | (min 150,max 550) |
hscsd | HSCSD | (min 80,max 400) |
gprs | GPRS | (min 35,max 200) |
umts | UMTS/3G | (min 35,max 200) |
edge | EDGE/EGPRS | (min 80,max 400) |
hsdpa | HSDPA | (min 0,max 0) |
lte | LTE | (min 0,max 0) |
evdo | EVDO | (min 0,max 0) |
none | no latency | (min 0,max 0) |
<num> | select exact latency | |
<min>:<max> | select min and max latencies |
网速模拟
第一种方式:启动模拟器的时候设置网络传输素的,使用-netspeed选项,后面跟合法的<speed> 值
- emulator -netspeed gsm
- emulator -netspeed 14.4 80
第二种方式:模拟器运行期间改变网络传输速度,再控制台使用netspeed命令,后面跟合法的<speed>值
- network speed 14.4 80
值 描述 注释 gsm GSM/CD (up: 1.8 KiB/s, down: 1.8 KiB/s) hscsd HSCSD (up: 1.8 KiB/s, down: 7.0 KiB/s) gprs GPRS (up: 3.5 KiB/s, down: 7.0 KiB/s) umts UMTS/3G (up: 46.9 KiB/s, down: 46.9 KiB/s) edge EDGE/EGPRS (up: 57.8 KiB/s, down: 57.8 KiB/s) hsdpa HSDPA (up: 703.1 KiB/s, down: 1706.5 KiB/s) lte LTE (up: 7080.1 KiB/s, down: 21118.2 KiB/s) evdo EVDO (up: 9155.3 KiB/s, down: 34179.7 KiB/s) full no limit (up: 0.0 KiB/s, down: 0.0 KiB/s) <num> select both upload and download speed <up>:<down> select individual up and down speed