用 BAT 调用 ADB 命令,第一条能运行,第二条显示不是内部命令,请问怎么弄。。。

2020-06-18 14:19:43 +08:00
 AzsharR

我在 bat 这方面是个新手,不是很了解,网上查了 也查不到 就想做个半自动安装的 bat 脚本

adb devices ::adb shell ::查询手机连接情况

@set /p path=APK path:

adb install %path%

::echo end pause

4777 次点击
所在节点    Android
6 条回复
greed1is9good
2020-06-18 14:29:30 +08:00
自己看下 adb 命令+linux shell 命令
hu8245
2020-06-18 14:32:08 +08:00
用 powershell 吧, 很好用。
LLaMA2
2020-06-18 14:35:01 +08:00
你调用了 adb shell
之后执行的命令回显管道已经没有了
你可以试着如下
举例


@echo off
:begin
adb disconnect
set input=
set /p input=please input your device IP:
adb connect %input%
echo rooting this device!
adb root
echo remounting
adb remount
adb shell content query --uri content://telephony/carriers/preferapn
echo replace APNs config file
adb push apns-conf.xml /system/etc
adb push apns-conf.xml.bakforspec /system/etc
echo restoring default APN
adb shell "content delete --uri content://telephony/carriers/restore"
echo this device id is
adb shell "settings get secure android_id"
echo show file stat
adb shell "busybox stat /system/etc/apns-conf.xml"
adb shell "busybox stat /system/etc/apns-conf.xml.bakforspec"
echo press any key for continue!
pause>nul
goto begin
no1xsyzy
2020-06-18 14:41:40 +08:00
跟 ADB 没关系,你覆盖了 PATH 环境变量
RIcter
2020-06-18 14:54:24 +08:00
@set /p path=APK path:
...
dingwen07
2020-06-18 16:38:37 +08:00
set /p apkpath=APK path:

adb install %apkpath%

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/682682

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX