This iOS StarterKit based on:
- IDE:Xcode8
- Language:Swift3
- Build tool:fastlane
- Dependency management:Carthage
- Code style check:SwiftLint
- Unit test framework: Quick + Nimble
- CI:
- Jenkins
- TBD: GoCD
- TBD:BuildKit
- Beta testing platform:
- HockeyAPP
- TBD:蒲公英
-
Install Xcode 8
-
Install rbenv
-
Install Carthage
brew install carthage -
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
Fastfilefrom thisStartKitproject and replace the project specific stuff with your own one( scheme/app_identifier/git_url/api_token/ipa). - Modify the
Appfilein./fastlane/Appfilewith your own values (app_identifier, apple_id, team_id)
- Create an
App Idfor 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.txtfile of your projects - Run
match initwith the private repo URL - Modify the generated
Matchfilein./fastlane/Matchfilewith your own values (app_identifier, username, URL) - Run
match development,match adhocormatch app_storeto install certificates and profiles(This will upload them to the private repo as well) - Run
fastlane add_devicesevery 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 Tokenfor your project fromaccount settings->API Tokensin HockeyApp - Modify
fastlane deploy_betalane in yourFastfilewith theapi_token
-
Install Jenkins
Download jenkins.war from https://jenkins.io/ -
Start Jenkins
java -jar jenkins.war -
Install required Jenkins plugins:
PipelineandGit PluginInstall 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 carthage_update - Start coding...
- Run
fastlane checkinlocally everytime beforegit push - CI will trigger
fastlane betaafter everygit pushand deploy the successful build package to HockeyApp - Run
fastlane add_devicesevery time new device is added into the file (codebase manager)
- Code Structure: MVVM (VIPPER for complex data flow)
- Local database: Realm
- Data analysis:
- Mixpanel, Nielsen
- 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
- JSON-Model mapper: ObjectMapper
- 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
- JSON parse: SwiftyJSON