-
Notifications
You must be signed in to change notification settings - Fork 55
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
Podfile
with no extension:touch Podfile
-
Add the Kiwi reference to the Podfile:
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
-
Run
pod install
from 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
Test
in the sidebar, then click the+
button to add theKiwiUnitTest
target. At this point,⌘-U
should result in Xcode executing the default (failing) test. -
Under the
KiwiUnitTest
target, set theBundle Loader
Build Setting to the main target's executable, e.g.$(BUILT_PRODUCTS_DIR)/MyProject.app/MyProject
-
Under the
KiwiUnitTest
target, set theTest Host
Build 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
Podfile
with no extension:touch Podfile
- Add the Kiwi reference to the Podfile (Replace
KiwiUnitTest
with your Unit Test Target's name).
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
- Run
pod install
from 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 Tests
option. - Close your Xcode Project and use the terminal to navigate to your project's directory.
- Make a new file called
Podfile
with no extension:touch Podfile
- Add the Kiwi reference to the Podfile (Replace
KiwiUnitTest
with your Unit Test Target's name).
platform :ios
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi'
end
- Run
pod install
from the command line. - Open the newly created Xcode Workspace file and run your tests with ⌘-U