R
R
Rampage14102021-08-11 16:20:20
PowerShell
Rampage1410, 2021-08-11 16:20:20

Is it possible to write an analogue of my command from Linux to Powershell?

Please help me to convert the command from Linux to Powershell.

adb devices | grep -w "device" | cut -f 1 | xargs -I{} -n1 -P30 adb -s {} install some.apk

This command collects a list of serials of connected android devices, passes them as arguments, and multipaths passes these arguments to adb. As a result, some.apk is installed immediately on all connected devices.

I can't do it on Windows using Powershell.

Many thanks to all who are interested!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MaxKozlov, 2021-08-11
@Rampage1410

Something like

Adb devices | select-object -skip 1 | foreach-object -parallel {
  $id=$_ -replace '\s+device'
  Adb -s $id install some.apk
}

Psv7 is needed for the -parallel switch.
If only 5.1 is available, you need to use the external modules
Posh-rsjob, threadJob, invoke-parallel. Well, fix the code for them
Ps about parallel execution in the question is not entirely clear

A
Armenian Radio, 2021-08-11
@gbg

Put on the window bash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question