Skip to content

Delete /data/local/tmp/<app-identifier> file if exists on Android device #1560

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

Merged
merged 1 commit into from
Mar 2, 2016

Conversation

nadyaA
Copy link
Contributor

@nadyaA nadyaA commented Mar 2, 2016

Livesync does not work when /data/local/tmp/ file exists on Android device.
This happens when a file with name app-identifier exists in /data/local/tmp directory on device. In this case CLI is not able to create directory.

#1416

ping @rosen-vladimirov @Mitko-Kerezov

matchingFile = (listResult || "").match(regex);

if(matchingFile && matchingFile[0] && _.startsWith(matchingFile[0], '-')){
this.device.adb.executeShellCommand(["rm", "-rf", deviceRootPath]).wait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case it's a file, you do not need -r

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see some log.trace message here, informing that the file had been removed

@nadyaA nadyaA force-pushed the natanasova/android-livesync-isit-folder branch from f26da9e to 96d5b59 Compare March 2, 2016 11:10
Livesync does not work when /data/local/tmp/<app-identifier> file exists on Android device.
This happens when a file with name app-identifier exists in /data/local/tmp directory on device. In this case CLI is not able to create directory.
@nadyaA nadyaA force-pushed the natanasova/android-livesync-isit-folder branch from 96d5b59 to ec05674 Compare March 2, 2016 11:13
@rosen-vladimirov
Copy link
Contributor

👍

nadyaA added a commit that referenced this pull request Mar 2, 2016
…c-isit-folder

Delete /data/local/tmp/<app-identifier> file if exists on Android device
@nadyaA nadyaA merged commit 59a2a42 into master Mar 2, 2016
@nadyaA nadyaA deleted the natanasova/android-livesync-isit-folder branch March 2, 2016 11:45
matchingFile = (listResult || "").match(regex);

// Check if there is already a file with deviceRootBasename. If so, delete it as it breaks LiveSyncing.
if(matchingFile && matchingFile[0] && _.startsWith(matchingFile[0], '-')){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need the last check! In case the symbol is not - there will be no match :)

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

Successfully merging this pull request may close these issues.

2 participants