【问题标题】:NativeScript - Emulated Device is unreachable / Device is not authorizedNativeScript - 模拟设备无法访问/设备未授权
【发布时间】: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


【解决方案1】:

这似乎是虚拟设备“Nexus”的问题。我设法使用带有 API v27 补丁的 Pixel2 使 HelloWorldApp 工作。

干杯,

拉斐尔·希佩

【讨论】:

    【解决方案2】:

    尝试以下步骤:

    1. 确保您对机器拥有完整的管理员权限。
    2. 尝试以管理员身份启动命令提示符,因为节点和 nativescript 需要它才能正常运行。
    3. 在创建模拟器时尝试将 Google API 用于 API 级别部分。
    4. 尝试在管理员模式下启动 Android SDK 管理器并尝试启动模拟器。

    希望这能解决您的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-04
      • 2020-04-05
      • 1970-01-01
      • 2018-04-11
      • 1970-01-01
      • 2015-10-16
      • 2014-05-29
      相关资源
      最近更新 更多