批处理打开adb shell,继续执行android设备的shell命令

2015年07月01日 其他资源 11条评论 阅读7636次

在windows系统中,可以通过批处理处理若干连续的windows命令,但如果有进入另一个输入通道的情况,批处理将会如何处理。

用一个例子来说明上面的情况。

android设备用数据线和windows电脑连接,想在windows电脑上通过adb shell执行一些android设备上的命令。

adb shell

>cd data/app

>rm -rf net.jileniao.apppkg

>uninstall net.jileniao.apppkg

>reboot

上述说明的命令中如果全写到批处理文件

adb shell

su

cd data/app

rm -rf net.jileniao.apppkg

uninstall net.jileniao.apppkg

reboot

将会出现的情况是,adb shell已经执行,但cmd会一直在shell命令等待用户输入,也就是从su开始的命令没有被读取进去执行。

没有读取su开始后面的命令的原因就是adb shell之后,cmd就有了一个新的输入管道,而批处理后面的执行命令却和adb shell处于同一个级别,不能被当做新的输入管道。

所以这时就可以用输入输出管道重定向<>来解决此问题了。

简单地说来,就是把shell下要执行的命令单独放到一个cmd.txt文件中。

su

cd data/app

rm -rf net.jileniao.apppkg

uninstall net.jileniao.apppkg

reboot

批处理文件device.bat则这样写

adb shell<cmd.txt

exit

分为两个文件,用输入重定向解决此问题。

若有好方法,望不吝赐教。

分享本文至:

WRITTEN BY

avatar
本文标签:adbshell
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

11 条评论

  1. avatar projabbag

    <a href="http://www.theuntoldlost.com/nike-air-max-90-custom-kondisko-obuvf">nike air max 90 custom kondisko</a> <a href="http://www.trueaustinpg.com/new-nike-free-run-3-5.0-rosa-gr%C3%B8nn-kvinners-sko-gr%C3%A5-obuve">new nike free run 3 5.0 rosa gr酶nn kvinners sko gr氓</a> <a href="http://www.benchconsult.com/maschio-nike-air-max-thea-rosso-blu-kurpesg">maschio nike air max thea rosso blu</a> <a href="http://www.bobbyburrage.com/mujeres-nike-free-flyknit-4.0-armada-obuvb">mujeres nike free flyknit 4.0 armada</a> <a href="http://www.bonairecliffs.com/b%C3%B8rn-nike-light-up-sko-gr%C3%A5-guld-butya">b酶rn nike light up sko gr氓 guld</a> <a href="http://www.cryptomtge.com/limited-nike-olive-youth-luke-kuechly-jersey-nfl-59-carolina-panthers-2017-salute-to-service-nflu">limited nike olive youth luke kuechly jersey nfl 59 carolina panthers 2017 salute to service</a>
    projabbag http://www.projabbag.com/

  2. avatar lauraundleon

    <a href="http://www.cremontana.com/mlb-jerseys-minnesota-twins-7-joe-mauer-baby-blue-mitchellandness-nflf">mlb jerseys minnesota twins 7 joe mauer baby blue mitchellandness</a> <a href="http://www.holeninegolf.com/nike-air-yeezy-2-red-october-authentic-runningf">nike air yeezy 2 red october authentic</a> <a href="http://www.boobseze.com/nfl-pittsburgh-steelers-color-rush-limited-antonio-brown-mens-football-jersey-nflv">nfl pittsburgh steelers color rush limited antonio brown mens football jersey</a> <a href="http://www.divyangshop.com/nike-toki-slip-txt-womens-orange-grey-trainersa">nike toki slip txt womens orange grey</a> <a href="http://www.caveduperreux.com/nike-soccers-chaussures-rose-vert-scarped">nike soccers chaussures rose vert</a> <a href="http://www.fabloomsilk.com/dam%C3%A4nner-nike-flyknit-racer-rosa-gelb-kurpesd">dam盲nner nike flyknit racer rosa gelb</a>
    lauraundleon http://www.lauraundleon.com/

  3. avatar thebatchseven

    <a href="http://www.nollerlincoln.com/air-jordan-13-retro-low-brave-blau-october-kurpesa">air jordan 13 retro low brave blau october</a> <a href="http://www.wimpley.com/nike-internationalist-grigio-mist-kurpesf">nike internationalist grigio mist</a> <a href="http://www.noumetpatrice.com/ralph-lauren-kvinders-fl%C3%A5den-hvid-shirt-stripe-cotton-poloz">ralph lauren kvinders fl氓den hvid shirt stripe cotton</a> <a href="http://www.sennaparisllc.com/jordan-3-hvit-true-bl%C3%A5-scarpeb">jordan 3 hvit true bl氓</a> <a href="http://www.stylejinx.com/nfl-womens-nike-new-york-jets-11-robby-anderson-green-name-number-logo-t-shirt-nfls">nfl womens nike new york jets 11 robby anderson green name number logo t shirt</a> <a href="http://www.threeoaksmi.com/nike-free-run-3.0-v4-dam%C3%A4nner-schuhe-scarpeg">nike free run 3.0 v4 dam盲nner schuhe</a>
    thebatchseven http://www.thebatchseven.com/

  4. avatar blockchainmkt

    <a href="http://www.cengorde.com/gr%C3%B8nn-nike-blazers-mid-kurpese">gr酶nn nike blazers mid</a> <a href="http://www.danielledraws.com/herre-big-pony-polo-gr%C3%B8n-sort-polou">herre big pony polo gr酶n sort</a> <a href="http://www.gkpassword.com/air-max-90-svart-and-rosa-scarpeb">air max 90 svart and rosa</a> <a href="http://www.mackzy.com/nike-limited-brandon-marshall-jersey-15-nfl-seattle-seahawks-vapor-untouchable-womens-home-navy-blue-nfls">nike limited brandon marshall jersey 15 nfl seattle seahawks vapor untouchable womens home navy blue</a> <a href="http://www.metinmilli.com/nike-free-5.0-plus-femmes-noir-scarpeg">nike free 5.0 plus femmes noir</a> <a href="http://www.momandpopop.com/ua-curry-scarpe-rosa-marrone-obuvc">ua curry scarpe rosa marrone</a>
    blockchainmkt http://www.blockchainmkt.com/

  5. avatar crisgarrett

    <a href="http://www.albainmaz.com/nike-sb-blazer-varsity-p%C3%BArpura-kurpesc">nike sb blazer varsity p煤rpura</a> <a href="http://www.seemyvcard.com/ray-ban-light-ray-matte-black-aviator-sunglasses-not-working-sunglassesc">ray ban light ray matte black aviator sunglasses not working</a> <a href="http://www.joegauntlett.com/nike-justin-coleman-jersey-28-nfl-seattle-seahawks-t-shirt-name-number-logo-navy-blue-nflr">nike justin coleman jersey 28 nfl seattle seahawks t shirt name number logo navy blue</a> <a href="http://www.rpnailsalon.com/air-jordan-son-of-mars-green-glow-mars-low-mens-skoa">air jordan son of mars green glow mars low mens</a> <a href="http://www.hrubinlaser.com/nike-flyknit-trainer-online-store-not-working-sneakerf">nike flyknit trainer online store not working</a> <a href="http://www.pruvitallday.com/nike-air-flight-89-university-rot-rocks-kurpesa">nike air flight 89 university rot rocks</a>
    crisgarrett http://www.crisgarrett.com/

  6. avatar tranhkhoathan

    <a href="http://www.nollerlincoln.com/nike-darwin-hommes-chaussure-brands-chaussuresa">nike darwin hommes chaussure brands</a> <a href="http://www.wimpley.com/herre-nike-air-max-90-vt-guld-bl%C3%A5-schuhed">herre nike air max 90 vt guld bl氓</a> <a href="http://www.noumetpatrice.com/nike-air-max-courtballeistec-4.3-noir-scarpea">nike air max courtballeistec 4.3 noir</a> <a href="http://www.sennaparisllc.com/air-jordan-6-retro-gs-for-salg-kurpesf">air jordan 6 retro gs for salg</a> <a href="http://www.stylejinx.com/womens-demaryius-thomas-ash-backer-nfl-nike-houston-texans-87-pullover-hoodie-nflr">womens demaryius thomas ash backer nfl nike houston texans 87 pullover hoodie</a> <a href="http://www.threeoaksmi.com/adidas-zx-750-maroon-gituttio-rosso-kurpesf">adidas zx 750 maroon gituttio rosso</a>
    tranhkhoathan http://www.tranhkhoathan.com/

  7. avatar cialuno

    <a href="http://www.energiidesign.com/nike-free-4.0-flyknit-dam%C3%A4nner-butyd">nike free 4.0 flyknit dam盲nner</a> <a href="http://www.fuelrat.com/nike-shox-deliver-sport-rosso-wing-obuvc">nike shox deliver sport rosso wing</a> <a href="http://www.artkabis.com/air-max-90-amarillo-and-negro-keys-scarped">air max 90 amarillo and negro keys</a> <a href="http://www.auroraprop.com/mennns-nike-air-huarache-all-r%C3%B8d-obuvc">mennns nike air huarache all r酶d</a> <a href="http://www.bnkolabs.com/air-max-zero-qs-noir-out-chaussuresg">air max zero qs noir out</a> <a href="http://www.cifretail.com/nike-zoom-pegasus-31-mujeres-verde-cielo-azul-chaussuresa">nike zoom pegasus 31 mujeres verde cielo azul</a>
    cialuno http://www.cialuno.com/

  8. avatar shoppula

    <a href="http://www.royalhoneywax.com/bon-march%C3%A9-air-jordan-horizon-hommes-blanc-runningd">bon march茅 air jordan horizon hommes blanc</a> <a href="http://www.carslambert.com/air-jordan-b-mo-pink-grey-runninge">air jordan b mo pink grey</a> <a href="http://www.hiussalipiilo.com/washington-nationals-adjustable-hat-use-hata">washington nationals adjustable hat use</a> <a href="http://www.hospicevna.com/billig-nike-shox-nz-dam%C3%A4nner-silber-trainersf">billig nike shox nz dam盲nner silber</a> <a href="http://www.smartpaul.com/prada-leather-shopping-tote-pradar">prada leather shopping tote</a> <a href="http://www.opendekalbinc.com/nike-blazer-shoe-girly-runningb">nike blazer shoe girly</a>
    shoppula http://www.shoppula.com/

  9. avatar rnokcrc1

    <a href="http://www.6464l4ua.com/huarache-utility-rotdit-guide-chaussuresb">huarache utility rotdit guide</a> <a href="http://www.pkwq01vv.com/nike-sb-dunk-high-pro-premium-svart-l%C3%A6r-butya">nike sb dunk high pro premium svart l忙r</a> <a href="http://www.5kya44jr.com/nike-zoom-structure-18-viola-gituttio-schuhed">nike zoom structure 18 viola gituttio</a> <a href="http://www.ax619meh.com/adidas-john-wtodas-2-rosado-naranja-chaussurese">adidas john wtodas 2 rosado naranja</a> <a href="http://www.172h9yel.com/asics-asics-gel-kayano-17-blu-gituttio-obuvf">asics asics gel kayano 17 blu gituttio</a> <a href="http://www.wo90dhgd.com/dam%C3%A4nner-nike-kobe-9-low-blau-lila-kurpese">dam盲nner nike kobe 9 low blau lila</a>
    rnokcrc1 http://www.rnokcrc1.com/

  10. avatar firstbizswmo

    <a href="http://www.bisbeegrille.com/nike-free-3.0-v4-dam%C3%A4nner-rosa-skob">nike free 3.0 v4 dam盲nner rosa</a> <a href="http://www.floozyspeak.com/adidas-superstar-2-light-blau-shoesv">adidas superstar 2 light blau</a> <a href="http://www.gregnovak.com/adidas-yeezy-boost-350-black-gold-runninga">adidas yeezy boost 350 black gold</a> <a href="http://www.tubomet.com/oakley-sunglasses-si-m-frame-2.0-sunglassesr">oakley sunglasses si m frame 2.0</a> <a href="http://www.checkmyprices.com/reebok-gl-6000-white-shoesv">reebok gl 6000 white</a> <a href="http://www.jonvietor.com/nike-air-huarache-ultra-mens-black-and-white-skow">nike air huarache ultra mens black and white</a>
    [url=http://www.firstbizswmo.com/]firstbizswmo[/url]

  11. avatar visasdecanada

    <a href="http://www.armyourmind.com/pink-womens-nike-blazer-low-foota">pink womens nike blazer low</a> <a href="http://www.giorgiocarusi.com/prada-messenger-leather-trench-pradad">prada messenger leather trench</a> <a href="http://www.yummyfitmummy.com/mulberry-albert-messenger-bag-womens-mulberrya">mulberry albert messenger bag womens</a> <a href="http://www.brickpopusa.com/nike-lebron-soldier-10-dam%C3%A4nner-grau-sneakerg">nike lebron soldier 10 dam盲nner grau</a> <a href="http://www.coypon.com/hermes-kelly-wallet-black-hermesr">hermes kelly wallet black</a> <a href="http://www.lottopurchase.com/adidas-nmd-runner-vapour-pink-light-onix-exclusive-zero-shoesv">adidas nmd runner vapour pink light onix exclusive zero</a>
    visasdecanada http://www.visasdecanada.com/

欢迎留言




用户登录

sitemap