https://github.com/shaojiankui/sparkle-demo
Sparkle-Demo,use Sparkle framework update macOS app
https://github.com/shaojiankui/sparkle-demo
sparkle
Last synced: 3 months ago
JSON representation
Sparkle-Demo,use Sparkle framework update macOS app
- Host: GitHub
- URL: https://github.com/shaojiankui/sparkle-demo
- Owner: shaojiankui
- License: mit
- Created: 2017-06-08T04:41:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-08T05:20:56.000Z (almost 8 years ago)
- Last Synced: 2025-01-09T06:31:55.635Z (4 months ago)
- Topics: sparkle
- Language: Objective-C
- Size: 1.62 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sparkle-Demo
Sparkle-Demo,use Sparkle framework update macOS app本例使用Sparkle与github来实现macOS app的自动更新
## 配置Xcode工程
### 拖入Sparkle.framework
拖入Sparkle.framework到工程,注意Sparkle库为动态库,所以确保 工程->target->general的embedded binaries中有Sparkle.framework
### 增加代码
```
#import- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
[SUUpdater sharedUpdater].delegate = self;
[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
//............
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
}
```### 修改plist
在xcode工程的info.plist中加入key SUFeedURL,值为xml存在的服务器地址,本例xml存在github服务器中,所以为https://raw.githubusercontent.com/shaojiankui/Sparkle-Demo/master/appcast.xmlgithub appcast.xml地址拼接规则为https://raw.githubusercontent.com/github用户名/仓库名/master/文件夹名/appcast.xml
## appcast.xml
```
Changelog
https://xxxxxx/app.xml
ChangelogChangelogChangelogChangelog
en
]]>
2017-06-08 01:47:00 GMT
```
### title
为更新标题
### item
每一条item一次更新版本
### enclosure下载地址
使用github来作为更新app的下载地址
enclosure url="https://raw.githubusercontent.com/shaojiankui/Sparkle-Demo/master/Sparkle-Demo2.0.zip" length="xxx" type="application/octet-stream" sparkle:version="19" sparkle:shortVersionString="2.0">
每一个版本下载地址样式为:https://raw.githubusercontent.com/shaojiankui/Sparkle-Demo/master/Sparkle-Demo2.0.zip
地址拼接规则是 https://raw.githubusercontent.com/github用户名/仓库名/master/文件夹名/文件名
shortVersionString为新的版本号
length 为文件大小
### description
为升级log描述
### pubDate
发布时间
### 效果

## 官方文档
https://sparkle-project.org/documentation/