iOS development--three formats for the programmer Essentials &ios installation package: Deb, IPA, and pxl explanations and instructions

Source: Internet
Author: User

Explanations and instructions for the three formats of the iOS installation package, Deb, IPA, and PXL

There are three types of installation packages available on the IOS platform, Deb, IPA, and PXL.
From the link: http://fanlb.blogbus.com/logs/80466716.html thanks to the author for sharing!
The Deb format is the Debian system (including Debian and Ubuntu) exclusive installation package format, with APT Software management system, is currently a very popular under Linux installation package. After entering the 2.x era, Cydia author Jay Freeman (Saurik) transplanted to the IPhone platform, together with the APT software management system.

    • The IPA format is Apple's proprietary software installation package launched on the IOS platform, which was officially used at the start of the 2.0 firmware and is the only official installation package on the Iphone/ipod Touch/ipad platform.
    • The PXL format, which originated from the pkg installation package on MAC systems, was widely used in the 1.x firmware era and was once the only software installation package on the IPhone platform, and is still in use by 91 of other software.

. Deb
Deb is the installation package under the Unix system (essentially Linux), based on the tar package, so that it will log the file's permissions (read/write/execute) and the owner/user group itself.

Because the Unix class system has strict requirements on permissions, owners, and groups, and the Deb format installation package often involves the system to compare the underlying operations, so the settings such as permissions are particularly important.

The Deb package itself consists of three parts:
    • The data packet contains the actual installed program data, the file name is Data.tar.XXX;
    • Installation information and control script package, including Deb installation instructions, logos, scripts, etc., the file name is control.tar.gz;
    • The last one is some binary data for the Deb file, including the file first class information, which is generally invisible and can be seen in some software.

The deb itself can use different compression methods. The tar format is not a compressed format, but rather a direct collection of scattered files and directories, and records their permissions and other data information. Previously mentioned Data.tar.XXX, here XXX is after the compression of the suffix name. The compression format used by Deb is in gzip format, so the most common is data.tar.gz. Often the compression format also has bzip2 and Lzma, wherein the LZMA compression rate is the highest, but the compression requires CPU resources and time are relatively long.

Data.tar.gz contains the actual installed program data, and during the installation process, the data in the package is extracted directly to the root directory (that is/), so you need to set up the appropriate file/directory tree according to the location of the file before packaging.

The control.tar.gz, however, contains the control information required for a Deb installation. There are generally 5 files:
    • Control, using the record software identification, version number, platform, dependency information and other data;
    • Preinst, a script that runs before unpacking the data.tar.gz;
    • Postinst, a script that runs after unpacking the data;
    • Prerm, when uninstalling, the script to run before deleting the file;
    • POSTRM, a script that runs after deleting a file;
    • In the Cydia system, Cydia's author Saurik added another script, Extrainst_, which works like Postinst.

For more information about Deb and packaging instructions, see this sticker on the 1 floor: http://bbs.weiphone.com/read-htm-tid-669283.html. IPA
People who have used Mac OS probably know that most of the software under the Mac has only one. App directory, which contains all of the program's resources and executable files. In short, the software under the MAC is like the green software under Windows, it can be used after decompression, no need to install, uninstall and then only remove the program files (here does not involve PKG format installation package). The IPA format can be seen as a derivative of this. App software.

The IPA file is essentially a ZIP archive package (not a RAR or 7z package) that contains 3 components:
    • The. App directory under the payload directory, which is the main program of the software;
    • Itunesartwork, in essence, is a PNG image with no suffix, used to display icons in iTunes;
    • Itunesmetadata.plist, record the purchaser's information, price and other data.


Since the ZIP package cannot record the permissions and owner information, Apple specifies the IPA installation method, that is, all IPA will be unpacked installed in the/var/mobile/applications directory, all files and directories of the owner and user groups are set to Mobile (ID 501), The permissions of the main program (executable file) are set to 0755 (everyone can execute, but only the owner can modify it), and the executable is defined in plist. The full directory permission is set to 0755, and all other files are set to 0644 (only the owner can modify it, the rest is only allowed to read, and no one is allowed to do it).

IPA after unpacking is not placed directly in the applications directory, but placed in a series of random code in a directory, its role is to allow this software to run in a specific sandbox (sandbox), can not interfere with other software. Therefore, in addition to the three components of the IPA itself, there are three directories in the Random code directory:

    • The Library, usually using the storage settings files and other data;
    • Documents, storing data, multi-use Save archive;
    • TMP, temp folder.


Since this software can only be run in this particular directory (of course, some programs will call the system's contacts, cameras and other components, but still limited), thus ensuring the security and stability of the entire system.

Because of the strict rules of the Unix system, the "ultra vires" behavior is absolutely not allowed. For example, mobile users do not have permission to delete root files because root has more privileges than mobile. Therefore, some people in the IPA after the installation of the file, such as the Chinese or modify the archive, found that the clean software can not be deleted, or can not be saved, because the deletion can not delete the root of all the files, the program itself can not be the root of all the archive files to write operations.

. pxl
The PXL format was the only installation format on the IPhone platform in the 1.x era, since there was no Cydia such as APT management software, and Apple officially did not launch the APP Store. As a result of the popularity of the 1.x era, in the next App Store era, the PXL format in its relatively simple packaging and installation methods, still occupy a large part of the market. But with the Installer of the development, Ibrickr and other software to stop the update, the only still persist in the use of PXL format is only 911 left.

The PXL installation package typically consists of 3 components:

    1. Pxlpkg.plist the location, owner, authority and software identification of the recording program files;
    2. Pkgscript folder, storing installation and uninstallation scripts;
    3. Program Files.



The beginning of the Pxlpkg.plist file is usually Cfbundleidentifier, which records the unique identification of the software to differentiate it from other software. Rdpxlpackageversion records the software version. The rdpxlpackagefireware is used to record the firmware version that can be run. The rest of the key values are used to record software introductions, URLs, author information and other data.

In addition to software identification, software versions, and available firmware versions, the core of Pxlpkg.plist is the Rdpxlpackagefiles and rdpxlpackagepostflight two items. Rdpxlpackagefiles records the path to which the program file should be copied, and provides the parameters for overwriting: overwrite. Rdpxlpackagepostflight, however, records the owner and the permissions that the program file should be given, and is implemented with Chown and chmod commands, respectively. Also, for PXL with installation/uninstallation scripts, the corresponding script postflight and Preremove are executed with the SH command.

Pkgscript typically contains two files, scripts executed after installation postflight and scripts executed before uninstallation Preremove, both of which are standard Linux shell scripts executed with the SH command.

Features of the installation package

. deb

    • Rich resources: Cydia on its own a lot, not to mention any format of the installation package can be converted to Deb.
    • Relatively convenient online purchase mode: Cydia store, although there is no APP store 5 device restrictions, but for domestic users, payment method is more difficult.
    • Crack is more difficult, not using the APP Store authentication method, so must be verified and anti-cracking measures to join the program inside, so it is more difficult to crack, it is a good thing for software developers.
    • Complete Unix File system support: No need to set file permissions, owners, and user groups with a command (also can be set by script)
    • Complete Scripting support: 5 scripts are executed in the order of installation and uninstallation, providing more options. such as backup and restore operations, you can back up files in Preinst, and restore files in POSTRM
    • Strict dependencies: Deb follows strict dependencies (specified in Depends and pre-depends) to ensure that the software runs the necessary components. The dependent packages are automatically installed when they are installed online. Unloading is also important, such as package A depends on B, when uninstalling B will be prompted a to rely on B, unloading B will cause a can not be used, so as to ensure the integrity and stability of the system.
    • The existence of Conflicts, replaces, provides and other key values can implement conflicting prompts or replace other packages.
    • Full permissions: Because Deb has to run as the highest-privilege root, Deb can operate anywhere on the system, in other words, Deb has full control over the entire system, so the Deb installer software can implement many of the functions that IPA cannot implement.
    • Relatively simple access (online or offline) and installation methods, do not worry about syncing on different machines will delete the program problem.
    • Installation is relatively simple: in fact, no matter what kind of installation package, the installation method is not very complicated, but deb slightly more complex.


There are roughly 5 ways to install Deb :

    1. Cydia or similar APT management software is installed online, this is the best way to install, because usually do not have to consider the dependency relationship, but the disadvantage is that the requirements of the network is relatively high;
    2. Installed as Dpkg-i xxx.deb in the command line, the advantage is that you can install multiple deb at once with a wildcard, and you can see the health of the script and the prompt for installation success/failure, with the disadvantage of requiring command-line software support such as the console of the PUTTY/WINSCP/issh /mobileterminal, many people are also unfamiliar with command-line operations. In addition, the icon will not be displayed when the installation is finished;
    3. Place a restart installation in the AutoInstall directory. This method is actually a startup script provided by Cydia, in each system startup with the DPKG command to install the AutoInstall directory of Deb, the advantage is not required command line operation, the disadvantage is that it must be restarted, some even to restart two times, there will be no display icon of the situation;
    4. With IFile installation, the advantage is the graphical operation, the desktop will display icons, the disadvantage is not to install multiple deb at once;
    5. Installed with Cyder II software, the principle is to simulate an APT software manager to download the appropriate Deb file and upload it to the device, and then install it in several ways.


In general, the installation of Deb depends on the dpkg-i command to install, but some of the command line to enter commands, some of which provide a graphical interface. But in addition to Cydia installation one way, the remaining several installation methods have some common problems:

    • Does not search for dependencies on its own, it must manually provide the dependent deb;
    • Cydia will read some of the special statements in the installation script, such as executing only during a fresh installation, not during the upgrade, restarting springboard or devices after installation, and so on.



Of course, the uninstall of the Deb software is also relatively simple, there are two ways:

    • Cydia Uninstall, the advantage is the uninstall process and prompt information is very detailed, full graphical interface operation, but also provides the option to reinstall;
    • Unload with dpkg-r package_id command or dpkg-p package_id command (details will be said later);
    • Cydelete to uninstall, the advantage is that you can directly on the desktop to uninstall the software has icons, but for those without icons powerless.



In fact, whether it is installed or deleted, you can only have a full manual method. That is, after unpacking Deb, you put the file in the appropriate location, then set permissions, and execute the script. But is that necessary?

The installation process for Deb is as follows:

    1. Read the database and lock it down to avoid having two setup programs running at the same time
    2. Read the package (bundle ID) and version information in control and search the database, if it exists, then install it after uninstalling;
    3. Check Depends, Pre-depends, Conflicts, and replaces, and if the software already exists in the Conflicts is detected, an error is made and the installation is terminated. If the software specified by Pre-depends is not found, an error is given and the installation is terminated. If the software specified in the replaces is found, uninstall it;
    4. Writes data to the/var/lib/dpkg/status file;
    5. Executes the Preinst script (if any);
    6. Unpack the data.tar.gz, place the file in the appropriate location, and write the file list to/var/lib/dpkg/info/xxx.list;
    7. Run the Postinst and Extrainst_ scripts (if any);
    8. If the previous installation is not an error, that is, the installation is successful, then the status file will be written status:install OK installed information, otherwise it will write other state data, such as unpacked (unpacked data), Failed-config (script failed to execute successfully), half-installed (installation failed, etc.);
    9. Reload the database and unlock it.



The uninstallation process for Deb is as follows:

    1. Read the database and lock it;
    2. Search the database according to the software identification;
    3. Check if there is software dependent on the software to be uninstalled, if there is a prompt, and interrupt uninstall;
    4. Executes the Prerm script (if any);
    5. Read the/var/lib/dpkg/info/xxx.list file and delete all files and non-empty folders recorded in the list file;
    6. Run the POSTRM script;
    7. If the Unload command is Dpkg-r, keep the record in status and change to Status:not installed, or delete all data if the unload command is dpkg-p;
    8. If the uninstallation process is not error-free, re-read the database and unlock it.



Because the Deb-installed software may place the archive file under/var/mobile/documents at run time, or place the settings file under/var/mobile/library/preferences, and these files are not recorded in the list file, So the uninstallation will not be deleted.

. IPA
    • Rich resources: There are so many resources on the App Store, Apptrackr and other websites offer a lot of cracked versions.
    • Well-updated, post-service.
    • can only use minimal permissions to guarantee security.
    • does not involve system-level operations, so it is generally not easy to cause a crash or white Apple (some are stuck because of resource consumption too much).
    • A convenient way to install it, whether it's installed directly on the device with the App Store, syncing with ITunes, or using third-party software like Installous and 91, is a quick and easy way to install.
    • Super-Simple uninstallation: what's easier than just a single X to unload?
    • is completely deleted, leaving no junk files (such as archives, settings files, etc.)
    • Overall, it's easier to hack, but now more and more software is adding anti-cracking measures.



mentioned before, the IPA software is installed in a similar sandbox environment, in addition to the/VAR/MOBILE/MEDIA/DCIM directory (photo, storage directory) operation, or call wallpaper, ringtones, cameras and other components, can not interfere with the system, This ensures the stable operation of the system and does not interfere with the normal use of other software. But the problem is, because the IPA software has very low permissions, want to modify the system, especially when applying patches, IPA can do nothing.

IPA Software official installation method There are two, one in the app Store software to download the installation, the second is to sync with ITunes.

The former is mainly a network problem, the speed is not good easy to install failure, GPRS and other online installation and consumption of traffic. The latter problem is mainly not used under different systems (including different computers and different systems on the same computer), synchronization on other systems will erase the original software. Of course, ITunes's long synchronization time is often criticized. Especially when installing software is much more, the backup before each synchronization takes a long time, this is disgusting (but can be directly X off the backup operation).

There are some problems with these two ways, so many people will choose to use Installous or 91来 to install the IPA, which is a good choice indeed.

Installous is generally not a problem, but it is not very good for some of the more rigorous IPA processing. Although installous can basically replace ITunes, it's not exactly the same. The most typical is that installous installs Microsoft's official Live Messenger (genuine, non-cracked version) when it does not run. In fact installous to a lot of non-cracked genuine software support is not very good.

As for 91, it is often criticized. 91 Although the IPA can be installed, but in addition to installous all the genuine software support issues, because 91 of the installation mechanism is defective, the software can not implement multiple languages, will only use the English interface, and ignore the zh_cn.lproj,zh_tw.lproj these language packs. This is a tragedy for those who wish to use the Chinese version. So it is usually to avoid using 91来 to install the IPA.

As for Uninstall , three ways:

    • Press and hold the icon on the device until you start shaking, click the X in the upper left corner of the icon to uninstall;
    • Uncheck in ITunes, then sync
    • Locate the appropriate directory under/var/mobile/applications and forcibly delete the entire folder. This can be used in the previous two methods (sometimes unloading too large software, such as more than 1G, because the removal process is too long to cause loss of response and delete failure. ), but this method can cause instability in the system. Unless you do have a problem, it is strongly recommended that you do not use it .

. pxl

    • Strictly speaking, the PXL format is not a lot of resources, but also a lot. The vast majority of the PXL format is now 91 users.
    • In terms of timeliness, a lot of software (mainly on the App Store) will be turned into a pxl format immediately, so the PXL format update is good.
    • Since 91 phone assistants do not have iTunes syncing to erase the software, plus some other more convenient features, so many beginners are starting from 91 to understand and familiar with the use of Iphone/ipod Touch. As a result, the PXL format relies on 91 to survive.
    • The popularity of the PXL format is not a relic of history, but is in line with the needs of the market law. The convenient software management of the 91 assistants, especially the support for WiFi management, plus the banner of free, make the PXL format popular in the new hands.



In fact, the PXL format and the Deb format have exactly the same functionality. Although PXL cannot log file permissions and other data, it can be fully compensated with a script. That is to say, the PXL format and the Deb format are actually not comparable. And because the PXL format does not need to be relatively rare in the Unix environment, especially the Debian environment, which itself is better than the Deb format.

But why do so many people now often say not to use PXL? I personally think that the main reasons are as follows:

  • Resource Limitations : In addition to several software developed by the 91 companies themselves, all the software is converted from Deb and IPA. If the original software is not cracked, pxl can do nothing (such as Microsoft's official Live Messenger and Cydia on a few cracked software);
  • Resource timeliness : Similar to the above, the PXL format is mostly converted from other formats, compared with the original is always slower, especially when unable to crack, PXL will not come out at all;
  • There is a limited level of packaging : Many people now use 91 assistants to pack their pxl directly. For most programs that have only one Xxx.app directory, there is generally no problem, but if you meet the software that has strict requirements for data such as file permissions (such as executable files that do not have executable permissions, or mobile users cannot overwrite root files, etc.), or need more complex script to run the software, often pxl producers and do not have the ability to make a perfect pxl out, which also led to a lot of installation and use of the problem;
  • Security : Most people in the production of PXL are accustomed to use the CHMOD-R command to the entire Xxx.app directory and all of the files and subdirectories in the 755/775/777 permissions, and this behavior will cause a certain security risks. For the meaning of these figures, please search for the relevant information yourself. Here is a brief explanation. The 644 attribute indicates that only the person with that file can overwrite, and anyone else can only read it, and nobody can execute the file. 755 and 775 are added to the 644 based on the executable permission, 755 is the user group where the file is located can be rewritten by everyone. The 777 permission identifies anyone who can rewrite and execute. Since mobile is a limited account, if you use 777 permissions, you have the opportunity to gain control of the entire system through this vulnerability. Just because the IPhone system is relatively closed, it's not too organic to cause losses. However, the use of 775 and 777 permissions is not expected;
  • IPA to PXL archive problem : A lot of people have this experience, after the game A archive into game B, archive B and then into a, found that A's archive is no longer. The reason is that the IPA converted to the PXL software, the archive is all placed in the/var/mobile/documents directory, and just two software archive file name is the same (most common is data.sav or save.data), overwriting each other resulting in unreadable. This problem also occurs on the IPA transfer Deb, and can not be resolved;
  • cannot be completely deleted : When uninstalling the PXL format, the data such as archive files, configuration files, temporary files and so on will not be deleted, and the long-term use may result in reduced available space;
  • compatibility issues exist on some models : Some machines have escaped from the/applications directory in the system partition to the/var/stash user partition. Because the system partition has very little free space (the default 500MB, usually not more than 50MB of free space), forcing the installation to/applications will result in the exhaustion of the remaining space or the installation failure.



It can be seen that the problem of PXL format is more than the problem of PXL itself, but the problem of the packager and the installation of defects caused by the way.

Also to point out is that the largest provider of PXL, 91, is often reproduced by the release of the software (including the netizen himself to buy cracked, or Cydia directly downloaded) and then as their own release of the software, the issue of copyright is completely out of mind, which also caused a lot of people, especially the original publisher's antipathy. This blatant plagiarism is indeed shameful. Because of this, many people are unhappy because of the 91 pxl, this is really wronged PXL format itself.

Install and Uninstall :

    • 91 Mobile Phone Assistant
    • 9,100 Treasure Chest

    • PXL to IPA http://bbs.weiphone.com/read-htm-tid-569364.html
    • PXL Turn Deb http://bbs.weiphone.com/read-htm-tid-692225.html


The PXL format was the only installation package format in the 1.x era, leaving us too many memories, and we should still honor and respect the contribution of PXL. But with the development of the Times, PXL has been old state, just like Installer exit, PXL will eventually exit the market and be enshrined in the Hall.

Summarize

    • The general software is to use the IPA format as far as possible, do not use the IPA converted to the Deb or PXL format, so as to ensure compatibility and security. And at the system level program (such as SBSettings and Input method), IPA is absolutely incapable, then the best choice is Deb. Pxl as quickly eliminated the format, or decisive to give up better.
    • As for the IPA and Deb installation methods, the IPA installation is preferred iTunes sync and App Store online installation, secondary select Installous, to ensure optimal compatibility. Deb's installation preferred Cydia online installation, the secondary selection of 91 other than any other installation method.
    • In any case, it is not recommended to install IPA and Deb with 91来, because the 91 installation mechanism is not perfect and is prone to problems.

iOS development--three formats for the programmer Essentials &ios installation package: Deb, IPA, and pxl explanations and instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.