官方文档 https://docs.fastlane.tools/getting-started/ios/setup/
参考文章 https://www.jianshu.com/p/5d836e89d9d1
1 安装Installing fastlane
xcode-select --install
# Using RubyGems
sudo gem install fastlane -NV
# Alternatively using Homebrew
brew cask install fastlane
2 设置 Setting up fastlane
进入项目文件夹
fastlane init
3 截屏
1. Create a new UI Test target in your Xcode project (See the top part of [this article]
(https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line))
2. Run `fastlane snapshot init` in your project folder
3. Add the `./SnapshotHelper.swift` file to your UI Test target (You can move the
file anywhere you want)
4. Add a new Xcode scheme for the newly created UI Test target
5. Edit the scheme
6. In the list on the left click "Build", and enable the checkbox under the
"Run" column for your target.
7. Enable the `Shared` box of the newly created scheme
8. (Objective C only) Add the bridging header to your test class.
* `#import "MYUITests-Swift.h"`
* The bridging header is named after your test target with -Swift.h appended.
9. In your UI Test class, click the `Record` button on the bottom left and record
your interaction
10. To take a screenshot, call the following between interactions
* Objective C: `[Snapshot snapshot:@"01LoginScreen" timeWaitingForIdle:10];`
11. Add the following code to your `setUp()` method:
XCUIApplication *app = [[XCUIApplication alloc] init];
[Snapshot setupSnapshot:app];
[app launch];
12. In the terminal run fastlane snapshot.
4上传蒲公英和App Store 官方文档 https://www.pgyer.com/doc/view/fastlane
之后执行动作打包
fastlane beta 或者 fastlane release (蒲公英和App Store)
等待就可以了中途不要中断和移动ipa位置
5 截屏组件的安装
sudo gem install snapshot
出现一个错误
You don't have write permissions for the /usr/bin directory.
解决方案
sudo gem install snapshot -n /usr/local/bin
蒲公英上传结束(可正常使用)
App Store 上传结束(就到了这一步但是却看不到二进制文件不知是什么原因-少加了一个权限)