Misc tips for iOS development
- Best Practices
- Testing
- Swift
- Xcode
- Debugging
- UI Testing
- App Store
- In-app purchases
- Apple
- Fastlane
- CocoaPods
- To Read
- iOS-Factor: A methodology for building high-quality iOS apps on a solid architecture
- Microfeatures Guidelines
To display all current testplans related to an scheme
xcodebuild -showTestPlans -scheme MY_SCHEME
To run the tests as configured in a testplan
$ xcodebuild -project MY_PROJECT.xcodeproj/ -scheme MY_SCHEME -destination 'platform=iOS Simulator,OS=13.3,name=iPhone Xs' test -testPlan MY_TEST_PLAN
- Xcode 9.4.1
- Open terminal
- cd ~/Library/Developer/Xcode
- rm -rf DerivedData
- Source
- Open Terminal
- defaults write com.apple.dt.Xcode DVTDeveloperAccountUseKeychainService -bool NO
- Source
- Open terminal
- cd ~
- xed .
- Source
TIL: “xed .” will open the Xcode workspace or project file in the current directory. So many hours wasted typing “open projectname.xcworkspace” 🤦♂️ #swiftlang
— Michael Luís Brown (@mluisbrown) June 30, 2018
Use .gitattributes file as described here.
- Swift and Objective-C compatible
- Install through Cocoapods
- Source
- Use NSDoubleLocalizedString as a launch argument
- Source
- Xcode 9.4.1
- iOS 11.4.1
- Source
Add a run script on UI Tests target:
/usr/libexec/PlistBuddy -c "Print :DevicePreferences" ~/Library/Preferences/com.apple.iphonesimulator.plist | perl -lne 'print $1 if /^ (\S*) =/' | while read -r a; do /usr/libexec/PlistBuddy -c "Set :DevicePreferences:$a:ConnectHardwareKeyboard
false" ~/Library/Preferences/com.apple.iphonesimulator.plist || /usr/libexec/PlistBuddy -c "Add :DevicePreferences:$a:ConnectHardwareKeyboard
bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist; done
- Guidelines
- Source
- Testing Auto-Renewable Subscriptions on iOS
- How to Set Up and Test an Auto-Renewable Subscription for an iOS App
- Five In-App Purchase Mistakes to Avoid
- Best practices Technical Note TN2387
- FAQ Technical Note TN2413
- In-App Purchase Debugging Lessons
- What to do if In-App Purchases stop working?
- The Definitive Guide to In-App Purchases Using Swift
- What should the app do in response to a deferred SKPaymentTransaction?
- App Store Receipt Validation
- Version Control with AVG
- bundle exec fastlane beta
- If you want to skip waiting for the processing to be finished, use the
skip_waiting_for_build_processing
option - Unable to locate Xcode. Please make sure to have Xcode installed on your machine
The Google Cloud API clients work best on supported versions of Ruby. Consider upgrading to Ruby 2.4 or later. See https://www.ruby-lang.org/en/downloads/branches/ for more info on the Ruby maintenance schedule. To suppress this message, set the GOOGLE_CLOUD_SUPPRESS_RUBY_WARNINGS environment variable.
Proceed with:
- https://medium.com/@IanRahman/how-to-upgrade-ruby-on-a-mac-a592c6085c63
- rvm/rvm#4215
- https://rvm.io/rvm/security
Your bundle is locked to json (1.8.3.1), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of json (1.8.3.1) has removed it. You'll need to update your bundle to a version other than json (1.8.3.1) that hasn't been removed in order to install.
Proceed with:
$ bundle update
Execute the following on your terminal to get the latest stable version:
$ sudo gem install cocoapods
Add --pre to get the latest pre release:
$ sudo gem install cocoapods --pre
You can check pod version using below command
$ pod --version
- https://www.cocoanetics.com/2014/07/development-pods/
- https://blog.takescoop.com/improve-ios-ci-build-time-with-cocoapods-caching-4a049ee45e63
$ pod spec lint
For local development Pods
$ pod lib lint
Provide an installation option to disable usage of input/output paths. #8105
- Works with CocoaPods1.6.0.beta2
- Add on the Podfile:
install! 'cocoapods', :disable_input_output_paths => true