How to edit (add or delete) the contents of a .ipa file in iPad/iPhone
Solution 1
Well practically yes you can, but technically no. Your binary is codesigned, which means for this signature to be valid, all files have to be accounted for.
I recommend you create different build targets for different customers.
Solution 2
You should be able to resign your bundle (using the codesign
tool) after modifying it. We did this once in a while on a previous project.
Solution 3
Well, You can change the file extension. File.ipa can be changed to File.zip, and then opened, and the contents can be changed. I have had problems installing an edited ipa file on my iDevice though.
Related videos on Youtube
A for Alpha
iOS application developer and a huge steve Jobs fan. The beauty of the apple products motivated me to be a iOS apps developer and i am in love with it... :)
Updated on June 05, 2022Comments
-
A for Alpha almost 2 years
Is there any way to Edit (add or delete) the contents of a ipa file.
My app contains some resource folders which varies from client to client even though the functionality remains same. We had a idea of creating a single .ipa file and put that in the sever, write some code to unzip it and edit the contents of the file. But, this dint work for us. So, is there anyway in which i can do this officially(without jail breaking it)
-
A for Alpha almost 13 years:Thanks david. "different build targets for different customers" ---- Can you please explain me a bit more on this line please...
-
Pripyat almost 13 yearsOf course I can. Your application project has a target (itself) which creates the actual application. I can give you instructions, but these vary depending on your Xcode version? Do you use 3.2.7 or 4.x?
-
Pripyat almost 13 yearsExcellent - me too! Okay, in the sidebar, scroll down until you see "Targets" with a dartboard icon. Expand that cell and right click your application name in the "Targets" section. Now click on "Duplicate". Then rename the duplicate to a new of your choice, such as "Customer 1" or whatever. Now expand that cell and then expand "Copy Bundle Resources". Now you'll see all the resources that will be copied. You can now just select any file you want in that list and hit backspace to remove it. Then you can create *ipas and the signature will check out. :)
-
A for Alpha almost 13 yearsthis is excellent.... +1 for this.infact, i'v found this out just before a few minutes. But, is there any other way in which i dont use the x-code to modify the contents...??? I want to do it from the server end with out X-code in the picture...
-
Pripyat almost 13 yearsThere isn't another way. As I have said - your application is codesigned. You can remove things yourself, but iOS will never run it because the code signature is invalid.
-
Pripyat almost 13 yearsPlease mark my answer as the accepted one by clicking on the green checkmark if you're happy with it!
-
Steven Kramer almost 13 yearsBuild as normal, check the build log. The final line will be a codesign. Disclose the detailed info, it will show you the exact command to use for signing your bundle. Alternatively, try setting up resource rules in your app. That should allow you to ignore certain resources during the signing/verification.
-
A for Alpha almost 13 yearsBut in my case, i'm not getting any code signing details here... i,m getting some warnings which are present in my code...
-
Steven Kramer almost 13 yearsSelect that line. A button will appear on the right. Click to show details. The final line in the details will start with
/usr/bin/codesign
. That is the command you can use to resign a modified bundle. Don't forget to check out my suggestion to use resource rules instead!!! -
Steven Kramer over 12 yearsNo, don't, because my answer shows you that you actually can resign your bundle programmatically (i.e., without setting up duplicate targets in Xcode or other trickery). Have you tried?
-
phi over 11 years@StevenKramer does that mean that I could make an app without code-signing it, and then send it over to clients that could change the icon or the splash screen, sign it with their own distribution certificates, and publish it to the App Store themselves?
-
Steven Kramer over 11 yearsYou would codesign it and they would re-codesign it after making their changes.
-
Craig Scott over 8 yearsThis doesn't really add anything new that the original question already implied. The question is more about how to modify the contents and still have the result working on the end device, which the other answers address but yours doesn't. If you can add new information not already provided by the other answers, then by all means edit/update your answer.