Triggering sync with adb shell command



  • Hello!

    I am trying to script the adb push of my ics file to Android device and then trigger ICSDroid update from Linux Bash script.

    So far I tried

    adb shell requestsync
    

    with console response:

    Requesting sync for: 
    Account: all
    Authority: All
    

    But no actual update was apparently triggered to ICSDroid.

    I found this old thread: Scripting a sync.
    But how does I put it into "adb shell" command correctly?

    Thank you!


  • developer

    Hello,

    @sokolgeo said in Triggering sync with adb shell command:

    But how does I put it into "adb shell" command correctly?

    I don't know whether this is possible. You could have make a small app that catches a certain Intent and initiates a sync upon the Intent is received. Then you can send the intent with adb shell am.



  • Sorry, but I am not Android developer. Effort to set up dev environment, learn, and code 'a small app' is prohibitively high for me as of now.

    I mean if coding the 'triggering sync via intent' feature is easy - why is it not in ICSDroid already? And if it is hard to code - then why asking every user who needs it to re-implement it individually by himself?

    Opening ICS droid app and manually trigger sync every time my script uploads new version of ICS file is plain unfeasible!

    Setting ICS droid to autosync every 15 minutes would mean:

    1. battery waste on unnecessary syncs, especially through the night, when nothing happens and yet ICS Droid would waste battery power on re-syncing my rather big ICS file.

    2. still no assurance that my Android calendar is up to date. When script uploads new ICS file it would take ICS Droid scheduled sync up to 15 minutes to start picking it up.

    As alternative to developing small Android app to make another Android app to work I am presently looking into
    this
    https://f-droid.org/packages/org.sufficientlysecure.localcalendar/
    to create offline Android calendar

    and then this
    https://f-droid.org/en/packages/org.sufficientlysecure.ical/
    to sync ICS file into the offline calendar

    At least it has 'load calendar' mentioned as intent in manifest: https://github.com/PrivacyApps/calendar-import-export/blob/185af643e2c4c73bca56c6183382ed3f54cb3b72/CalendarImportExport/src/main/AndroidManifest.xml
    so the hope is here.

    Any experience with this route?
    Any advice regarding other GPL-compatible toolchains to load ICS files to Android offline calendar by script via ADB?