Fix livesync on Android devices and Genymotion emulator #1443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following fix has been applied in common lib:
On some Android devices the
android-runtime
cannot delete the files in/data/local/tmp/<app id>/fullsync
directory.The next time when the application is started, runtime reads the fullsync directory and replaces the real application with content of fullsync dir.
So the app does not start as it is not full app.
Fix two issues - first one is missing
chmod
command in the file that we are generating.As we cannot spawn chmod of all files directly, due to some command line limitations, we are writing the command in a file, transfer the file on the device and execute it.
BUT, we've lost the command in this commit telerik/mobile-cli-lib@6d52c6a
In fact our file contains only list of files and when trying to execute it on the device, we receive error, but we have added parameter to
spawnFromEvent
not to throw. So the error is hidden.Add the missing chmod, so the command can be executed successfully.
However this fixes the issues for some files, but when we have directories, we do not write them in the file, so android runtime does not have permissions to delete them and they remain in fullsync directory.
Fix this by including directories in the list of application files (not sure if this will not break something else).
Fixes #1332