Repository navigation
Up and Running with CocoaPods
- Follow the directions on CocoaPods' website.
-
In Xcode, add a Unit Test target to the application project (File > New > Target > Cocoa Touch Unit Testing Bundle). Name it
KiwiUnitTest -
Close your Xcode project and use the terminal to navigate to your project's directory.
-
If you don't have one already, make a new file called
Podfilewith no extension:touch Podfile -
Add the Kiwi reference to the Podfile:
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
-
Run
pod installfrom the command line. -
Open the newly created Xcode Workspace file.
-
Edit the scheme for your primary target (e.g. MyProject) (Product > Scheme > Edit Scheme). Choose
Testin the sidebar, then click the+button to add theKiwiUnitTesttarget. At this point,â-Ushould result in Xcode executing the default (failing) test. -
Under the
KiwiUnitTesttarget, set theBundle LoaderBuild Setting to the main target's executable, e.g.$(BUILT_PRODUCTS_DIR)/MyProject.app/MyProject -
Under the
KiwiUnitTesttarget, set theTest HostBuild Setting to$(BUNDLE_LOADER) -
Write some test classes, adding them to the KiwiUnitTest target.
- Close your Xcode Project and use the terminal to navigate to your project's directory.
- If you don't have one already, make a new file called
Podfilewith no extension:touch Podfile - Add the Kiwi reference to the Podfile (Replace
KiwiUnitTestwith your Unit Test Target's name).
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
- Run
pod installfrom the command line. - Open the Xcode Workspace file and run your tests with â-U
- In Xcode, create a new Project (â-Shift-N).
- Check the
Include Unit Testsoption. - Close your Xcode Project and use the terminal to navigate to your project's directory.
- Make a new file called
Podfilewith no extension:touch Podfile - Add the Kiwi reference to the Podfile (Replace
KiwiUnitTestwith your Unit Test Target's name).
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
- Run
pod installfrom the command line. - Open the newly created Xcode Workspace file and run your tests with â-U