Unable to connect to Android Phone for testing


#1

I am having a problem connecting to my Android Phone to test my App…

Questions:

  1. In which folder should I be when I use tns run , the folder containing the app folder or within the app folder?
  2. I have my phone connected but tns run produces the following result, what am i doing wrong?

C:\Users\Henry\shzen\Shzenapp\app>tns devices

Connected devices & emulators
Searching for devices…
┌───┬─────────────┬──────────┬───────────────────┬────────┬───────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ MediaPad │ Android │ 73R6R16C13000846 │ Device │ Connected │
└───┴─────────────┴──────────┴───────────────────┴────────┴───────────┘

C:\Users\Henry\shzen\Shzenapp\app>tns run
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices…
Copying template files…
Unable to apply changes on device: 73R6R16C13000846. Error is: zlib: unexpected end of file.
Error: ENOTEMPTY: directory not empty, rmdir ‘C:\Users\Henry\AppData\Local\Temp\runtimeDir118714-15056-k6o2xq.4eh0g\framework\app\libs\runtime-libs’
at Object.rmdirSync (fs.js:684:3)
at rmkidsSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:247:11)
at rmdirSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:150:5)
at rimrafSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:216:26)
at C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:245:5
at Array.forEach ()
at rmkidsSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:244:26)
at rmdirSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:150:5)
at rimrafSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:216:26)
at C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:245:5
at Array.forEach ()
at rmkidsSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:244:26)
at rmdirSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:237:7)
at fixWinEPERMSync (C:\Users\Henry\AppData\Roaming\npm\node_modules\nativescript\node_modules\rimraf\rimraf.js:150:5)

C:\Users\Henry\shzen\Shzenapp\app>


#2

any help? I encountered a similar problem.
When I run command ‘tns run ios’, an error occurs.
And here’s the output:

cloudsurf:app-x-platforms cloudsurf$ tns run ios

Support for macOS 10.11 is deprecated and will be removed in one of the next releases of NativeScript. Please, upgrade to the latest macOS version.

Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Executing before-liveSync hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-watchPatterns hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watchPatterns/nativescript-dev-sass.js
Executing before-watchPatterns hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watchPatterns/nativescript-dev-typescript.js
Executing before-watchPatterns hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watchPatterns/nativescript-dev-webpack.js
Executing before-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watch/nativescript-dev-sass.js
Found peer node-sass
Executing before-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.7.2
Executing before-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/before-watch/nativescript-dev-webpack.js
Copying template files...
Unable to apply changes on device: C3DF9809-D470-45A1-94C6-6A2FE7DA1B6E. Error is: zlib: unexpected end of file.
Executing after-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/after-watch/nativescript-dev-sass.js
Executing after-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/after-watch/nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from /Users/cloudsurf/vered/projects/App/code/app-x-platforms/hooks/after-watch/nativescript-dev-webpack.js

#3

You would need right provisional profile setup to run on iPhone. If you are just trying to run on Simulator it should work, try a clean build.


#4

I have now tried to use Visual Studio Android Emulator…

I used the steps listed in this article to get the VSAE connected:

I then created an new NS App

I was also able to see the VSAE was connected

C:\Users\Henry\shzen\shzenapp>tns devices

Connected devices & emulators
Searching for devices…
┌───┬──────────────────────────────────────────────┬──────────┬──────────────────────┬────────┬───────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ VS Emulator 7-inch KitKat (4.4) XHDPI Tablet │ Android │ 169.254.138.177:5555 │ Device │ Connected │
└───┴──────────────────────────────────────────────┴──────────┴──────────────────────┴────────┴───────────┘

But when I try to run the app I get the following:
C:\Users\Henry\shzen\shzenapp>tns run android --device=169.254.138.177:5555
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices…
Your application will be deployed only on the device specified by the provided index or identifier.
Copying template files…
Unable to apply changes on device: 169.254.138.177:5555. Error is: zlib: unexpected end of file.

At this point I am getting desperate and am thinking of using something other than NativeScript, Any Suggestions?


#5

Same here, it’s a shame they still haven’t provided a suitable answer.
Not really stimulating to try overhyped new technologies


#6

If you used tns create helloworld, you should cd helloworld to enter the helloword folder. Then tns run android (hence not only tns run as you seemed to have done.)