Instrument iOS application offline
With Perfecto, you can instrument and re-sign iOS applications even if you are subjected to network and security restrictions that do not allow you to connect through the internet to Perfecto servers. Any of the following reasons may prevent you from leveraging Perfecto's online instrumentation service:
-
Your build environment is not connected to the internet
-
Your organization's security team does not permit online app transfer
-
Performance considerations prevent you from connecting to the online instrumentation service
-
You cannot install the app using Perfecto's regular app installation process
-
You have to sign your app with your organization's certificate, which prevents you from performing instrumentation during Perfecto's app installation process
If any of these restrictions apply to you, contact Perfecto Support about Perfecto's offline instrumentation option for iOS applications, a Python-based CLI instrumentation tool.
On this page:
Prerequisites
Perfecto's offline instrumentation tool for iOS requires the following:
-
macOS 12 (Monterey) or later
-
Python 3, downloaded from the python website (not from a package manager like Homebrew)
-
Access to the application's
.ipa
file to be instrumented -
Intermediate certificates in login and system keychains
To establish a certificate trust chain for Apple-issued certificates, make sure to import the intermediate certificates to both login and system keychains. You can also download the certificate from the following location: https://www.apple.com/certificateauthority
Limitations
Perfecto only supports the latest version of the offline instrumentation tool. Make sure you always run the latest version of this tool. To request the latest version, contact Perfecto Support .
If you are not sure which version you use, run the tool with the optional parameter -v
to display the current version.
If you are not sure which version is the latest version, see our Release highlights.
Installation steps
Perform the following steps to install the offline instrumentation tool. Repeat these steps whenever a new version of the tool becomes available.
To install the offline instrumentation tool:
-
Contact Perfecto Support to request the offline instrumentation tool. The Perfecto Support team will send you the offline instrumentation installation package (a file called
iOS_offlineInstrumentation.zip
). -
Extract the offline instrumentation installation package.
-
From the folder to which you extracted the package, open a command line window and run the following command, where
-t [path]
is the destination folder.
Offline instrumentation steps
Perform the following procedure to instrument your iOS application locally, offline. Repeat these steps for each app you want to instrument.
During the execution, the script reports its progress. Upon completion, the fully instrumented and signed .ipa
file is generated.
To perform offline instrumentation:
-
From the destination folder, run the following command, making sure to specify the path to the input .ipa file, the output .ipa file, and the
.mobileprovision
profile file to use.To learn more, expand the Required parameters, Instrumentation flags, and Optional parameters sections following the code snippets.
CopyExample for files located in the current folder
python3 offlineInstrument.py -i ./inputIPA.ipa -o ./outputIPA.ipa -p ./provision.mobileprovision -c "certificate name" -is -v
CopyExample for files located on the desktop
python3 offlineInstrument.py -i ~/Desktop/inputIPA.ipa -o ~/Desktop/outputIPA.ipa -p ~/Desktop/provision.mobileprovision -c "certificate name" -is -v
The following table lists the available required parameters.
Parameter | Description |
---|---|
|
The .ipa file to instrument |
|
The name of the instrumented |
|
The |
|
The name of the certificate to use |