无法在Android Studio x86和x86x64模拟器上更新/etc/hosts文件 [英] Not able to update /etc/hosts file on Android Studio x86 and x86x64 emulator

查看:338
本文介绍了无法在Android Studio x86和x86x64模拟器上更新/etc/hosts文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发过程中,为了将10.0.2.2 ip地址映射到dns名称,我总是必须使用以下命令在模拟器上更改hosts文件.这始终适用于Android ADT.但是最近我切换到Android Studio,并且它已停止处理x86图像.它适用于ARM映像,但是这些映像确实很慢.

During development I always have to change the hosts file on emulator using following commands in order to map the 10.0.2.2 ip address to dns name. This always worked on Android ADT. But recently I switched to Android Studio and it has stopped working on x86 images. It works for ARM images but those are really slow.

我正在...上进行开发 Android Studio 2.1.2 Android平台工具24 Android SDK工具25.1.7

I am doing development on ... Android Studio 2.1.2 Android Platform-tools 24 Android SDK Tools 25.1.7

我从终端窗口使用以下命令来完成

I use following commands from terminal window in order to do it

adb remount adb shell echo '10.0.2.2 xxxx' >>/etc/hosts

adb remount adb shell echo '10.0.2.2 xxxx' >>/etc/hosts

我收到只读文件系统错误.

I get Read-only File system errors.

更新: 这似乎是Android工具25.1.7中的错误.我将工具降级为24.1.1,并且一切正常.最新的工具正在将/system挂载为只读,并且不允许将其重新挂载为读写

推荐答案

遇到了同样的问题,我正在使用Android工具25.1.7.如何轻松降级工具而不会在运行AVD时出现错误?

Got the same problem and I'm working on Android tools 25.1.7. How can I easily downgrade tools without getting errors in running AVD's ?

实际上25.1.7 Android工具存在一些问题,我在Android SDK Manager(工具(预览频道)选项卡)中将工具更新为25.2 rc1,现在可以重新安装adb.感谢Nehal的问题,没有它,我仍然会与adb remount战斗(可能没有成功)!

这篇关于无法在Android Studio x86和x86x64模拟器上更新/etc/hosts文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆