adroid virtual 不能上网解决方案

这个一般是对于android中的admod引用时,根据网上的正确代码却得出结果,主要原因就是不能上网

具体方法是

启动 android virtual

打开系统的cmd ,输入adb shell 进入linux模拟下

在打开一个cmd,输入ipconfig /all ,看到输入结果中,自己上网的那个ip的dns ***.***.***.***



再在linux下面的那个,输入setprop net.dns1 ***.***.***.***,

setprop net.dns1 202.106.46.151
# getprop
getprop
[ro.secure]: [0]
[ro.allow.mock.location]: [1]
[ro.debuggable]: [1]
[persist.service.adb.enable]: [1]
[ro.kernel.qemu.gles]: [0]
[ro.kernel.qemu]: [1]
[ro.kernel.console]: [ttyS0]
[ro.kernel.android.qemud]: [ttyS1]
[ro.kernel.android.checkjni]: [1]
[ro.kernel.ndns]: [3]
[ro.factorytest]: [0]
[ro.serialno]: []
[ro.bootmode]: [unknown]
[ro.baseband]: [unknown]
[ro.carrier]: [unknown]
[ro.bootloader]: [unknown]
[ro.hardware]: [goldfish]
[ro.revision]: [0]
[ro.build.id]: [FRF91]
[ro.build.display.id]: [sdk-eng 2.
[ro.build.version.incremental]: [4
[ro.build.version.sdk]: [8]
[ro.build.version.codename]: [REL]
[ro.build.version.release]: [2.2]
[ro.build.date]: [Wed Jun 30 13:58
[ro.build.date.utc]: [1277931480]
[ro.build.type]: [eng]
[ro.build.user]: [android-build]
[ro.build.host]: [android-test-25.
[ro.build.tags]: [test-keys]
[ro.product.model]: [sdk]
[ro.product.brand]: [generic]
[ro.product.name]: [sdk]
[ro.product.device]: [generic]
[ro.product.board]: []
[ro.product.cpu.abi]: [armeabi]
[ro.product.manufacturer]: [unknow
[ro.product.locale.language]: [ldp
[ro.product.locale.region]: []
[ro.wifi.channels]: []
[ro.board.platform]: []
[ro.build.product]: [generic]
[ro.build.description]: [sdk-eng 2
[ro.build.fingerprint]: [generic/s
[rild.libpath]: [/system/lib/libre
[rild.libargs]: [-d /dev/ttyS0]
[ro.config.notification_sound]: [O
[ro.config.alarm_alert]: [Alarm_Cl
[media.stagefright.enable-player]:
[media.stagefright.enable-meta]: [
[media.stagefright.enable-scan]: [
[media.stagefright.enable-http]: [
[ro.setupwizard.mode]: [OPTIONAL]
[xmpp.auto-presence]: [true]
[ro.config.nocheckin]: [yes]
[net.bt.name]: [Android]
[net.change]: [net.dns1]
[dalvik.vm.stack-trace-file]: [/da
[persist.sys.timezone]: [GMT]
[persist.sys.language]: [zh]
[persist.sys.country]: [CN]
[persist.sys.localevar]: []
[ro.FOREGROUND_APP_ADJ]: [0]
[ro.VISIBLE_APP_ADJ]: [1]
[ro.SECONDARY_SERVER_ADJ]: [2]
[ro.BACKUP_APP_ADJ]: [2]
[ro.HOME_APP_ADJ]: [4]
[ro.HIDDEN_APP_MIN_ADJ]: [7]
[ro.CONTENT_PROVIDER_ADJ]: [14]
[ro.EMPTY_APP_ADJ]: [15]
[ro.FOREGROUND_APP_MEM]: [1536]
[ro.VISIBLE_APP_MEM]: [2048]
[ro.SECONDARY_SERVER_MEM]: [4096]
[ro.BACKUP_APP_MEM]: [4096]
[ro.HOME_APP_MEM]: [4096]
[ro.HIDDEN_APP_MEM]: [5120]
[ro.CONTENT_PROVIDER_MEM]: [5632]
[ro.EMPTY_APP_MEM]: [6144]
[net.tcp.buffersize.default]: [409
[net.tcp.buffersize.wifi]: [4095,8
[net.tcp.buffersize.umts]: [4094,8
[net.tcp.buffersize.edge]: [4093,2
[net.tcp.buffersize.gprs]: [4092,8
[init.svc.console]: [running]
[init.svc.servicemanager]: [runnin
[init.svc.vold]: [running]
[init.svc.netd]: [running]
[init.svc.debuggerd]: [running]
[init.svc.ril-daemon]: [running]
[init.svc.zygote]: [running]
[init.svc.media]: [running]
[init.svc.installd]: [running]
[init.svc.keystore]: [running]
[init.svc.goldfish-setup]: [runnin
[init.svc.qemud]: [running]
[init.svc.goldfish-logcat]: [stopp
[ARGH]: [ARGH]
[net.eth0.dns1]: [10.0.2.3]
[net.gprs.local-ip]: [10.0.2.15]
[ro.radio.use-ppp]: [no]
[status.battery.state]: [Slow]
[status.battery.level]: [5]
[status.battery.level_raw]: [50]
[status.battery.level_scale]: [9]
[ro.com.google.locationfeatures]:
[init.svc.adbd]: [running]
[dalvik.vm.heapsize]: [24m]
[qemu.sf.lcd_density]: [240]
[qemu.hw.mainkeys]: [1]
[qemu.sf.fake_camera]: [back]
[adb.connected]: [1]
[init.svc.bootanim]: [stopped]
[hw.keyboards.65536.devname]: [qwe
[net.hostname]: [android_9774d56d6
[dev.bootcomplete]: [1]
[gsm.version.ril-impl]: [android r
[gsm.sim.operator.numeric]: [31026
[gsm.sim.operator.alpha]: [Android
[gsm.sim.operator.iso-country]: [u
[gsm.sim.state]: [READY]
[gsm.current.phone-type]: [1]
[gsm.nitz.time]: [1328358741577]
[gsm.network.type]: [UMTS]
[gsm.operator.alpha]: [Android]
[gsm.operator.numeric]: [310260]
[gsm.operator.iso-country]: [us]
[gsm.operator.isroaming]: [false]
[sys.settings_secure_version]: [2]
[net.gprs.http-proxy]: []
[gsm.defaultpdpcontext.active]: [t
[ro.runtime.firstboot]: [132835875
[net.dns1]: [202.106.46.151]
[net.dnschange]: [1]


回车执行后,再输入getprop 查看里面的dns是否改过来,

然后就可以上网了

因为本人看别人说明上面有的是好几个dns,而我的只有一个,所以上面仅针对一个dns所设置的
Android Virtual Device无法选择的原因可能是因为在安装Android Studio时没有选择安装Android Virtual Device组件。在安装Android Studio时,Android Virtual Device是可选的组件,如果没有选择安装,就无法使用Android Virtual Device。如果你需要在虚拟机上测试Android项目,你可以尝试重新安装Android Studio并确保选择了Android Virtual Device组件。\[1\]另外,如果你有一部安卓手机,你也可以使用手机进行测试,这样可以更方便和真实。在安装时,你可以取消安装Android模拟器,这样可以加快Android Studio的运行速度。\[3\] #### 引用[.reference_title] - *1* *3* [安装Android Studio遇到的那些坑及解决办法](https://blog.csdn.net/gucheng3116/article/details/54171766)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [No compatible targets were found,Do you wish to add a new Android Virtual Device?问题解决方法。](https://blog.csdn.net/AAbb895212798/article/details/50906969)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值