Running adb commands on all connected devices

前端 未结 6 1397
野性不改
野性不改 2020-12-24 13:30

Is there a way of running adb commands on all connected devices? To uninstall an app from all connected devices with \"adb uninstall com.example.android\".

The comma

6条回答
  •  孤城傲影
    2020-12-24 14:05

    This is the highest result on Google, so for all Windows users coming here let me add this solution by User zingh (slightly modified to accept arbitrary commands, rather than "only" install

    Batch file (adball.bat):

    FOR /F "skip=1"  %%x IN ('adb devices') DO start adb -s %%x %*
    

    Call as:

    adball uninstall com.mypackage
    

    (%* takes all input parameters, my line above makes it so that all commands are passed to adb as they are, so that you can type multiple words, flags etc.)

提交回复
热议问题