(OK)(OK) NS3 - Genymotion - Android


-----------------------------------------------------------------
install genymotion in Fedora23
-----------------------------------------------------------------

[root@localhost android-on-linux]# pwd
/opt/android-on-linux
[root@localhost android-on-linux]# ls genymotion-2.6.0-ubuntu15_x64.bin
genymotion-2.6.0-ubuntu15_x64.bin

[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  ----------------------------------------------------------------- So far, we have installed genymotion successfully. -----------------------------------------------------------------    ------------------------------------------------------------------------------------------ Fedora23 + genymotion (android) + NS3 + MANETs - testing ------------------------------------------------------------------------------------------  ---------------------------- first: ---------------------------- [root@localhost ~]#   brctl addbr br_a_1 brctl addbr br_a_2  tunctl -t tap_a_1 tunctl -t tap_a_2  ifconfig tap_a_1 0.0.0.0 promisc up ifconfig tap_a_2 0.0.0.0 promisc up  brctl addif br_a_1 tap_a_1 ifconfig br_a_1 up brctl addif br_a_2 tap_a_2 ifconfig br_a_2 up  ---------------------- //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 -

----------------------------
second:
----------------------------
to set up the first genymotion VM in VirtualBox.
 ---> Virtual Box > (Custom Phone-5.1.0-API 22-768x1280) > Settings > Network > Adapter 2 > bridge, br_a_1,

to set up the second genymotion VM in VirtualBox.
 ---> Virtual Box > (Google Nexus7-5.0.0-API 21-800x1280) > Settings > Network > Adapter 2 > bridge, br_a_2,

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

to start the first android (Custom Phone-5.1.0-API 22-768x1280) in genymotion window.
to start the second android (Google Nexus7-5.0.0-API 21-800x1280) in genymotion window.

----------------------------
third:
----------------------------

[root@localhost ~]# adb devices
List of devices attached
192.168.58.102:5555    device
192.168.58.101:5555    device

[root@localhost 111]#
adb -s 192.168.58.101:5555 root
adb -s 192.168.58.101:5555 shell
netcfg
// netcfg eth0 up
// netcfg eth0 dhcp
ip addr add 172.17.0.1/16 dev eth1
ping 172.17.0.1
ping 172.17.0.2

[root@localhost 222]#
adb -s 192.168.58.102:5555 root
adb -s 192.168.58.102:5555 shell
ip addr add 172.17.0.2/16 dev eth1
netcfg
// netcfg eth0 up
// netcfg eth0 dhcp
ping 172.17.0.1
ping 172.17.0.2

--------------------------------------
172.17.0.2 can not ping 172.17.0.1
--------------------------------------

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 manet-genymotion --vis


------------------------------------------------------------------------------------------
172.17.0.2 can ping 172.17.0.1 successfully
------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------
clean
------------------------------------------------------------------------------------------
ifconfig br_a_1 down
brctl delif br_a_1 tap_a_1
brctl delbr br_a_1
ifconfig tap_a_1 down
tunctl -d tap_a_1

ifconfig br_a_2 down
brctl delif br_a_2 tap_a_2
brctl delbr br_a_2
ifconfig tap_a_2 down
tunctl -d tap_a_2

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

posted @   张同光  阅读(133)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示