问题描述
我最近开始尝试在MacOS计算机上的 Android Studio
中运行应用程序时遇到问题。我尝试从 adb
运行命令,但仍然无法正常运行,尽管错误看起来有所不同。
I've recently started encountering problems while trying to run my application from Android Studio
on my MacOS machine. I tried to run the command from adb
myself but I still can't get it to work, although the error appears different.
我得到的错误如下;
Android Studio
java.io.IOException:管道损坏
java.io.IOException: Broken pipe
安装时出错APK
adb(通过Terminal.app)
adb:错误:65536字节写入失败:
未定义错误:0
adb: error: 65536-byte write failed: Undefined error: 0
现在我已经尝试过许多不同的东西,其中一些只是延伸,因为问题似乎出在与adb相关的东西上,但是这些似乎都没有改变任何东西;
Now I've tried a lot of different things, some of which are just stretches because the problem appears to lie in something adb related, but none of this seems to change anything;
- 不同的应用程序/ apks
- 不同的Android设备(共5个)
- 不同的USB端口(全部4个,
与且没有USB集线器)。 - 不同的(或没有)USB加密狗(USB-C到USB-A)
- 重新启动/无效缓存(Android Studio)
- 重新安装Android Studio
- 重新安装Android SDK
- 通过自制软件新(单独)安装Android SDK
- 重置NVRAM / PRAM
- 重置SCM
- 更新至MacOS Mojave(并重试上述所有操作)。
- Different applications/apks
- Different Android devices (total of 5)
- Different USB-ports (all 4,with and without USB-hub).
- Different (or no) USB-dongles (USB-C to USB-A)
- Restart/Invalidate Caches (Android Studio)
- Reinstall Android Studio
- Reinstall Android SDK
- New (separate) install of Android SDK through homebrew
- Reset NVRAM/PRAM
- Reset SCM
- Update to MacOS Mojave (and retry all of the above).
这时我很茫然。在没有上述解决方案解决之前,有人遇到过这些错误吗?我列表中的下一件事情是重新安装操作系统,但这感觉有点矫kill过正。
At this point I am at a loss. Has anyone encountered these errors before without having any of the above solutions fix it? Next thing on my list is a reinstall of the OS, but that feels like a bit of overkill.
我在2016 Macbook Pro上的MacOS Mojave上运行,但是一切
I am running on MacOS Mojave on a 2016 Macbook Pro, but everything appeared to have the same effect on High Sierra.
编辑
奇怪的更新在行为上,通过执行以下步骤,我可以使安装重新启动后可以连续工作;
Weird update on the behaviour, I can get the installing to work continuously after a restart by doing the following steps;
- 登录
- 启动Terminal.app
- 手动重复执行adb push命令
- (命令成功执行)
- 启动Android Studio
- 一切正常...
- Login
- Start Terminal.app
- Manually repeat adb push command
- (Command executes successfully)
- Start Android Studio
- Everything works fine...
但是,如果我启动没有先在终端中手动执行adb推送的Android Studio,所有内容都如上所述被破坏。
However, if I start Android Studio without first manually doing the adb push in Terminal, everything is broken as described above.
编辑2
即使在启动Android Studio之前在终端中调用 adb启动服务器
也可以使一切正常。因此,当Android Studio负责启动adb服务器时,似乎出现了问题。
Even calling adb start-server
in Terminal before starting Android Studio makes everything work. So something appears to be faulty when Android Studio is responsible for starting the adb server..
推荐答案
不是一个真正的答案,而是我的问题似乎可以通过最新版本的Android Studio来解决。
Not really an answer but my issue appears to be solved with the latest release of Android Studio.
这篇关于尝试使用adb推送/安装.apk时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!