genemotion .bash_profile配置
#VBoxManage
export PATH=/Applications/VirtualBox.app/Contents/MacOS:$PATH
#Genymotion_Home
export GENYMOTION_HOME=/Applications/Genymotion.app/Contents/MacOS
export PATH=$GENYMOTION_HOME:$PATH
#Genymotion_Shell
export GENYMOTION_SHELL="/Applications/Genymotion Shell.app/Contents/MacOS/"
export PATH=$GENYMOTION_SHELL:$PATH
#Genymotion_player
export GENYMOTION_PLAYER=/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS
export PATH=$GENYMOTION_PLAYER:$PATH
启动模拟器命令
# !/bin/sh
# Shell script scripts to generate IP and sync virtual machines
# -------------------------------------------------------------------------
#generate IP
IO="";
IP=`ifconfig en0|grep inet|grep -v 127.0.0.1|grep -v inet6|grep 10|awk '{print $2}'|tr -d "addr:"`
#change ip:port forward detail
kill -9 `ps -ef|grep 'player'|grep -v grep|awk '{print $2}'`
VBoxManage controlvm "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920_1" poweroff
VBoxManage controlvm "Samsung Galaxy Note 3 - 4.4.4 - API 19 - 1080x1920" poweroff
VBoxManage modifyvm "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920_1" --natpf2 delete "Rule 1"
VBoxManage modifyvm "Samsung Galaxy Note 3 - 4.4.4 - API 19 - 1080x1920" --natpf2 delete "Rule 1"
VBoxManage modifyvm "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920_1" --natpf2 "Rule 1,tcp,$IP,7004,,5555"
VBoxManage modifyvm "Samsung Galaxy Note 3 - 4.4.4 - API 19 - 1080x1920" --natpf2 "Rule 1,tcp,$IP,7005,,5555"
. /Users/uiauto/Documents/Testcode/startvm.sh
for((i=0;i<6;i++));do
{
remain_time=$[60-$i*10];
echo "$remain_time seconds last...";
sleep 10;
}
done
#sync ip:port to vm
if [ ! -d 7004 ];then
mkdir 7004
fi
if [ ! -d 7005 ];then
mkdir 7005
fi
echo "$IP:7004">/Users/uiauto/Documents/Testcode/7004/ip.txt;
echo "$IP:7005">/Users/uiauto/Documents/Testcode/7005/ip.txt;
adb -s 192.168.56.101:5555 push /Users/uiauto/Documents/Testcode/7004/ip.txt /sdcard/
adb -s 192.168.56.102:5555 push /Users/uiauto/Documents/Testcode/7005/ip.txt /sdcard/
player --vm-name "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920_1”
player --vm-name "Samsung Galaxy Note 3 - 4.4.4 - API 19 - 1080x1920”
player --vm-name "Samsung Galaxy S4 - 4.4.4 - API 19 - 1080x1920"
VBoxManage controlvm "Samsung Galaxy S4 - 4.4.4 - API 19 - 1080x1920" poweroff