Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI LiveSync command conflicts with Android Studio #1081

Closed
vchimev opened this issue Oct 19, 2015 · 4 comments
Closed

CLI LiveSync command conflicts with Android Studio #1081

vchimev opened this issue Oct 19, 2015 · 4 comments
Assignees
Milestone

Comments

@vchimev
Copy link

vchimev commented Oct 19, 2015

tns livesync android command creates a folder with the name of the package (ex. org.nativescript.TNSApp) in /data/local/tmp directory on the device:

shell@hammerhead:/data/local/tmp $ ls -l                                       
drwxrwxrwx shell    shell             2015-10-19 02:20 org.nativescript.TNSApp

After that if you try to run the same project on the same device by Android Studio, it tries to create a file with the same name and fails with:

Waiting for device.
Target device: lge-nexus_5-0925b76e031fa5f5
Uploading file
    local path: /Work/TNS_App/platforms/android/build/outputs/apk/TNSApp-debug.apk
    remote path: /data/local/tmp/org.nativescript.TNSApp
Adb Transfer Protocol Error.
Is a directory

As a result you are not able to run the project until you delete the folder in /data/local/tmp.

The opposite scenario:
when successfully run the application by Android Studio, it creates a file with the name of the package (ex. org.nativescript.TNSApp) in /data/local/tmp directory on the device:

shell@hammerhead:/data/local/tmp $ ls -l                                       
-rw-rw-rw- shell    shell     9612872 2015-10-19 14:47 org.nativescript.TNSApp

After that if you try to execute tns livesync android command will not manage to sync the changes because it needs to create a folder with the name of the package in /data/local/tmp directory on the device.
As a result the livesync command does not work anymore until you you delete the file in /data/local/tmp.

@vchimev vchimev added the bug label Oct 19, 2015
@dtopuzov dtopuzov modified the milestones: 1.5.0, 1.4.3 Oct 19, 2015
@teobugslayer teobugslayer self-assigned this Oct 23, 2015
@teobugslayer teobugslayer modified the milestones: 1.6.0 (Under consideration), 1.5.0 Oct 26, 2015
@teobugslayer
Copy link
Contributor

I've done some research how best to fix this. If we rename the on-device path, we have to extensively refactor all AppBuilder clients keeping backwards and forwards compatibility.

Therefore, I propose to enhance the LiveSync process by letting android runtime delete the files at the end of livesync. So far these approaches were discussed:

  1. The CLI gives proper permissions on /data/local/tmp, and the runtime moves the temporary files and deletes the offending directory. This may not be possible on SELinux enabled devices, particularly Samsung Lollipop ones.
  2. The runtime signals the CLI that it has finished moving the files into the app private directory. The CLI deletes the offending directory.

At any rate, this bug is not critical and I postponed it for 1.6.

@blagoev
Copy link
Contributor

blagoev commented Oct 26, 2015

One caveat is that while the livesync is running we are taking up the name from Android Studio. Livesync is a "lengthy" running command. I think that's not big of a deal....

@vchimev
Copy link
Author

vchimev commented Mar 28, 2016

The scenario when the application runs by Android Studio, creates a file with the name of the package in /data/local/tmp directory and then tns livesync android command fail due to this file is fixed by #1560.

@smuellerus
Copy link

I need to delete the directory, as suggested, but I cannot access /data/local... does the device need to be rooted to do so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants