Cordova使用命令行运行(实际)Android设备? [英] cordova run (in real) android device using command line?

查看:281
本文介绍了Cordova使用命令行运行(实际)Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文档

我们可以通过以下方式在模拟器上运行我们的android项目:

We can run our android project on an emulator by:

cordova run android

cordova emulate android

但是如何在真正的android设备上运行项目?

But how to run a project on a real android device?

非常感谢

-编辑-

adb devices没有列出..

推荐答案

您可以在这样的设备上强制运行

You can force the run on device like this

cordova run android --device

如果收到类似找不到设备"的错误消息,请确保您具有开发人员模式并在设备上启用了USB调试,然后运行 adb kill-server然后adb devices应该列出您的设备,而cordova run android --device应该可以工作

If you get an error message like "No devices found" then make sure that you have developer mode and USB Debugging enabled on the device and also run adb kill-server and then adb devices should list your device and cordova run android --device should work

对于iOS,您可以从macOS上运行

For iOS you can run from macOS

cordova run ios --device

如果它不起作用,请确保已安装ios-simios-deploy,并且在计算机上具有开发证书和通配符配置文件. 您可以在/platforms/ios/上打开.xcworkspace文件,当您尝试运行该应用程序时,Xcode将帮助您创建证书和配置文件.

If it doesn't work, make sure you have ios-sim and ios-deploy installed and that you have your development certificate and a wildcard provisioning profile on your machine. You can open the .xcworkspace file on /platforms/ios/ and Xcode will help you to create the certificates and provisioning profiles when you try to run the app.

这篇关于Cordova使用命令行运行(实际)Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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