SDK as Company-Wide Cocoapod
As an option you may make iOSDefender SDK available from within your corporate network as a Cocoapod. iOSDefender SDK is proprietary and must therefore not be provided openly on the Internet. Any questions about this can be directed to our Support team: support@preemptive.com.
Deploying this way can simplify use of iOSDefender SDK within an organization when applied to multiple projects. Doing this requires two things:
- A repository hosting the iOSDefender SDK "sources"
- A repository hosting the podspecs
iOSDefender SDK is distributed as a binary XCFramework, so the "sources" from the Cocoapods perspective is primarily the compiled XCFramework.
Setting Up the Cocoapod
These instructions describe using git for both repositories. See Cocoapods
Documentation for more details about supported alternatives to git.
These instructions assume the distribution of iOSDefender SDK
was downloaded to e.g.
~/Downloads/iOSDefenderSDK_Beta-1.2.0
.
Set up the private distribution repository:
Create an empty repository hosted at e.g.
https://yourcompany.internal/iOSDefenderSDKDistro.git
.Clone it locally to e.g.
distro/
.If updating to a new version of iOSDefender SDK, remove all existing files from repository:
rm -r iOSDefenderSDK.xcframework LICENSE.txt
Add the XCFramework and the license file from the iOSDefender SDK distribution to
distro/
:cp -r ~/Downloads/iOSDefenderSDK-1.2.0-beta/{iOSDefenderSDK.xcframework,LICENSE.txt} .
Commit these changes:
git add -u . # only pertinent when updating git add iOSDefenderSDK.xcframework LICENSE.txt git commit -m "Version 1.2.0"
Tag the state of the repository with an annotated tag:
git tag -a 1.2.0 -m "Version 1.2.0"
Push these changes and the tag with:
git push git push --tags
Create a new private podspec repository unless you already have one available.
Create a new empty private repository hosted at e.g.
https://yourcompany.internal/podspecs.git
.Add an initial commit:
Clone the repository to e.g.
podspecs/
.Create an initial trivial commit:
cd podspecs touch .ignored git add .ignored git commit -m "Initial commit" git push
Tell Cocoapods where
podspecs
is:pod repo add podspecs https://yourcompany.internal/podspecs.git
Uncomment and edit the
spec.source
entry in~/Downloads/iOSDefenderSDK_Beta-1.2.0/iOSDefenderSDK.podspec
to reflect the repository type, location, and other details of the distribution repository.Add the podspec:
pod repo push podspecs ~/Downloads/iOSDefenderSDK_Beta-1.2.0/iOSDefenderSDK.podspec
This last step will take some time as Cocoapods gets the "sources"
and verifies the .podspec
. As new versions of
iOSDefender SDK are released, this process can be repeated to
add the new versions to the existing repositories.
Using the Cocoapod
Once the Cocoapod has been set up, iOSDefender SDK can be added to a project with:
Create a
Podfile
in the root of the project with the following, or add to the existing one if there is one (updating the URL to specify the actual location of the podspecs repository):platform :ios, '11.0' target 'MyProjectTarget' do use_frameworks! pod 'iOSDefenderSDK', '1.2.0', :source => "https://yourcompany.internal/podspecs.git" end
Download the Cocoapod and create/update the workspace to use it:
pod install
Close the project if it is open, and instead open the newly created workspace.