我想将文件推送到 SD 卡和模拟器,然后再次刷新每个模拟器。
这是我的代码
echo "=======PUSH photos AND REFRESH EACH EMULATOR========"
echo "${EMULATORS[0]}"
echo "${EMULATORS[1]}"
echo "${EMULATORS[2]}"
adb kill-server
sleep 30
adb start-server
sleep 30
echo "Trying to push to device ${EMULATORS[index]}"
adb -s ${EMULATORS[index]} push -p ~/dev/test_ttrumpet_portals/rspec_automation/link_android_appium_tests/spec/photo /mnt/sdcard/Pictures
sleep 50
echo "================REFRESH EMULATORS===================="
for index in "${!EMULATORS[@]}" #start all emulators
do
echo "Trying to refresh ${EMULATORS[index]}"
adb -s ${EMULATORS[index]} shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard
sleep 30
done
答案1
您可以使用以下命令找出哪个应用程序或进程正在监听端口:
udo netstat -peant | grep ":5037"
或者
lsof -i :80
获取监听该端口的进程的进程 ID,并使用以下命令将其终止:
sudo kill -9 <process id>