Last active
August 29, 2015 14:22
-
-
Save bertrandmartel/e265c6fe988b7e6ad1a3 to your computer and use it in GitHub Desktop.
launch movies with adb on windows
This file contains hidden or 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
SET ADB_PATH=C:\Users\Akinaru\AppData\Local\Android\sdk\platform-tools\adb.exe | |
SET CONTAINSCONNECTED="connected" | |
SET IP1="192.168.2.210" | |
SET IP2="192.168.2.222" | |
SET IP3="192.168.2.205" | |
SET IP4="192.168.2.114" | |
SET IP5="192.168.2.143" | |
SET MOVIE1=file:///sdcard/Movies/DALS_1200_720x576_id23_tm.mp4 | |
SET MOVIE2=file:///sdcard/Movies/DALS_1200_720x576_id23_tm.mp4 | |
SET MOVIE3=file:///sdcard/Movies/DALS_1200_720x576_id23_tm.mp4 | |
SET MOVIE4=file:///sdcard/Movies/DALS_1200_720x576_id23_tm.mp4 | |
SET MOVIE5=file:///sdcard/Movies/DALS_1200_720x576_id23_tm.mp4 | |
::safely disconnect devices | |
%ADB_PATH% disconnect %IP1% | |
%ADB_PATH% disconnect %IP2% | |
%ADB_PATH% disconnect %IP3% | |
%ADB_PATH% disconnect %IP4% | |
%ADB_PATH% disconnect %IP5% | |
:: kill and restart ADB server | |
%ADB_PATH% kill-server | |
%ADB_PATH% start-server | |
::connect to android | |
echo.%adbcmd%|findstr "not connected" >nul 2>&1 | |
for %x in (%IP1% %IP2% %IP3% %IP4% %IP5%) do( | |
:loop | |
%ADB_PATH% connect %x > temp.txt | |
set /p adbcmd=<temp.txt | |
echo $adbcmd | |
echo.%adbcmd%|findstr /C:"%CONTAINSCONNECTED%" >nul 2>&1 | |
if not errorlevel 1 ( | |
echo "Found %IP1%" | |
) else ( | |
echo "retrying for %IP1%" | |
goto loop | |
) | |
:: force portrait orientation | |
%ADB_PATH% -s %x:5555 shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1 | |
::stop video player => this is default player on Samsung galaxy A5 | |
::%ADB_PATH% -s %x:5555 shell am force-stop com.sec.android.app.videoplayer | |
) | |
:: start movie on different devices | |
start %ADB_PATH% -s %IP1%:5555 shell am start -a android.intent.action.VIEW -d %MOVIE1% | |
start %ADB_PATH% -s %IP2%:5555 shell am start -a android.intent.action.VIEW -d %MOVIE2% | |
start %ADB_PATH% -s %IP3%:5555 shell am start -a android.intent.action.VIEW -d %MOVIE3% | |
start %ADB_PATH% -s %IP4%:5555 shell am start -a android.intent.action.VIEW -d %MOVIE4% | |
start %ADB_PATH% -s %IP5%:5555 shell am start -a android.intent.action.VIEW -d %MOVIE5% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment