GVKun编程网logo

android – Genymotion:虚拟设备没有IP地址?(虚拟ip 安卓)

12

关于android–Genymotion:虚拟设备没有IP地址?和虚拟ip安卓的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于(OK)ns3—genymotion—android、adbs

关于android – Genymotion:虚拟设备没有IP地址?虚拟ip 安卓的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于(OK) ns3—genymotion—android、adb shell无法连接到Genymotion上的虚拟设备的问题、android genymotion 下载地址、Android Studio 使用 Genymotion 模拟器等相关知识的信息别忘了在本站进行查找喔。

本文目录一览:

android – Genymotion:虚拟设备没有IP地址?(虚拟ip 安卓)

android – Genymotion:虚拟设备没有IP地址?(虚拟ip 安卓)

每当我尝试在Genymotion中启动我的虚拟设备时,我都会收到一条错误消息,指出它没有IP地址.在VirtualBox中启用了DHCP,据我所知这一切似乎都很好.我也试过禁用/启用网络适配器,没有运气.还完全重新安装.不知道还能做什么.我真的很喜欢这个模拟器,希望我可以在你的帮助下恢复运行.先谢谢你们,我愿意接受建议.

系统:
Windows 10 x64
四核cpu 3.0 ghz
4 GB RAM

解决方法

在R& D 2天后,我找到了解决方案.

第1步:

转到BIOS设置 – >转到系统配置 – >启用虚拟化技术 – >保存并退出BIOS设置.

第2步:

打开Oracle VM VirtualBox – >选择你的模拟器 – >转到模拟器的设置 – >选择常规标签 – >选择基本子标签 – >选择您的操作系统类型 – >选择您的操作系统版本 – >保存并退出

第3步:

重新启动Genymotion并启动Genymotion模拟器.

参考屏幕截图:

第1步:

第2步:

希望这会对你有所帮助.

(OK) ns3—genymotion—android

(OK) ns3—genymotion—android

brctl addbr br-android
ifconfig br-android up
-----------------------------------------------------------------

[root @localhost android-on-linux]# chmod +x genymotion-2.6.0-ubuntu15_x64.bin
[root @localhost android-on-linux]# ll -h genymotion-2.6.0-ubuntu15_x64.bin
-rwxr-xr-x. 1 root root 41M 5 月  18 22:54 genymotion-2.6.0-ubuntu15_x64.bin
[root @localhost android-on-linux]# ./genymotion-2.6.0-ubuntu15_x64.bin
Installing for all users.

Installing to folder [/opt/genymobile/genymotion]. Are you sure [y/n] ? y


- Trying to find VirtualBox toolset .................... OK (Valid version of VirtualBox found: 5.0.20r106931)
- Extracting files ..................................... OK (Extract into: [/opt/genymobile/genymotion])
- Installing launcher icon ............................. OK

Installation done successfully.

You can now use these tools from [/opt/genymobile/genymotion]:
 - genymotion
 - genymotion-shell
 - gmtool

[root @localhost android-on-linux]#


[root @localhost genymotion]# pwd
/opt/genymobile/genymotion
[root@localhost genymotion]# ./genymotion
./genymotion: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
-----------------------------------------------------------------
https://github.com/maciej-c/libjpeg8x64
wget https://codeload.github.com/maciej-c/libjpeg8x64/zip/master

[root@localhost libjpeg8-x64]# ll
总用量 1176
lrwxrwxrwx. 1 root root      16 5 月  18 23:12 libjpeg.so.8 -> libjpeg.so.8.0.0
-rwxrwxr-x. 1 root root 1188344 2 月  12 02:23 libjpeg.so.8.0.0
[root@localhost libjpeg8-x64]# cp -a libjpeg.so.8* /usr/lib64/
-----------------------------------------------------------------

[root@localhost genymotion]# pwd
/opt/genymobile/genymotion

[root@localhost genymotion]# ./genymotion

-----------------------------------------------------------------

[root@localhost ~]# pwd
/opt/android-on-linux/android-sdk-linux/platform-tools

[root@localhost ~]# gedit /root/.bashrc
export PATH=$PATH:/opt/android-on-linux/android-sdk-linux/platform-tools

[root@localhost ~]# adb shell
root@vbox86p:/ # netcfg                                                        

netcfg eth0 up
netcfg eth0 dhcp

//IFB — Intermediate Functional Block device ,取代旧的 imq,用于流控。
-----------------------------------------------------------------


------------------------------------------------------------------------------------------
Fedora23 + genymotion (android) + Docker + NS3 + MANETs - testing
------------------------------------------------------------------------------------------

[root@localhost ~]# mkdir /tmp/docker1

systemctl start docker.service

[root@localhost docker1]# docker run -it --rm --net=''none'' busybox /bin/sh

[root@localhost ~]# docker ps
CONTAINER ID     IMAGE      COMMAND      CREATED           STATUS          PORTS    NAMES
ffa93ae962e3     busybox    "/bin/sh"    36 seconds ago    Up 35 seconds            awesome_shirley

//get PID of CONTAINER
[root@localhost ~]# docker inspect -f "{{.State.Pid}}" awesome_shirley
14438
[root@localhost ~]#

----------------------------
first:
----------------------------
[root@localhost genymotion]# pwd
/opt/genymobile/genymotion
[root@localhost genymotion]# ./genymotion

----------------------------
second:
----------------------------

------------------------------------------------------------------------------------------
https://www.nsnam.org/wiki/HOWTO_Use_Linux_Containers_to_set_up_virtual_networks
http://yaxin-cn.github.io/Docker/docker-container-use-static-IP.html

[root@localhost ~]#
brctl addbr br-android
brctl addbr br-docker

tunctl -t tap-left
tunctl -t tap-right

ifconfig tap-left 0.0.0.0 promisc up
ifconfig tap-right 0.0.0.0 promisc up

// genymotion android

ip link add veth_android44 type veth peer name X
brctl addif br-android veth_android44
ip link set veth_android44 up


----------------------------
third:
----------------------------
// Virtual Box > Settings > Network > Adapter 2 > bridge, br-android, then, to start android in genymotion window.


[root@localhost ~]# man ip-netns
       By convention a named network namespace is an object at /var/run/netns/NAME that can be opened. The file
       descriptor resulting from opening /var/run/netns/NAME refers to the specified network namespace. Holding that
       file descriptor open keeps the network namespace alive. The file descriptor can be used with the setns(2) sys‐
       tem call to change the network namespace associated with a task.

[root@localhost ~]# ps aux|grep geny
root     14807  0.4  2.6 5558944 205520 ?      Sl   11:06   0:02 /opt/genymobile/genymotion/player --vm-name Custom Phone - 5.1.0 - API 22 - 768x1280

[root@localhost ~]# mkdir /var/run/netns
[root@localhost ~]#
rm /var/run/netns/* -f
ln -s /proc/14438/ns/net /var/run/netns/14438
ln -s /proc/14807/ns/net /var/run/netns/14807
----------------------------

ip link set X netns 14807

// docker busybox

ip link add veth_docker1 type veth peer name Y
brctl addif br-docker veth_docker1
ip link set veth_docker1 up
ip link set Y netns 14438


--------------
[root@localhost ~]# ip link add veth_docker1 type veth peer name X
RTNETLINK answers: File exists
[root@localhost ~]#
ip link delete veth_docker1
ip link delete X

systemctl restart network-online.target
ip addr flush dev X    // to flush the device before bringing it up
--------------

------------------------------------------------------------------------------------------
[root@localhost docker2]# docker run -it --rm --net=''none'' busybox /bin/sh
/ # ifconfig -a
Y         Link encap:Ethernet  HWaddr 82:A9:52:BE:D2:78  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

/ #
------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------
[root@localhost ~]#

brctl addif br-android tap-left
ifconfig br-android up
brctl addif br-docker tap-right
ifconfig br-docker up

[root@localhost ~]# brctl show
bridge name    bridge id                STP enabled    interfaces
br-android        8000.5ea947f3ed2c        no             tap-left
                                                       veth_android44
br-docker       8000.16168007f70a        no             tap-right
                                                       veth_docker1
docker0        8000.0242e1664909        no        
virbr0         8000.525400b558ab        yes            virbr0-nic

// genymotion android

ip netns exec 14807 ip link set dev X name eth1
ip netns exec 14807 ip link set eth1 up
ip netns exec 14807 ip addr add 172.17.0.2/16 dev eth1
//ip netns exec 14807 ip route add default via 172.17.42.1

// docker busybox

ip netns exec 14438 ip link set dev Y name eth0
ip netns exec 14438 ip link set eth0 up
ip netns exec 14438 ip addr add 172.17.0.1/16 dev eth0
//ip netns exec 14438 ip route add default via 172.17.42.1


------------------------------------------------------------------------------------------
/ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
/ #
------------------------------------------------------------------------------------------
//You will also have to make sure that your kernel has ethernet filtering (ebtables, bridge-nf, arptables) disabled. If you do not do this, only STP and ARP traffic will be allowed to flow across your bridge and your whole scenario will not work.

[root@localhost ~]#

cd /proc/sys/net/bridge
for f in bridge-nf-*; do echo 0 > $f; done
cd -
------------------------------------------------------------------------------------------
172.17.0.2 can not ping 172.17.0.1
------------------------------------------------------------------------------------------
/ # ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1): 56 data bytes
^C
--- 172.17.0.1 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

------------------------------------------------------
cp manet-2015.cc /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/scratch/

[root@localhost ns-3.25]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
[root@localhost ns-3.25]#

./waf --run scratch/manet-2015 --vis
------------------------------------------------------

172.17.0.2 can ping 172.17.0.1 successfully

------------------------------------------------------
/ # ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1): 56 data bytes
64 bytes from 172.17.0.1: seq=0 ttl=64 time=0.619 ms
64 bytes from 172.17.0.1: seq=1 ttl=64 time=0.363 ms
^C
--- 172.17.0.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.363/0.491/0.619 ms
/ #
------------------------------------------------------------------------------------------
ifconfig br-android down
ifconfig br-docker down
brctl delif br-android tap-left
brctl delif br-docker tap-right
brctl delbr br-android
brctl delbr br-docker

ifconfig tap-left down
ifconfig tap-right down
tunctl -d tap-left
tunctl -d tap-right

ip link delete veth_android44
ip link delete X
ip link delete veth_docker1
ip link delete Y

ip link delete eth1

------------------------------------------------------------------------------------------
So far, OK OK OK
------------------------------------------------------------------------------------------


adb shell无法连接到Genymotion上的虚拟设备的问题

adb shell无法连接到Genymotion上的虚拟设备的问题

在《安装Genymotion模拟器运行Android studio的工程》一文中,我们实践了在Genymotion上运行Android studio的工程,在实际使用中可能会遇到下面这些问题:

假设Android studio和Genymotion都已经打开,Genymotion上的虚拟设备也已经启动成功;

1.在Android studio中点击"Run app"按钮后,虚拟设备不会出现在弹出窗口的列表中:

这里写图片描述

2.想给应用打断点,点击"Attach debugger to Android progress"按钮,会提示如下错误:

这里写图片描述

3.想adb连接设备,在控制台执行"adb shell",会提示错误"adb server version (32) doesn’t match this client (39);",如下图:

这里写图片描述

遇到这些问题的时候,请按照如下步骤修改设置

1.在Genymotion页面上点击"Settings",在弹出的窗口再点击"ADB",如下图:

这里写图片描述

2.单选框中选择"Use custom Android SDK tools",再点击"Browse"选中sdk安装路径,在我这里就是"D:/software/Android/sdk",如下图:

这里写图片描述

3.关闭虚拟设备后重新启动该设备,退出Android studio之后重新打开;

4.这时候去点击"Run app"按钮,选择设备的窗口中可以选择虚拟设备,点击"Attach debugger to Android progress"按钮可以选择虚拟设备中的app进程,在控制台执行"adb shell"也可以正常连接;

欢迎关注我的公众号

在这里插入图片描述

本文分享 CSDN - 程序员欣宸。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

android genymotion 下载地址

android genymotion 下载地址


https://www.genymotion.com/download/

with VirtualBox:

http://files2.genymotion.com/genymotion/genymotion-2.6.0/genymotion-2.6.0-vbox.exe



Android Studio 使用 Genymotion 模拟器

Android Studio 使用 Genymotion 模拟器

Genymotion: Genymotion是最新版的安卓模拟器,被300000开发者所信任
1. Genymotion 下载安装(官网 http://www.genymotion.net/)
1. 注册账号:https://www.genymotion.com/account/login/

 

 

 

2. 下载 Genymotion :https://www.genymotion.com/download/

 

 

 

3. 然后就傻瓜式安装,注意要安装 virtual Box 否则 genymotion 无法使用

 

 

2. Genymotion 配置使用
1. 打开 genymotion

 

 

 

2. 进行配置,如上图?:找到 setting,重点配置下图?:指定好 sdk

 

 

 

3. 设置完上图?,回到原来页面,进行下图操作?:

 

 

 

4. 安装上图?:版本的模拟器,然后照下图?:操作即可

 

 

 

5. 启动后的界面如下图?:

 

 

 

6. Android Studio 安装 Genymotion 插件 如下图?:File->Setting->Plugins->genymotion->Install

 

 

 

 

7. 到这里就基本上完事了,重启 Android Studio, 然后使用 Android Studio 选择运行就好了
————————————————

2.运行程序

a.打开Toolbar View->Toolbar,显示图标

可以看到工具栏多了个Genymotion Device Manager的图标:

3f2ea237-d046-4a21-8eed-e4207133e91f

b.设置genymotion程序路径

点击图标,弹出如下界面:

d785708e-e314-4681-978b-57239b548210

 

c.运行genymotion

加载我们之前安装好的Genymotion文件夹即可。然后再点击图标,弹出如下界面:

9be4ab45-4598-4e70-878b-69720b90e6f5

 

d.选择项目点击运行,弹出如下界面:

我们今天的关于android – Genymotion:虚拟设备没有IP地址?虚拟ip 安卓的分享已经告一段落,感谢您的关注,如果您想了解更多关于(OK) ns3—genymotion—android、adb shell无法连接到Genymotion上的虚拟设备的问题、android genymotion 下载地址、Android Studio 使用 Genymotion 模拟器的相关信息,请在本站查询。

本文标签: