"cordova发射成功"但手机上没有运行任何应用程序 [英] "cordova launch success" but no app running on cellphone

查看:182
本文介绍了"cordova发射成功"但手机上没有运行任何应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!我一直在阅读cordova的教程( https://ccoenraets.github.io/cordova-tutorial/),但是当我必须通过手机中的USB运行应用程序时,就会出现问题.

Good day! I've been reading a tutorial for cordova (https://ccoenraets.github.io/cordova-tutorial/) but when I get to the part where I have to run the app via USB in my cellphone there's a problem.

控制台表示启动成功,没有任何错误,但是手机中唯一发生的事情是它按下"菜单按钮,就好像它识别出该应用程序为按下菜单按钮"一样,我的手机是三星Galaxy 5(I5500).

The console says the launch was successful and there are no errors whatsoever but the only thing that happens in my phone is that it "presses" the menu button, as if it recognizes the app as a "press the menu button", my cellphone is a Samsung Galaxy 5 (I5500).

一些背景:

必须在Android Manager中安装一些最新的软件包,才能在这样的旧设备上运行该应用.

Had to install some packages in the Android Manager, all of them up to date, to run the app in such an old device.

我没有对文件进行任何更改

I haven't made any change to the files

推荐答案

我遇到了完全相同的问题,并按以下步骤解决了该问题:

I had exactly the same problem and solved it as follows:

来自此答案安装apk时似乎出现了问题.在Cordova 5.0.0上,可以在文件platform/android/cordova/lib/device.js的第101行(以及在cordova的platform/android/cordova/lib/emulator.js的311行)找到用于安装apk的adb命令.模拟android):

Problem seemed to occur when installing the apk. On Cordova 5.0.0, adb commands to install the apk can be found at line 101 of file platforms/android/cordova/lib/device.js (and at line 311 of platforms/android/cordova/lib/emulator.js for cordova emulate android):

adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"

当前命令返回给我:错误:未知选项-d"!

Current command returns to me: "Error: unknown option -d"!

如果您仅删除"-d"选项,则应用程序可以在Cordova上正常运行android.

注意:在某些系统上,您必须使用反斜杠(例如,platforms \ android \ cordova \ lib \ device.js).

Note: You have to use backslashes (e.g., platforms\android\cordova\lib\device.js) on some systems.

这篇关于"cordova发射成功"但手机上没有运行任何应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆