IOS automatic packaging script

IOS automatic package script, and realize the image material, text resources, part of the code replacement and re-signature, based on Python implementation.

Github address: github.com/tzshlyt/ios…

Usage scenarios

The same app customized for different customers has the same functions but different image materials, displayed text, configuration and certificates. It takes time and effort to manually replace materials and certificates each time. Therefore, Python scripts are used to automate resource replacement and automatic packaging.

Document describing

Config.py Configuration script

Autopackage.py automated scripts

PrepareImagesTool. Py copies the image structure from the project and prepares it for replacement

The customer needs to provide

1. Name of app in Chinese and English

2. IP address of the server

3. Feedback email

4, wechat and QQ share Id, used to support the sharing of files to wechat and QQ, need to apply for wechat and QQ developer platform

5. Apply for four App ids in Apple Developer platform and download the description file, as shown in config. y

6. Export the P12 file from the MAC

7. Contents. Json in the Customization folder describes the size and image footage of the same name and stores them in the corresponding directory

Function Flow Description

Replace picture resource –> Replace Text resource –> Replace Group ID –> Replace wechat and QQ share ID –> Replace feedback mailbox –> Set server address –> Modify configuration file to re-sign different scheme–> Package IPA

Instructions (ios Developer)

Preparation stage

  • perform$ python PrepareImagesTool.py, copy the project image tocustomizationDirectory, used to provide customized pictures for customers

Packaging phase

  • 1. Install PIP

  • Install command: $python get-pip.py

  • 2. Install Python virtual environment Virtualenv

  • $ sudo pip install virtualenv

  • 3. Go to the current file directory

  • Create a virtual environment for a project

$ virtualenv env

  • Activating a Virtual Environment

$ source env/bin/activate

  • 4. Install the required Python packages
$ pip install -v Pillow==4.0. 0  // Use to compare image sizes

$ pip install -v pbxproj==2.0. 5  // Used to process xcode configuration filesCopy the code
  • 5. Configure the project

  • Put images in the Customization folder (directory structure)

  • Modify the config. py configuration file

  • 6, automatic packaging

  • Execute $python autopackage.py

  • 7. The packed file is saved in the history directory