Created
May 21, 2019 05:56
-
-
Save CFM880/9f0c013ef9f9d4c050eec3754ffec908 to your computer and use it in GitHub Desktop.
同时push文件到多台android设备上
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
devices_info=`adb devices` | |
echo $devices_info | |
devices_info=`echo ${devices_info} | sed 's/^List of devices attached//'` | |
devices_info=(${devices_info}) | |
device_names="" | |
for(( i=0;i<${#devices_info[@]};i++)); | |
do | |
if [ $((i%2)) == 0 ]; then | |
device_names=${device_names}" "${devices_info[i]} | |
fi | |
done | |
real_devices=(${device_names}) | |
for(( i=0;i<${#real_devices[@]};i++)); | |
do | |
echo ${real_devices[i]} | |
adb -s ${real_devices[i]} push video_config.json /sdcard/spax_video/video_local.json | |
adb -s ${real_devices[i]} shell cat /sdcard/spax_video/video_local.json | jq | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment