This iOS StarterKit
based on:
- IDE:Xcode9
- Language:Swift4
- Build tool:fastlane
- Dependency management:Cocoapods
- Code style check:SwiftLint
- Unit test framework: Quick + Nimble
- CI:
- Jenkins
- TBD: GoCD
- TBD:BuildKit
- Beta testing platform:
- HockeyAPP
- TBD:蒲公英
-
Install Xcode 9
-
Install rbenv
-
Install Cocoapods
gem install cocoapods
-
Install Fastlane
gem install fastlane --verbose
-
Install SwiftLint
brew install swiftlint
Admin Setup (admin or codebase manage, who is managing the Apple account, development/distribution certificates.)
- Apply account for apple developer program
- Create a new project from xcode manually
- Run
fastlane init
- Copy the
Fastfile
from thisStartKit
project and replace the project specific stuff with your own one( scheme/app_identifier/git_url/api_token/ipa). - Modify the
Appfile
in./fastlane/Appfile
with your own values (app_identifier, apple_id, team_id)
- Create an
App Id
for your project - Add all the testing devices' UUID in
devices
Reference: `Usage` - `Setup` at `https://github.com/fastlane/fastlane/tree/master/match`
- Create a private repo (name it something like certificates)
- Write all the testing device’s UUID in the
./devices.txt
file of your projects - Run
match init
with the private repo URL - Modify the generated
Matchfile
in./fastlane/Matchfile
with your own values (app_identifier, username, URL) - Run
match development
,match adhoc
ormatch app_store
to install certificates and profiles(This will upload them to the private repo as well) - Run
fastlane add_devices
every time new device is added into the file
- Register a HockeyApp account
- Create an app manually in HockeyApp (with your project bundle identifier)
- Create an
API Token
for your project fromaccount settings
->API Tokens
in HockeyApp - Modify
fastlane deploy_beta
lane in yourFastfile
with theapi_token
-
Install Jenkins
Download jenkins.war from https://jenkins.io/
-
Start Jenkins
java -jar jenkins.war
-
Install required Jenkins plugins:
Pipeline
andGit Plugin
Install from jenkins console:
Manage Jenkins
->Manage Plugins
-
Generate Credential
Generate from jenkins console:
Credentials
->Global credentials
->Add Credentials
-
Create new project
Create from jenkins console:
New Item
-> Choosepipeline style
-
Configure project
Configure from jenkins console:
Build Triggers
-> Choose Pipeline definationPipleline script from SCM
-> Fill the form with the created credential.
- Clone your own Repo generated by the codebase manager
- Setup the development environment as above and run
fastlane cocoapods_update
- Start coding...
- Run
fastlane checkin
locally everytime beforegit push
- CI will trigger
fastlane beta
after everygit push
and deploy the successful build package to HockeyApp - Run
fastlane add_devices
every time new device is added into the file (codebase manager)
- Code Structure: Clean Swift
- Local database: CoreData
- Data analysis:
- Fabric
- Umen
- Push notifications
- SNS
- Umen
- Login or sharing by third party library such as facebook, WeChat: Use the official SDK for each
- Testing
- Unit Test: Cover all the view model、utils, etc.
- Functional Testing: Cover the main business scenarios.
- UI Automation Testing: According to the functionality of the app, and the benefit/cost of your team.
- Common libraries
- Security scanning: danger
- Network: Alamofire
- Spinning: SVProgressHUD
- Image cache: Kingfisher
- Autolayout: SnapKit
- Other good libraries
- Access keychain library: KeychainAccess
- Date formatter library: iso-8601-date-formatter
- Time formatter library: TimeAgo
- Form library: XLForm
- Keyboard library: IQKeyboardManager
- Logging: XCGLogger
- Data cache: Haneke