What do I need to do to configure a new iPhone project so it can be seen as the same as my current iPhone app in the Appstore? - iphone

I currently have an app in the Appstore. I need to make changes to the app, but they are significant enough that we've decided it would be easier to create a new Xcode project from scratch rather than modify our existing project. I don't fully understand everything that goes into an iPhone application, just enough to support the code and make basic changes. But I assume that the binary I upload to the Appstore, to replace my existing code there, needs to be similar enough so Apples sees it as the "same" code. What things in the new project do I need to make sure are the same as the old project so Apple knows it's the "same" app?
I've compared the Info.plist file in both projects to make sure they're the same. I only needed to change the bundle identifier in the new project to match the old. Also, the Product Name has been modified to be the same. I don't know if these changes are necessary, but they are the sort of things that I think need to be the same. Are there others? If so, what are they?

The only thing that matters, as far as the app store is concerned, is the app id (Bundle identifier). You can rename the app, change the icon, upload an entirely different program, whatever. As long as the app id matches, the store considers it the same.

Other things I would check are the Build Settings if the defaults are not suitable or the Code is having issues compiling and the Build Phases and Build Rules for all your Targets.
Essentially if your Code compiles fine and you have no issues within the Application then the Bundle Identifier and the name (Basically the Info.plist) needs to be the same to replicate.
Edit: If you have migrated from an older Xcode version then you may have different Build Settings and Build Phases. I would just see if compilation is okay and the App works properly in functionality under all your Targets

Related

Why do I get "could not be added to your itunes library because it is not a valid app" error when trying to install Ad-Hoc build?

I've recently upgraded my Mac to Lion, and also Xcode 4.
In Build Settings, I've set "Code Signing" for "Release" to be "iPhone Distribution" which matches our Ad-Hoc provisioning file (which we've used in the past, on Snow Leopard/Xcode 3).
I have deleted the old Entitlements file (as it's apparently no longer used by Xcode 4).
In the Scheme section, I've set Archive to use the Release build.
I'm building with Product > Archive.
I'm saving the file by going into the Organiser and clicking Share, then making sure the same Ad-Hoc provisioning is selected.
I'm sending the resulting IPA file to my boss, who has previously installed this app. When he tries to install it, he gets the message "[appname] could not be added to your itunes library because it is not a valid app".
I've been trying every combination of settings I can think, but we just cannot get this to work. I can find this error only twice in Google - once from someone with a jailbroken phone and another posted in comments of an article, someone having the same issue, but there are no responses.
Any help would be really appreciated.
Edit: Same thing happens trying to drag the IPA into iTunes on the Mac that created it! :(
Edit2: Just taken another (almost identical) project and tried a build without "Modernizing" the project, or selected any of the new options in Xcode (icons, launch images, orientation etc.), and this build works. I'm going to work through each of the things I did with the original app with this one, testing at each step. Hopefully should be able to isolate which step is breaking the compiled app!
(also posted to Apple Dev Forums)
I believe I've tracked this down... It seemed to be happening really intermittently, so it's taken some time (I'd reproduce it, roll back the change, confirm it worked, then re-apply the change, for it to then work again!).
However, after much cleaning/restart/etc., I believe it's related to the "Build" version in the target settings (there are now two version fields, "Version" and "Build"). It seems that if "Build" is blank, then this error occurs.
Unfortunately, changing this value doesn't seem to rebuild properly, so sometimes if you change it, then Archive, you still get the previous value. Manually cleaning before Archiving seems to work around this.
The value gets written into the plist file as CFBundleVersion.
Recently I suffered a problem with an Ad-Hoc installation using TestFlight service, the message in the log didn't help too much:
Jul 25 12:52:39 MyiPad installd[477] <Error>: 0x10059c000 init_pack_state: Archive we've been requested to install is 0 bytes. That can't be a valid ipa.
After many tests, I found this question and the problem was the same, the Build field was empty (this answer save my day :-) )
So, if anyone else has this problem on TestFlight, I hope my answer allows to find this page easier ;-)
I also faced the same issue. After doing some research found below answers as:
App Version and Build version should not blank.
Don't put special characters in my app bundle name.
And also there was no issues with my provisioning profiles.
After debugging found that there was name mismatch in my scheme name and info.plist file name. In my project, I have 3 schemes like a,b,c and only one a-info.plist file. I was creating IPA for different scheme like 'b'.
In your scenario, if you have created multiple schemes then check your Info.plist name. That should have to be same as your scheme name (for which you are creating an IPA).
Example. The scheme name is 'myScheme' then your Info.plist file name as 'myScheme-Info.plist'.
Hope this will help you.
I got the same message ("not a valid app"). In my case, I was FTPing the built app to a web server then I would be able to OTA provision it. I was not swapping to binary mode before I was putting the file, so the .ipa file got corrupted on the way. Took me most of the evening to figure that stupid mistake out...
ok.. do one thing.. Open info.plist.. Go to bundle identifier and change bundle identifier name. It needs to be unique.. something like "com.yourcompany.projectname" and create and try to install the ipa.. It should work
I came across this question while researching a similar problem so I'll answer here even though the cases are not identical, because others will search for the same error message.
I had an ad-hoc app that everyone in the development team could install fine, except one person, who got the error from iTunes:
X is not a valid app
He had been able to install earlier versions of this app. Rebuilding the app, changing the version number and changing the build number had no effect, he still could not install but others could.
I fixed it by creating a brand new Xcode project, either copying the files or copying and pasting the content of the files from the old project to the new one, and rebuilding the app and signing it in exactly the same way as the old project. It worked.
I had a similar issue while trying to create an .ipa for adHoc distribution for one of the Old project (built a year ago by ex-developer). After a lot of research in google and following the above solutions it didn't worked out for me somereason.
Later after following this link - here. By replacing the .plist file with the existing working projects (obviously - the relevant icons/bundle display name/identifier) and renaming with the current .plist name. It worked for me.
I literally spent about 3-4 hours to fix this issue. Hope it helps some one.
environment was native - iOS app.
add......
"Application requires iPhone environment" in your info.plist or if added give it value "YES".
Check "Build" and "Version" in general are not empty....
hope this will work
Importing the project contents in to a new Project solved the issue for me.
For me, we were trying to do an enterprise build of a very old app, from iOS 5.
After confirming profiles and everything else was fine, debug builds work correctly, I noticed the general consensus was around issues with the info.plist file.
I compared the info.plist with another app and sure enough,
Application requires iPhone environment = NO
Basically this key needs to always be set to YES for iOS apps regardless whether its for iPhone, iTouch or iPad...
It may not be limited to that key for everyone but make sure the info.plist looks similar to working apps.
Bundle version
Bundle versions string, short
should always be present!
right.. but I guess it is clashing with earlier bundle identifier( this happens because you have upgraded the Xcode). Did you try and change the existing bundle identifier name and install ? I had identical problem and wasted 3-4 days.. I changed existing bundle identifier name and it worked.. Also you may want to check Bundle name and Bundle version are present in info.plist

Can I keep one project in XCode but build it for Mac OS X, Apple Mac Store and iOS device(s)?

I noticed that there are different requirements for each platform here. I was wondering if it's possible to build a single project but with multiple targets where each target is Mac OS X (something like a CD / install build), Apple Mac Store, and iOS device.
IfIi'm going about this the wrong way then I'd love to know! I mostly develop on the PC but with the state of the App Store I'd love to spread out as much as I can!
Keeping separate targets for the Mac app store and an independently-distributed Mac application is simple. You just need to ensure that your receipt validation code is conditionally included on the app store target and not in the other target; and your custom licensing scheme is included the other way round. Things get a bit more complicated if you target different operating systems in the two targets, but they're not insurmountable: you can test for the existence of classes or selectors at runtime to ensure you never call newer API on older systems.
By the way, it's also worth having separate Info.plist files for these targets. Partly because you don't need or want to include things like Sparkle properties in your app store target, but also because each target should have a unique bundle identifier. The app store does odd things when you have an app installed that it thinks came from the store but really didn't, and you don't want to risk your updater or Apple's trying to update the app deployed via the other mechanism. But that's not really about organising your Xcode project, it's a deployment issue.
For the most part, yes. All Mac/iOS apps can be written in Objective-C and the code is very similar. However, you must bear in mind that iOS devices have different screen sizes from the Mac and even from each other. That means that the input metaphor is different, and that the UI is different. While it is possible to do what you want, it's not advisable to just code once and compile thrice.
That said, I don't use Xcode 4 so I can't tell you about that. Of you are looking to do different builds for different devices, you will want to write your app logic and your input logic as separately as possible. Then, you create multiple targets, one for each build. You define compiler flags for each target. In your code you will use those flags to use the appropriate code for your build.
At least as of 3.2.5, this is absolutely not a problem. You won't necessarily be able to apply all of your build settings project-wide, but you can specify them on a per-target basis.
Just add the appropriate-type target (Cocoa Touch, Cocoa, etc.).

What's the best way using XCode to install multiple builds of the same iOS app to your iPhone?

I frequently find that I need to have a build on my iPhone which is my 'demo-ready' version which might point to my demo server. I also want a build that is the latest and greatest debug build that I'm developing with that points to my development server. Has anyone found a really simple way for me to install two apps that perhaps are the exact same code but point to different servers? Alternately perhaps I would have an app that was a few versions behind the latest version? Preferably I would use the same XCode project to build and install onto the iPhone.
You can add special build configurations for them that each use a different info.plist file. So, maybe for your demo, you have an info.plist named MyApp-Info-DEMO.plist and MyApp-Info.plist for the release.
Then you could add your server variable as an info.plist variable and look it up when the app starts. Or even just create a DEFINE statement in your new configuration that's something like SERVER=demo.myserver.com for the demo and SERVER=production.myserver.com for the live.
The most important part is to change the CFBundleIdentifier in the new info.plist. So in your demo, you could name it something like com.mycompany.myapp.DEMO and the real one might just be com.mycompany.myapp.
This will allow both versions to appear on the phone at the same time (the different CFBundleIdentifiers). Just remember, if you are using in-app purchases or server push notifications, you won't be able to do this without a separate, specific profile for both your real app identifier and your demo one.
You could create 2 different targets with 2 different info.plists and 2 different preprocessor defines (in the Build Settings for each of the 2 targets). Then ifdef on the preprocessor defines to select the server constant the compiler uses for each target.
Then make the product name and the bundle ID different in the two different target settings (so that neither the device or the Simulator will confuse the two app bundles).
With the current version of Xcode, you'd achieve this by changing the app's Info.plist file to use a different bundle identifier (and possibly also change the Product Name of the app in the build settings).
The upcoming version of Xcode, from what I've read in the prerelease documentation, has a feature that may simplify what you want to do quite a bit. However, since prerelease software is covered under NDA, I can't give you any details.

Unable to have two versions of the same app on the one iphone

I have two versions of my app. I'm trying to keep a copy of each on my iPhone for testing purposes.
In my build settings, my bundle display name is ${PRODUCT_NAME} and I've given each version of my app a different product name (eg "v92" and "v10"). When I install each version to my iPhone, they both appear side by side with different names, however one will work normally, and the other will immediately close the moment it's opened. If I delete the version that works normally, the other will start working.
Does anyone know what's going on?
I think the apps are distinguished on the device by the App Id and not the product name. I dont know how you were able to install two apps only by changing the product name. When i mistakenly installed a different app with same app id but different product name the original app was overwritten.
Try creating a separate app id for the new version only for testing. That might solve your problem but make sure you use the correct app id when you submit your app.
EDIT: It might not be the right solution if you are doing some app id specific stuff (like APNS) in you app.
I ran into this one too and eventually solved it. I know the solution had to do with changing something in the information property list, but I'm not sure exactly what. I would suggest making sure that all of the following are different for your two versions:
bundle display name
executable file
bundle identifier
bundle name
At least you can create two app id's and two provisioning profiles in your developers account. Then you'll be able to install your 2 versions like a two different apps. It's an ugly solution, but it definitely works.

creating a free version of an app, but having the app separate on debug device

I was just making a free version of one of my apps. I copied the folder, renamed the project, and changed the icon file, loading screen, interface, and code. BUT YET it still replaces a build on my phone.
1)how do I stop this from happening (i want both the free and paid version on my phone)
2) if you can fix this, will a customer who has the paid, and downloads the free, will that replace it on their phone?
I really need to know these, as I have the app ready to go, and would like to get it before the end of the week.
cheers
Sam
You need to have a different app bundle identifier. I think that's your problem.
Long answer:
Go into your projectname-info.plist file and change the CFBundleIdentifier.
I'd recommend something like:
com.mycompany.mycoolapp for the app store
com.mycompany.mycoolapp-beta for the beta version
You should actually be able to set up the "Debug" build configuration to use a different info.plist file configured with a different CFBundleIdentifier and a different icon filename. That way you'll automaticlly get the beta ID and icon, etc for the Debug build and the real id/icon for the full one.
This should allow users to install and use both the production and test versions of the apps at the same time without confusion.
You might also find this IPA target template helpful if you're doing ad-hoc distribution to Windows users for testing:
http://devblog.appmagination.com/2010/01/target-template-for-building-iphone-ipa.html