Is there a way to view your app's .entitlements file from your app's .ipa archive? - iphone

I think there's an issue with my app's .entitlements file when a .ipa is created and so I want to check the Bundle ID of the entitlements file. There's a fairly complicated build script I am using to change some stuff in there before building so I want to see what the final product is. I know that there used to be an Entitlements.plist that I could get off of the ipa but it doesn't seem to be there any longer. Is there any way to access the .entitlements file now?

For those getting here via Google, the Information Apple provides at https://developer.apple.com/library/ios/qa/qa1798/_index.html is a lot more recent.
Specifially, after unzipping the IPA:
Display the entitlements in the app by running:
codesign -d --entitlements :- "Payload/YourApp.app"
and display the provisioning profile by running:
security -D -i "Payload/YourApp.app/embedded.mobileprovision"

Sure, unzip the .ipa file which will create a Payload directory. Inside of the Payload directory is the application package. Right-click the app package in Finder to "Show Package Contents".
Look for the embedded.mobileprovision file which you can open with a text editor or plist editor. Look for the <key>Entitlements</key>

Related

todo.txt app missing the DropboxApiKey.h file

I downloaded todo.txt-touch-ios-master zip file from github.But when i open this applicaiton in xcode 4.4.DropboxApiKey.h file is not found.I got the erors like \
'<'command line'>':1:10: fatal error: 'DropboxApiKey.h' file not found
In file included from '<'built-in'>'
project folder path'<'command line'>':1: 'DropboxApiKey.h' file not found in project folder path /'<'command line'>'
How can i get that file.I added manually That file.But it's not working.Again same errors came.
I found a project on GitHub called todo.txt-touch-ios, so I assume that's what you're looking at. If so, I see a file there called sample-DropboxApiKey.h. My guess would be that you should copy or rename that file to DropboxApiKey.h and plug in your own app key and secret.
You can obtain your own app key and secret by creating an app at the Dropbox app console: https://www.dropbox.com/developers/apps. Create a "core API" app, as it appears that's what this code uses. I can't quickly tell from reading the code whether the app needs to have "app folder" or "full Dropbox" permission, so you might try one and then the other.
See also https://github.com/ginatrapani/todo.txt-touch-ios/issues/163, which seems to confirm my guess.

Upload iOS build online

I am uploading ios build on testflight till now. But I am getting the following error on uploading any build (I also tried uploading the previous build again which I already uploaded on it).
Invalid IPA: Couldn't find executable specified in Info.plist - check the value of your CFBundleExecutable key.
I need to upload the build. Can someone suggest me a site other than testflight where I may upload the ios build or ipa file?
The other site you can use is http://diawi.com, i use it on my project now, very helpfull.
We had a problem with CFBundleExecutable ${EXECUTABLE_NAME}. Our iOS app was for example called OurAppName.
Ran fine in Simulator but when archived and deployed via organizer said CFBundleExecutable was not an executable file.
We checked the plist and the value for CFBundleExecutable was 'ourappname'. we unzipped the ipa > app folder (see how below) and there was a fie called ourappname but it was smaller than expected and not a exe (USE:ls -l should have x at end of -rwxr-xr-x ).
Bug was caused by a text file called 'ourappname' and when archive was built it took that as the exe and not OurAppName. Answer was to rename and or delete the file with same name as our exe. Do full clean build. and recheck final ipa.
To see contents of OurAppName.ipa :
Rename to OurAppName_ipa.zip (ignore warnings):
DOUBLE CLICK on OurAppName_ipa.zip to open (creates Payload folder containing OurAppName.app):
rename OurAppName.app to OurAppName_app (ignore warnings will change app bundle to folder).
Open OurAppName_app folder look for ...info.plist for app.
Check CFBundleExecutable is pointing to OurAppName.
Find OurAppName in folder do ls -l make sure it executable (USE:ls -l should have x at end of -rwxr-xr-x).
TIP FOR TEST FLIGHT:
If testflight download fails after 80% with UNABLE TO DOWNLOAD then drag the archive you built to a iOS device using Organizer.
Click on Device > applications and + at the bottom (i think dragging the ipa to the device in the organizer installs it as well).
in your info.plist file open as source code form and check CFBundleExecutable key is there or not and make sure it is written as
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>

How can I edit Root.Plist inside a generated .ipa archive?

The case is as follow , I have developed an iphone application and want to brand it without giving the source code for the client (whom by themselves refuses to give me the credentials for their developer accounts) , so I was thinking , is their any way to give them the .ipa file and enable them to change a couple of images and the Setting.bundle , re-codesign it and submit it on thier own ??
It was solved as follow,
Rename the ".ipa" file to a .zip and extract it
Go to Payload/{your app}.app , right click on it and show package content if you are running MacOSX , windows will see it as folder
change what you want from images and Settings.bundle ...etc.
Resign the code through the shell as indicated in the attached .sh file
#!/bin/sh
#Given that the application name is MyApplication.ipa
export ARCHIVE_NAME="MyApplication"
#As indicated in the keychain certifcate common name
export CERTFICATE_NAME="MyCertificate"
rm -rf ./Payload
echo "$ARCHIVE_NAME"".ipa" "$ARCHIVE_NAME"".backup"
unzip "$ARCHIVE_NAME"".ipa"
codesign -f -s "$CERTFICATE_NAME" ./Payload/"The package name in the Payload folder with the extension"
zip -r ./"$ARCHIVE_NAME"".zip" ./Payload
cp "$ARCHIVE_NAME"".ipa" "$ARCHIVE_NAME"".backup"
mv "$ARCHIVE_NAME"".zip" "$ARCHIVE_NAME"".ipa"
rm -rf ./Payload
echo "Finished Code Sign successfully"
The tricky part was , how to upload the archive once again to the store ?
A tool offered by apple through the itunes-connect account should be used to upload that archive independent from Xcode.
it could be found as follow itunes-connect -> login -> manage your application , the second left bottom tab is for the application loader "Hidden in a smart way , Apple is Apple :)"

How to download app data in Xcode 4.2

In the latest version of Xcode I could simply go to Organizer->MyDevice->Applications and then select the app I wanted to look at and download the appdata in form of a folder with all the app content. Now I only get a .xcappdata file.
How can I access this file for take a look in a .sqlite file?
Under the Data files in Sandbox pane in the Organizer, you'll find all the individual files that the selected app stores on the device and uses, displayed in a hierarchical view.
For my app, it looks like this:
To view the files in Finder, download the .xcappdata file, go to where you save it in Finder, Control-click on it and choose Show Package Contents. The directory structure is identical to what you see in the Organizer, and you can open and/or copy out the files as usual.
I'm constantly checking my app's database, so to speed things up I always download the .xcappdata to the same folder. I then run the following script that's sitting in that folder to look at the latest version of the database in 'sqliteman' (a sqlite program available through MacPorts):
#!/bin/bash
shopt - nullglob
for PACKAGE in *.xcappdata; do
CURRENT=$PACKAGE
done
sqliteman "$CURRENT/AppData/Documents/yourapphere.sqlite"

Create .ipa for iPhone

I developed one application for iPhone. After I build I got .app file in build folder.
My application name is Myapp, then i got Myapp.app file in the build folder.
My problem is i want to create the .ipa file. how is that.. it is for to install
jailbraked iPhone..
Create a folder named Payload.
Copy Myapp.app (from products of your project) into the Payload directory.
Right click and Compress the Payload directory.
Rename the zip file to Myapp.ipa.
** Update ** This answer is very old. Use Xcode to build .ipa archives now. (Product > Archive)
Run Script
/bin/sh
mkdir $CONFIGURATION_BUILD_DIR/Payload
cp -R $CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app $CONFIGURATION_BUILD_DIR/Payload
cp $CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/iTunesArtwork $CONFIGURATION_BUILD_DIR
cd $CONFIGURATION_BUILD_DIR
/usr/bin/zip -r $PRODUCT_NAME.ipa Payload iTunesArtwork
rm -rf Payload iTunesArtwork
exit 0
With Xcode 4, there is now a way more easy way:
In the menu bar, go to Product > Archive.
The organizer will then open in the Archives tab, and you will be able to save an IPA using the Share… button.
If the Archive menu item is disabled, make sure you have the scheme set to iOS device and not the iPhone Simulator. You don't have to have a device plugged in, though.
I also wrote a script to do this from the command line: xcodearchive. It works similar to xcodebuild, but generates an IPA.
Signing Part:
This part is required for non-jailbroken phone and rest of the steps are same
Open Terminal and enter the following commands
codesign -f -s "Code signing certificate name" appNamewithextension
example
codesign -f -s "iPhone Developer: Durai Amuthan" sample.app
Verify it is signed using the following command
codesign -verify AbsolutePath_with_app_name
ipa creation Part:
Way 1:
1.Create a folder named Payload and copy the .app into it
2.compress it and you'll get Payload.zip
3.Now Change the extension from zip to ipa that's it
mkdir Payload
cp -R MyAppName.app Payload/
zip -r -s 64 Payload.zip Payload/
mv Payload.zip MyAppName.ipa
Way 2:
Drag and drop the .app in iTunes that'll create the iPa for you
Installation part:
If you had Tried the Way 1 in previous step then Drag and drop the .ipa in iTunes
Choose the device in iTunes and click install and apply the sync that's it
Follow the following steps
Upload your app file as a zip on www.diawi.com
Open the diawi url in your web browser.
You will find download application option there. Download the file and it will be downloaded as an IPA.
Also, if you want to include the logo file, add the icon to the directory and name it "iTunesArtwork". compress that along with the Payload directory that has the .app file in it.