草庐IT

android - ADB 命令行在安装过程中挂起 (PhoneGap)

coder 2023-11-20 原文

我的 Phonegap 应用程序拒绝加载到我的 Android 设备上(即使是 HellowWorld 默认应用程序也拒绝加载)

直到今天,一切都运行得很好。 这是我的控制台日志:

***\>adb devices
List of devices attached
4c05609b        device

***\>phonegap run --device -V android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Compiling app on platform "android" via command "cmd" /c ***\platforms\android\cordova\build
[phonegap] Platform "android" compiled successfully.
[phonegap] successfully compiled Android app
[phonegap] installing app onto device
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Running app on platform "android" via command "cmd" /c ***\platforms\android\cordova\run --device

它只是坐在那里说运行……永远。

我打开了另一个终端窗口,其中 adb logcat 正在运行,并且在某个时候(可能在打印最后一行后 10-15 秒)它停止记录。终止进程和随后调用 adb logcat 导致更多挂起(根本没有日志记录)

然后我必须执行 kill-server、start-server 来摆脱这种无休止的挂起,此时 phonegap 进程终止:

       [error] An error occurred while running the android project.
***\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to d
evice: Error executing "adb -s 4c05609b install -r "***\platforms\android\bin\Po
ached-debug-unaligned.apk"": protocol failure

我试过::

  • 删除我在 C:\Users\Name 中的 .cordova 文件夹
  • 直接运行 adb 安装(没有 phonegap)
  • 部署到模拟器(同样的问题)
  • 拔出/重新插入设备
  • 重启所有设备
  • 在设备上切换“开发者模式”并撤销 USB 调试权限

我完全没有想法!

非常感谢任何提示或线索。

ADB 版本 1.0.31

运行 Android v4.3 的 Galaxy S3


编辑:

Deploying to an emulator 声称已成功完成,但该应用程序永远不会打开,也不会出现在模拟器内的应用程序列表中。所以我也没有办法在模拟器上实际测试它。

非常感谢一些帮助。


编辑 2:

经过一些进一步的修补,我发现我的问题可以更具体地描述为 当我尝试与我的设备通信时 ADB 挂起(卡住)。我确定这是因为 adb shelladb installadb push 都以与上述相同的方式失败。没有错误,只是有限的等待。

adb logcatadb devices 和其他读取功能可以正常工作,直到上述写入功能之一挂起,在这种情况下我需要执行 adb kill-serverTASKKILLadb logcat 再次工作。

不确定这些添加的信息是否有帮助,但你去吧。我还没有尝试过的最后一件事是按照 this fellow 的建议在我的手机上恢复出厂设置。 .如果我不能很快找到解决方案,我会尽我所能备份我的数据并尝试这个...

请在这成为我最后的选择之前拯救我!

最佳答案

如果这对其他人有帮助,我会遇到类似症状的问题。 ADB install -r "apk path"会无限期挂起。

我对无数问题进行了故障排除,并确定这是我的 USB 数据线长度。

我有一根 USB 延长线,可以将我的设备插入其中。我的设备电缆和 USB 延长电缆的总长度导致了这个问题。移除延长线解决了这个问题,最终我用更短的延长线替换了我的 USB 延长线作为最终解决方案。

关于android - ADB 命令行在安装过程中挂起 (PhoneGap),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21296305/

有关android - ADB 命令行在安装过程中挂起 (PhoneGap)的更多相关文章

  1. ruby - 在 64 位 Snow Leopard 上使用 rvm、postgres 9.0、ruby 1.9.2-p136 安装 pg gem 时出现问题 - 2

    我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po

  2. ruby - 在 Ruby 中编写命令行实用程序 - 2

    我想用ruby​​编写一个小的命令行实用程序并将其作为gem分发。我知道安装后,Guard、Sass和Thor等某些gem可以从命令行自行运行。为了让gem像二进制文件一样可用,我需要在我的gemspec中指定什么。 最佳答案 Gem::Specification.newdo|s|...s.executable='name_of_executable'...endhttp://docs.rubygems.org/read/chapter/20 关于ruby-在Ruby中编写命令行实用程序

  3. ruby - 完全离线安装RVM - 2

    我打算为ruby​​脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn

  4. ruby-on-rails - rails 目前在重启后没有安装 - 2

    我有一个奇怪的问题:我在rvm上安装了ruby​​onrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(

  5. ruby - 如何为 emacs 安装 ruby​​-mode - 2

    我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby​​提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs

  6. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  7. ruby - 通过 RVM (OSX Mountain Lion) 安装 Ruby 2.0.0-p247 时遇到问题 - 2

    我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search

  8. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  9. ruby - Fast-stemmer 安装问题 - 2

    由于fast-stemmer的问题,我很难安装我想要的任何ruby​​gem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=

  10. ruby - 安装 Ruby 时遇到问题(无法下载资源 "readline--patch") - 2

    当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub

随机推荐