Jaq*_*arh 6 android native ionic-framework ionic-native
连接的设备:
它正在运行开发者选项并启用了 USB 调试
它使用 MTP 作为设备文件管理器
驱动程序已安装到笔记本电脑上,没有任何问题,我可以正常浏览文件
当我运行:ionic cordova run android --device我得到这个输出:
BUILD SUCCESSFUL in 5s
42 actionable tasks: 42 up-to-date
Built the following apk(s):
C:\Users\K-PC\myApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk --device
[native-run] ERR_NO_DEVICE: No hardware devices found. Not attempting emulator because --device was specified.
[native-run]
[native-run] More details for this error may be available online:
[native-run]
[native-run] https://github.com/ionic-team/native-run/wiki/Android-Errors
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Run Code Online (Sandbox Code Playgroud)
我检查了设备是否已列出,native-run android --list并得到以下输出:
Errors (!):
ERR_UNSUITABLE_API_INSTALLATION: No suitable API installation found.
More details for this error may be available online:
https://github.com/ionic-team/native-run/wiki/Android-Errors
Connected Devices:
No connected devices found
Virtual Devices:
No virtual devices found
Run Code Online (Sandbox Code Playgroud)
我安装了 Android Studio,AVD 管理器中有两个虚拟设备:
我想将 APK 部署到连接到我的笔记本电脑的设备上,而不是这些模拟器上,但奇怪的是它甚至没有识别我的 AVD 管理器中的模拟器
我该如何解决这个问题?我希望我已经给出了足够的细节。
小智 8
我有同样的问题。
我在这里解决了这个问题:Ionic forum。
如果该命令adb devices返回设备和模拟器的列表,但该命令ionic cap run android --list无法识别这些设备和模拟器,则问题可能是所需的环境变量ANDROID_SDK_ROOT和ANDROID_HOME未设置。
$ adb devices
List of devices attached
817460470221 device
emulator-5554 device
$ ionic cap run android --list
[INFO] No native targets found.
Run Code Online (Sandbox Code Playgroud)
要设置此变量,首先找到 android sdk 位置,为此,您可以转到 android-studio 并在菜单Tools > SDK Manager中,搜索 call 部分Android Location,导出用于运行ionic命令的 shell 实例中的两个变量。
就我而言,我这样做了
export ANDROID_SDK_ROOT="/home/myhome/Android/Sdk"
export ANDROID_HOME="/myhome/myhome/Android/Sdk"
Run Code Online (Sandbox Code Playgroud)
使用亚行
adb devices
Run Code Online (Sandbox Code Playgroud)
该命令应该为您提供连接设备的列表。您必须接受电话上的调试模式。在尝试使用硬件设备运行应用程序之前,您应该检查adb是否至少与一台设备有连接。可能会出现一些问题,例如:
总之,您应该运行此代码:
adb devices,授权与电脑连接。解决上面已经评论的问题(如果有的话)。ionic cordova run android --device。| 归档时间: |
|
| 查看次数: |
16884 次 |
| 最近记录: |