Archiving the project from terminal - iphone

I have seen posts regarding building a project from terminal.But I would like to archive the project and create a .ipa file in the specified folder of my wish.
For that, I presume I need developer certificate, provisioning profile, sdk, architecture, projectName etc.
I could specify below things,
Project Name: I go to project folder or I will give the path
SDK: ios4.0, likewise.
architecture: arm6,7 etc.
But how should I specify certificates? Should I give paths with names or Ids.
And are there anything more have to be done for that? I mean plain layout of what has to be done, would be very helpful.
Thanks in advance.

Think this is what you're looking for: Xcode “Build and Archive” from command line]1

Related

Convert regular xcode application project to iOSOpenDev

I'm new to jailbroken dev. I have a regular xcode application project. Now I need to convert it, or create a new application project using iOSOpenDev for jailbroken dev. I found the same question:
xcode project conversion to iOSOpenDev
But I have no idea what to do with the first step. Do I need to add some settings or change some values of existed settings? Pleas give some more details.
thanks!
About the first step, I did some tryings and it worked out. The following steps is just the same as kokoabim said:
1.change the install path to /Applications; add iOSOpenDev's include,lib,framework folder path to Framework Search Paths,delete iphonesimulator from Supported Platforms in Build Settings, Header Search Paths, Library Search Paths(I'm not sure if it's necessary);
Add a run script build phase (must be last in order) to existing target that executes /opt/iOSOpenDev/bin/iosod --xcbp.
3.Create the Debian package control file under the existing target's folder as (target's directory)/Package/DEBIAN/control.
4.Perform a Build For Profiling (Cmd-Shift-I).

How to run phone gap with xcode4?

Since moving to XCode4, I have been getting errors like:
/VERSION: No such file or directory
cp: /javascripts/phonegap..js: No such file or directory
cp: /javascripts/phonegap..min.js: No such file or directory
error: /VERSION: No such file or directory
for projects that were working under XCode3.
Open XCodes Preferences, and navigate to Source Trees. If there is no PhoneGapLib entry there, try adding a new setting with the following values:
Setting Name: PHONEGAPLIB
Display Name: Phone Gap Lib
Path: /Users//Documents/PhoneGapLib
Note that the path should be to the location of your PhoneGapLib folder, and that it may not be in your documents folder, depending on how you installed PhoneGap.
I just learned about a great web service recently made available by Nitobi (makes of PG), which will automatically generate the necessary PhoneGap files you need for use in Xcode 4.
Just enter your project name, hit a button and they'll generate a zip file for you to download. This lets you set up a new project without messing with the command line.
You could set up a new project, then migrate your older project files over.
Did you search Google for this error?
I'm a bit of a noob with PhoneGap and Xcode still, but I know there have been recent issues with PG and Xcode 4. Perhaps you're experiencing the same issues as the commenters to this post: PhoneGap + XCode4 (and more specifically, here).

Problem installing ad-hoc app on iphone: "resources have been modified."

I can install an app on my development iPhone compiled with "Debug" configuration using my Ad Hoc provisioning and everything works OK.
But when I build it using "Release" configuration, iTunes says:
The application XXX was not installed on the iPhone "YYYY" because its resources have been modified.
I've never seen this message before. Does anybody know what it means?
Thanks!
Antonio
We had the same problem during our first Beta. Someone on Windows dug in the xxx.app folder then Explorer created a Thumbs.db file inside and, boom, he got the message "The application XXX was not installed on the iPhone "YYYY" because its resources have been modified." when he tried to install.
He had to remove the app from iTunes, deleted all the Thumbs.db from xxx.app and then it worked.
We finally got rid of the problem. We were trying to include an image for iTunes after creating the build, but when we used this method (http://iosdevelopertips.com/xcode/itunes-icon-for-ad-hoc-distributions.html) everything went smoothly.
Just in case it helps someone: In my case, I copied the .app to a network drive, then to my Win7 computer before dragging into iTunes - then it did not work. When I zipped the .app first before copying, and then unzipped it on the other end - it worked. Of course, I have no real idea why....
Your debug configuration and your release configuration have some important differences, and release is a lot closer to what ad-hoc should look like. So you first need to duplicate the release configuration and make and call your copy "Ad-Hoc", and make sure you use your ad-hoc provisioning profile with it. Then you need to create a new entitlements file. The new version of Xcode has a cool feature where you can build and archive your app into an ipa file that includes your provisioning profile.
How to do all of this is explained here: http://www.tuaw.com/2010/05/23/devsugar-a-better-way-to-share-ad-hoc-builds/
In those instructions, when it tells you to make the entitlements plist file, it says to uncheck get-task-allow in the plist file. When I created the entitlements file, there wasn't a get-task-allow row at all, so I created one, set the type to boolean, and left it unchecked. It worked great for me.
The best solution to avoid wierdness like this is to create an IPA file. A good step-by-step guide to creating an IPA target in XCode is here:
http://idotcomllc.wordpress.com/2009/05/26/how-to-build-a-ipa-file-from-xcode/
It starts out with an introductory project so search for "Aggregate" to find the point where it starts telling you how to create a new IPA target for build.
I directly upload the app to a server where the windows can also visit. Then compress it in Windows.
I had it, did a clean build and never saw it again.
Incomplete ipa/zip archives (received at the installation end) were the cause for us.
I had this problem using a run script to cp -R the .app file to the Payload folder, for some reason when the script copied the file it modified it somehow, if I used finder and manually copied the .app file into the payload folder and manually zipped the .ipa file it worked fine. I tested it several times using codesign -v to verify the .app file. it always through the error after a build and the run script. but no error when I would copy the file manually.
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double file on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
I was tasked to test some apps and for some reason was the only one on my team getting this this error. I am working on an XP. All the apps we are testing use the same provisioning file yet some would sync while others would not. Not sure what fixed it but I did go into my *My Music\iTunes\iTunes Media\Mobile Applications* folder, deleted the existing .ipa file for the app I was trying to sync and it seemed to sync fine after. It might not be the answer to your problem but give it a try.
If you work with asstes on a Mac, or have versioned content, I had the same problem with .DS_Store files and hidden .git folders. Once deleted from assets, problem gone. It might be an issue with hidden files.

Can you create per-user project settings in Xcode?

I'm collaborating on an iPhone application, with the project files (.xcodeproj directory) checked into source control. One important setting is the "Code Signing Identity", which specifies the certificates to use to sign the application in order that it can run on the iPhone.
Each developer on the project has his own Code Signing Identity, so whenever anyone makes a change to the project, his Code Signing Identity gets saved into the project settings, and then everyone else inherits that change. They then have to change that to their CSI before they can continue.
Is there a way to have the Code Signing Identity saved in some local per-user project file that doesn't get checked into source control?
You could base the Xcode project on an .xcconfig file, then make each developer use their own .xcconfig file and keep the identity setting in there.
Either that or have your source control system ignore the file that contains the signature, in git you can create a file called .gitignore, theres probably a similar thing for what you are using. It means even though you've changed it the change won't get mirrored.
I worked around this by making different builds. The one named "Dev - Rob" had my settings in it, and the one named "Dev - [Other Guy's Name]" had Other Guy's settings.
We also used this to make builds like "Release - Beta" and "Release - AppStore" etc., for all situations where we'd have different signing configurations.

Adding a static library to an iPhone project

The motivation for this question is me trying to get LDAP functions to work with an iPhone application which is a project I'm attempting for part of my dissertation.
When I was developing the application I used the ldap.framework framework that is part of Mac OS X. This works fine in the simulator, but when I try to now get the app on a device it tells me that I'm not allowed to use this framework.
After some research I found that I could build openldap using the arm architecture and add the static library to my application destined for my device.
I eventually managed to compile configure and build openldap by setting variables as mentioned here and using the following commands...
Ade$ ./configure CC=$DEVROOT/usr/bin/arm-apple-darwin9-gcc-4.0.1 \
LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin --with-yielding_select=yes
Ade$ make depend
Ade$ make
I was told that the file I'm looking for will have an extension of '.a' so I searched for a '.a' file that mentions ldap...
Ade$ sudo find / -name *ldap*.a
Password:
/Users/Ade/Desktop/openldap-2.4.16/libraries/libldap/.libs/libldap.a
/Users/Ade/Desktop/openldap-2.4.16/libraries/libldap_r/.libs/libldap_r.a
So I assume these are the files I need?
My question is what do I do next? I know I need to add the library to the Xcode project and probably add a load of '.h' files too?
If anyone can give me a pointer to documentation or shed any light on the next stage I would be really grateful.
Many thanks,
Ade
ps. I have also talked about this process on my blog at www.greenpasta.com.
I've done this same thing to build an LDAP client for the iPhoneOS 2.2. You just to drag the .a into the "link with libraries" build stage. I recommend using the regular (non _r) version of the library, unless you specifically need reentrancy on your ldap stuff (which I don't recommend). You can also add the .h's to your project, which is generally the easiest way to access them.
Simply drag the .a files into the Xcode project and choose "copy files into project". I'm not familiar with OpenLDAP but I think the _r version is just a threadsafe version. I would recommend using that and not copying the other. You should probably not copy both files into Xcode or you will get link errors.
Then do the same for the .h files that define the client APIs of OpenLDAP - again I'm not sure which these are but I'm sure you can find out easily.
I would advise organising the .a and .h files together in a Xcode group under resources.
Include the header files in your source and you should be good to go.
You may also need to add -lldap to your linker command (in the build settings pane).