Reputation: 21
I am trying to connect my android phone. I want my NativeScript Program runs on my ZTC Warp 7. Please help. I tried what I knew. Appreciate all help.
My Operating System is Ubuntu, and I did add the vendor 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.
The permissions:
(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
Upvotes: 2
Views: 521
Reputation: 61
These are some possible errors:
You slould verify that your device is connected with the comand: "tns devices", this will show you the devices, otherwise you won't be able to connect, Then you can choose one of the devices showed there to be connected by the comand: "tns run android --device YOUR DEVICE ID"
You need to add the android platform to your project with the command: "tns android add platform", (I recomend you, even if you already added the platform, to do it again, there are some issues related with this when changing between devices).
Verify if your ambient variables (Ex: export ANDROID_HOME=~/android/ && export PATH=${PATH}:$ANDROID_HOME) are properly set with "tns doctor", In Ubuntu I used to have this error that makes me do this step again and again when I start a new project, try to set the ambient variables inside your proyect folder, this slould work fine although is not recomended. So you can identify the error and then do it properly.
Upvotes: 1