android 批量安装卸载bat

1 篇文章 0 订阅
1 篇文章 0 订阅
@echo off
setlocal enabledelayedexpansion
CLS
color 17
@title 安装多设备程序  By  qiuranke  2012-08-14
:MENU
echo.               =-=-=-=-=安装多设备程序菜单=-=-=-=-= 
echo.
echo. 1 运行adb start-server 等待设备接入
echo.
echo. 2 结束adb start-server
echo.
echo. 3 安装此目录下的所有apk
echo.
echo. 4 删除dellist.txt中的所有apk
echo.
echo. 5 查看列表
echo.
echo. 6 查看包信息
echo.
echo. 7 退出
echo.
echo. 请输入选择项目的序号并按回车键运行:
:0
set /p XUANXIANG= 
if "%XUANXIANG%"=="1" goto 1
if "%XUANXIANG%"=="2" goto 2
if "%XUANXIANG%"=="5" goto 5
if "%XUANXIANG%"=="6" goto 6
if "%XUANXIANG%"=="7" goto 7
goto 0
:1
echo 判断adb是否运行
tasklist /M adb* |find "adb.exe"&&echo adb已经运行&&goto 0
adb start-server
echo adb已经运行
goto 0
:2
tasklist /M adb* |find "adb.exe"&&taskkill /f /im adb.exe&&echo adb已经终止&&goto 0
echo adb未运行
goto 0
:3
adb devices >list.txt
for /f "delims=" %%a in ('findstr "^.*^ device$" list.txt')do (
	set str=%%a
	for /f "delims=" %%i in ('dir /b *.apk') do (
		echo adb -s !str:~0,-7! install -r "%%i"
		start adb -s !str:~0,-7! install -r "%%i"
	) 
)
del list.txt
goto 0
:4
adb devices >list.txt
for /f "delims=" %%a in ('findstr "^.*^ device$" list.txt')do (
	set str=%%a
	for /f "delims=" %%i in (dellist.txt) do (
		echo adb -s !str:~0,-7! uninstall "%%i"
		start adb -s !str:~0,-7! uninstall "%%i"
	) 
)
del list.txt
goto 0
:5
adb devices
goto 0
:6
for /f "delims=" %%i in ('dir /b *.apk') do (
	aapt d badging "%%i" >apkinfo.txt
	for /f "delims=" %%s in ('findstr "package: name=\'*\' versionCode=" apkinfo.txt') do (
		echo package "%%s"
	) 
	del apkinfo.txt
) 
goto 0
:7

需要如下:

adb.exe

aapt.exe

AdbWinApi.dll

AdbWinUsbApi.dll

dellist.txt  里面为删除的包名

http://download.csdn.net/detail/fang00y/4580490 下载地址……3分
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值