有没有办法以编程方式启动Mobile me同步?

时间:2011-04-24 23:58:13

标签: objective-c osx-snow-leopard daemon mobileme

我想要创建的是一个基于定义的计划运行Mobile Me同步的实用程序,并避免在Time Machine已经备份文件时启动它。

有没有办法从应用程序或守护程序调用Mobile Me同步?

1 个答案:

答案 0 :(得分:1)

通过NSTask或NSAppleScript使用dotmacsyncclient,位置:

/System/Library/PrivateFrameworks/DotMacSyncManager.framework/Versions/A/Resources/

用法:

Usage: mobilemesyncclient [options], version 446
    --sync
        Options:
        --entitynames <entities to sync>
        --dataclass <dataclass to sync>
        --username <account username>
        --password <account password>
        --pushtruth
        --pulltruth
    --dumpchangelog <changelog path>
        Options:
        --tdir <target directory>
    --dumpchanges <changelog number> --dataclass <dataclass name>
    --listdataclasses
        Required:
        --username <account username>
        --password <account password>
    --listdataclass <dataclass name>
        Required:
        --username <account username>
        --password <account password>
    --downloaddc <dataclass name> --tdir <target directory>
        Required:
        --username <account username>
        --password <account password>
    --uploaddc <dataclass name> --sdir <source directory>
        Required:
        --username <account username>
        --password <account password>
        Options:
        --clear
        --needstruth
    --removeclient <client name>
        Required:
        --username <account username>
        --password <account password>
    --listclients
        Required:
        --username <account username>
        --password <account password>