【发布时间】:2018-03-20 17:54:48
【问题描述】:
我正在尝试使用虚拟 android 设备让 NativeScript 在我的机器上运行。我在 linux (ubuntu 16) 机器上。
我关注了这个installation guide
我能够使用 Android Studio 的 AVD 管理器启动虚拟设备。在启动的虚拟设备上,我激活了开发人员选项并启用了 USB 调试。
运行tns doctor 产生:
$ tns doctor
NOTE: You can develop for iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios
No issues were detected.
之后,我使用 tns create HelloWorld --template nativescript-template-ng-tutorial 创建了 HelloWorldAPP,效果很好。但是当我尝试启动应用程序时,我得到:
$ tns run android
Searching for devices...
Skipping prepare.
Unable to apply changes on device: emulator-5554. Error is: The device is not authorized. Please use the --emulator flag to run the application on on an emulator.
我读到我可以像这样检查我的设备的状态:
$ tns devices
Connected devices & emulators
Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
┌───┬─────────────┬──────────┬───────────────────┬────────┬─────────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ │ Android │ emulator-5554 │ Device │ Unreachable │
到目前为止,我在寻找解决方案时所读到的都是与实际设备相关的(例如使用 USB 2.0 而不是 3.0)或使用不同的操作系统,因此我发现的“修复”不适用。
感谢您的宝贵时间!
拉斐尔·希佩
【问题讨论】:
-
尝试重启设备,对我有用
标签: android nativescript