我正在尝试连接我的Android手机。我希望我的NativeScript程序在我的ZTC Warp 7上运行。请帮忙。我尝试了我所知道的。感谢所有帮助。
我的操作系统是Ubuntu,我确实添加了供应商ID。
(precise)hollykwan@localhost:~$ appbuilder device
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
(precise)hollykwan@localhost:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2a Intel Corp.
Bus 001 Device 006: ID 2232:1073 Silicon Motion
Bus 001 Device 007: ID 19d2:0307 ZTE WCDMA Technologies MSM
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(precise)hollykwan@localhost:~$ ls -l /dev/bus/usb/002
total 0
crw-rw-r--. 1 root plugdev 189, 128 Jan 5 12:06 001
(precise)hollykwan@localhost:~$ sudo vi /etc/udev/rules.d/51-android.rules.
(precise)hollykwan@localhost:~$ sudo chmod a+r /etc/udev/rules.d/51-android.rules.
(precise)hollykwan@localhost:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2a Intel Corp.
Bus 001 Device 006: ID 2232:1073 Silicon Motion
Bus 001 Device 007: ID 19d2:0307 ZTE WCDMA Technologies MSM
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(precise)hollykwan@localhost:~$ sudo udevadm control --reload-rules
(precise)hollykwan@localhost:~$ sudo service udev restart
udev stop/waiting
udev start/running, process 19540
(precise)hollykwan@localhost:~$ sudo udevadm trigger
(precise)hollykwan@localhost:~$ ls -l /dev/bus/usb/001
total 0
crw-rw----. 1 root plugdev 189, 0 Jan 6 21:49 001
crw-rw----. 1 root plugdev 189, 2 Jan 6 21:49 003
crw-rw----. 1 root plugdev 189, 5 Jan 6 21:49 006
crw-rw----. 1 root plugdev 189, 6 Jan 6 21:49 007
(precise)hollykwan@localhost:~$ sudo chmod 777 /dev/bus/usb/001
(precise)hollykwan@localhost:~$ ls -l /dev/bus/usb/001
total 0
crw-rw----. 1 root plugdev 189, 0 Jan 6 21:49 001
crw-rw----. 1 root plugdev 189, 2 Jan 6 21:49 003
crw-rw----. 1 root plugdev 189, 5 Jan 6 21:49 006
crw-rw----. 1 root plugdev 189, 6 Jan 6 21:51 007
(precise)hollykwan@localhost:~$ adb devices
bash: adb: command not found
(precise)hollykwan@localhost:~$ appbuilder device
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
权限:
(precise)hollykwan@localhost:~$ ls -l /dev/bus/usb/001
ls: cannot access /dev/bus/usb/001/007: Permission denied
ls: cannot access /dev/bus/usb/001/006: Permission denied
ls: cannot access /dev/bus/usb/001/003: Permission denied
ls: cannot access /dev/bus/usb/001/001: Permission denied
total 0
c????????? ? ? ? ? ? 001
c????????? ? ? ? ? ? 003
c????????? ? ? ? ? ? 006
c????????? ? ? ? ? ? 007
(precise)hollykwan@localhost:~$ sudo ls -l /dev/bus/usb/001
total 0
crw-rw----. 1 root plugdev 189, 0 Jan 6 21:49 001
crw-rw----. 1 root plugdev 189, 2 Jan 6 21:49 003
crw-rw----. 1 root plugdev 189, 5 Jan 6 21:49 006
crw-rw----. 1 root plugdev 189, 6 Jan 6 22:07 007
答案 0 :(得分:1)
这些是一些可能的错误:
您可以验证您的设备是否与命令相关联:" tns设备",这将显示设备,否则您将无法连接,那么您可以选择其中一个显示通过命令连接的设备:" tns运行android --device你的设备ID"
您需要使用以下命令将android平台添加到您的项目中:" tns android add platform",(我建议您,即使您已经添加了平台,也要再次执行此操作,在设备之间切换时存在一些与此相关的问题。)
验证您的环境变量(例如:导出ANDROID_HOME =〜/ android /&& export PATH = $ {PATH}:$ ANDROID_HOME)是否已正确设置为" tns doctor",在Ubuntu中,我曾经有过这个错误,这让我一次又一次地执行这个步骤,当我开始一个新项目时,尝试在你的proyect文件夹中设置环境变量,这个方法工作得很好,虽然不推荐。因此,您可以识别错误,然后正确执行。