iPhone Dev, 3G Testing Device Launch Failures After App Rename and Upgrade to XCode 4 - iphone

I have an iPhone app in the app store that I wanted to rename and make universal. I have done all the work for the rename (renamed the PRODUCT_NAME, not the binary identifier) and adding iPad support. Everything was running great on my iPad 2 (4.3.3) and my iPhone 4G (4.3.3). Before I packaged it up, I ran a test on my iPhone 3G (3.0).
I cannot get my app to launch properly on the 3G. When the app launches, the launch screen is displayed as it should be. The screen then goes to black with the status bar on the very top, like it has loaded a black nib or something. There are no error codes whatsoever -- nothing in the console, nothing in a pop up. The application does not even reach the "applicationDidFinishLaunchingWithOptions" method of my appDelegate. The application doesn't crash, either. It just sits there like it's waiting on input from a user, but like I said the application hasn't even finished launching.
The only things that have changed since the last time I tested on the old 3G (which was the last time I updated my app) are the application rename and the upgrade to XCode 4 w/base SDK 4.3.
In my XCode Scheme drop down, it does say: iPhone (3.0, Overriding Base SDK to 4.3). I don't know if that is inadvertently causing this hangup? I am running Xcode 4 with base SDK 4.3. The target deployment is 3.0.
Has anyone encountered anything like this? I would appreciate all insight and advice to the situation. So far I have deleted the application from my device, clean/build Xcode, delete Xcode build folder, delete and reinstall all provisioning profiles, reboot of device and XCode numerous times.
Thanks,
Brandie

As far as I have been able to determine the BEST solution (not the easiest) is to make a new project with the new project name and copy your files. Changing the PRODUCT_NAME gave me wierd results and I said "forget it, let's do it by the book".
If there is an easier solution, I have yet to find it and, frankly, given it takes me about 30 minutes (I've changed the name of an app 4 times - mostly because of name length), it causes me the least amount of grief.

Related

Finished Running on iPhone

I am trying to test my app on an iPhone 4S. When I build and run from Xcode, the project is successfully compiled but after that Xcode says:
Finished running MyApp.app on MyiPhone
The app perfectly work on the simulator and the provisioning profile works correctly (I tried to load an empty app and it works).
If I try to manually load the app I get this message:
The Info.plist for application at
/Users/*/Documents/App/AppName/DerivedData/AppName/Build/Products/Release-iphoneos/AppName.app
specifies a CFBundleExecutable of AppName, which does not exist.
Where is the problem?
The connection that XCode creates with the device is rather fragile, and can easily be corrupted if anything goes amiss in the debugging test, most commonly if the developer stops a build, while it is being moved to the device.
I have a routine of things I go through, when this occurs. If one doesn't work, I go further down the list.
Check your signing certificates
: This error can occur if you mess around with the certificates too much. Make sure your current scheme uses the Debug signing when making a debug build, and check in your application settings if the current debug signing certificate is a debug certificate. (Not AppStore, AdHoc or Enterprise).
Reestablish connection with the device
: Look under devices in your Organizer. Check if the device you are using is present and marked with a green bullet. If orange or grey, reconnect the device with the USB. For precaution, wait a couple of seconds from taking the cable out before you insert it. It should make no difference if you eject the cable from your mac, or the part connecting your iDevice.
Reactivate development on the iDevice
: Being unaware why this happends, some devices revert to a non-development stage from time to time. Clicking the "Enable development" under Organizer > Devices seems to clear this off.
Flushing XCode device connections
: Something that often is needed, you can simply shut down XCode (and to be safe, close the iPhone simulator as well) and start it up anew. Deleting the debug application present on the iDevice is also a good idea.
Restart your iDevice
: Tedious as it might seem, restarting your iDevice is sometimes needed, since the pipe held on the device might be corrupted.
Restarting your developer machine
: If everything else fails, a restart of your mac is often required. I have never experienced this error without having it fixed by now.
I hope this checklist will help you through.
Try cleaning the project.
SHIFT+CMD+K
Found the same bug in XCode 9 while running the project on iPhone 5s. Clean the project and it will work.
Clean.
Build.
Run.
It's work for me.
I had similar issue. When I run program on iPad2 it compiles and installs app on device, wait for some time, and display an alert. Then I followed steps below
1) Removed that application from device.
2) Disconnected iPad and tried again.
Then it successfully run in device. If this not resolved your issue, do
Rename your application to some thing else and try to run. It will run. Lastly you can make an "ipa" file with Ad Hod distribution and can test on device.
Looks like you are trying to run a release product on the device. You are probably signing it with production key. Run it as debug.
Maybe I'm totally off with this guess but the last time I got the same message was when I had some required hardware capabilities set in the Info.plist which the target device didn't comply with. (E.g. requiring a camera and trying to run the app on an iPad1.)
I've just finished chasing down a similar problem.
An app that worked on the device (iPad 1) and on the simulator stopped loading on the iPad but continued to function as before on the simulator. When "run" with the device as target, it compiles and then goes immediately to "Finished Running...".
I did all the usual bits - removed the app from the device, ran Product/Clean, removed derived data, shut computer and device down cold, but with no luck. Other development apps loaded and ran fine.
This app uses GameKit. When I removed the gameKit requirement from Info.plist, the app loaded and ran correctly on the device again - including the GameKit functionality (no kidding). When I added gameKit back in, it failed again. When I added the gameKit requirement to other apps, they failed to load to the device as well. It appears that something has happened to the gameKit setting on the device, although gameKit is there and functions as always. I'm suspicious that this one has to do with the state of the sandbox.
I've got to make a few changes to get the app running on the iPhone and I'll test that as well. I'll repost if I sort it out.
Si it seems that XCode build, ran and finished but the app failed to be deployed and was not even copied to the device.
In fact, there should be something in the XCode project that is broken. This is easily corrupted. The best move is to build a new project from scratch. Don't forget to add armv6 support if needed.
It works well for me!
Check the device log
It may occur, that you are using a provisioning profile, which does not allow one of the entitlements, listed for your target.
For example
entitlement 'entitlement-name' has value not permitted by provisioning profile 'Your Profile Name'
For me, the usual culprit is that I have an app store build already on my device.
Different/same version numbers might make things worse. I haven't looked into it too deeply since deleting the version that is already on my device usually fixes the issue.

Fail with AdHoc distribution for iPhone 2G

I have some issues with my application. So, first time I have deployed the application for AdHoc distribution everything went well on my device and on my tester device (iPhone 2G).
Now when he starts the new build on his device he is seeing the splash screen and after this the app crashes. The only thing changed on this new version is that I have added some new feature to the app, but nothing on the first screen. My iOS version is 4.3, xCode 4 and iOS SDK 4.3 and my tester has an iPhone 2G and iOS 3.1.3. The target for the app is set to 3.1.2.
I have included the following frameworks:
1) libz.1.2.3.dylib;
2) libxml2.dylib;
3) MobileCoreServices.framework;
4) CFNetwork.framework;
5) UIKit.framework;
6) CoreGraphics.framework;
7) QuartCore.framework;
8) SystemConfiguration.framework.
Could one of them be the cause? How can I find out what frameworks are available for, let's say, iOS 3.1.3? Currently all frameworks are set to "required".
Do you have any idea what could be the cause of this issue? I will post the code for the first screen if you find it relevant.
Thank you,
Andrei
You'll need to inspect the logs on your tester's device to find the cause of the crash. The console log may provide some help -- your tester can retrieve the console log by using the iPhone Configuration Utility that Apple provides. It can be downloaded from http://www.apple.com/support/iphone/enterprise/ for both OSX and Windows. If your tester downloads and runs this, it will give him a view pretty similar to the Organizer window in Xcode. Have him click his device on the left-hand side, and then the "Console" tab, and then save the log and send it to you.
The other thing that might (more likely) help is the crash log. If your tester connects to iTunes and does a sync, the crash log is copied to his computer. It can be found in
~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME> for MacOS
and either
C:\Documents and Settings\<USERNAME>\Application Data\Apple computer\Logs\CrashReporter/<DEVICE_NAME> or C:\Users\<USERNAME>\AppData\Roaming\Apple computer\Logs\CrashReporter/MobileDevice/<DEVICE_NAME> for Windows.
Hope that helps!
If your app is crashing on startup, you'll need to gather his crash logs and read those. There's a million ways an app could crash; we'd need a lot more information to help you diagnose the problem.

XIB actualization problem

I'm facing a weird problem dealing with Xcode. When I run my project using simulator I got the correct xib showing, but when I select my iPhone as target, it shows an older version of that xib... I'm going crazy with this, I have tried to clean targets, deleting and reinstalling the app on iphone, :^S
Please could anybody help me with this issue?
Thanks a lot and sorry for my english.
When Xcode installs development builds of iOS apps on the simulator and on the device, it copies all files from the .app bundle into the target directory for the app in the simulator or on the device. However, it does not remove old files. This can sometimes cause strange effects.
For example:
You have MyView~ipad.xib and MyView.xib for iPhone, you install the app and run it on the device, now you decide to delete the MyView~ipad.xib so that it will just use the MyView.xib same as iPhone, you test this in the simulator and it works fine but when you put it on the device again it still uses the old iPad xib file, but how when it's not even in the project any more? Well the old file still exists in the filesystem on the device until you actually delete the app off the device.
This can happen when you remove files from the project or rename them to something else, the old files will still be there and especially if you have fall-back beaviour or how iOS can look for other suffixes automatically like #2x or ~ipad - this can easily cause confusion. Check for this whenever you notice strange effects like old versions of files seem to resurrect themselves, or it works on one device but not the other.

iPhone dev question: "No provisioned iPhone OS is connected" error, I don't know what else to try for troubleshooting

I am trying to compile and install my first application onto my iPhone after setting up a profile and certificate. At this point I am getting the "No provisioned iPhone OS is connected" error when I Build & Go.
I am using iPhone OS 3.1.3, and Xcode 3.2.2 on 10.6.3.
• I have verified that my iPhone is connected to my development machine (it is seen on the computer by both iTunes and Xcode Organizer (in Organizer, it has the green dot next to it)).
• I have rebooted the iPhone and restarted Xcode multiple times.
• I have verified that the Bundle Identifier in my appname.plist is set to com.. (with the appropriate values between the angle brackets).
I have looked the error message up on the web, and so far have not found a hint that has gotten me over the hump....
Thanks for any and all assistance!
Regards,
Steve O'Sullivan
Open Organizer (in Xcode > Window >
Organizer) check whether there is a
green dot next to your iPhone.
Click on the iPhone item, check whether it's ready for development (if "Use for development" is there, that means not)
Sometimes, you may need to power off then on your iPhone
Did you add the UDID of the device to the relevant provisioning profile on the Apple iPhone developer portal, and downloaded and installed the new profile?
Maybe an answer now; see comment below. But if nothing else, an identical problem and question. I've tried all of the unique suggestions made on this and other forums, several times for some suggestions, as the original author has done, and I continue to get the same message. I've removed everything from the provisioning portal, from my iPhone (3.1.3), and from XCode (3.2), and rebuilt/reinstalled everything. As above, the green dot shows in the Organizer as does the relevant iPhone specific data, the provisioning file is there and on the iPhone, all the appropriate certificates appear to be in place. I've "clean"ed the build; I've turned the iPhone off and restarted XCode, in several different sequences; I shut down the development Mac and restarted everything. But, I continue to get the "No provisioned iPhone OS device is connected".
And, yes, this is my first try at loading a development application to the iPhone, so the original question's author and I seem to share similar relevant experience and behavior. I keep hoping to go back and find a missing step. And, while it did take several tries to get to this point, with everything looking like it's right, it appears I've still overlooked something important.
Beyond the "restart" suggestions, has anyone found any strong sensitivities to the order in which things are done, or anything that seems to have become more difficult with XCode 3.2 or iPhone 3.1.3? I notice that the many examples of this question first appeared 18 months ago, then it was silent for quite a while, and now there's been a slew of new queries of this kind.

Pre-release checklist before building final version for App Store

Curious what practices people have learned before making their final build and submitting to the App Store? Aside from switching from Debug to Release & commenting out calls to NSLog what other basic and/or not so basic things should we be watching out for?
This is a good question and I'd like to restate some of the answers and add a few of my own. I've made this answer Community Wiki, feel free to add to it.
Delete the app from your device, turn off WiFi, off cellular data, now install and test app. Does it work properly (as much as it can without Internet)? Does it at least tell the user that a network connection is required (if it is) or does it crash?
If you use CLLocationManager: Delete the app, fresh install and run, but do not allow app to have Location Data. Does the app behave well or does it crash? Does it at least tell the user that it can't run without location data (if that is a requirement)? Does it work on an iPod Touch that does all geo location using WiFi only?
Run the app in the simulator and for each view controller do the following steps: (a) From the iPhone Simulator menu select "Hardware" --> "Simulate Memory Warning", (b) now navigate around your app to other view controllers and see if everything is working, (c) repeat test for another view controller.
If you support older firmware (ie: iOS 3.1.3), install your app on a device running 3.1.3 and test it there (if you don't have one, use the 3.2 simulator).
Start your app while on a phone call or when Personal Hotspot is active. Are all the screen layouts correct (the status bar is 40px high instead of 20)? Did the bottom 20px of the view get pushed off the screen or did it resize correctly?
Accept a phone call while in your app, does it resign active and resume properly? Do sounds from your app stop playing while in the phone call?
Start your app while playing music, does the music continue to play? Do your sounds mix properly or fade the music appropriately?
Test performance on a slower devices with limited RAM such as: iPhone 3G (128MB RAM, 412Mhz CPU) or iPod Touch (1st or 2nd gen).
Run the Clang static analyzer and fix (or at least understand) every warning.
Make sure NSZombiesEnabled is NO in the environment variables (caution: not sure if this is still a problem)
A few things:
I actually recommend not creating a build configuration called "Distribution" as Apple specifies, because I often am creating ad hoc builds for beta testers. I create two build configurations, one called Ad Hoc and one called AppStore, so I'm not confused. The only difference between the two is the presence of the Entitlements.plist file for the Ad Hoc build. This way I can test as closely as possible what I will be submitting to Apple.
Most developers are optimists. That's why we are working weekends to create an app that we just know is going to make us a millionaire. Before submitting though, be a pessimist. Imagine everything that can possibly go wrong, and double check it.
Don't assume anything. Don't assume that that tiny little change you made to the app won't affect anything else. Murphy's Law says that that tiny change will cause your app to crash on all iPod Touches or something. Test, test, test thoroughly between the final code edit and Appstore submission. If you have to make a tiny change, then repeat until it's perfect.
Remember that if the app doesn't crash for 99.9% of your users, then 1 out of every 1,000 downloads will result in a 1-star scathing review.
I use Clang static analyzer, Leaks and Object Allocations during development, but I do an extra run of these tools before submission just in case.
If you don't have an older device, get one, because the 3GS performance is significantly better and you may miss some important performance issues.
Test your app with the following configurations when network or location are applicable:
iPod Touch
iPhone 3G
iPhone 3GS
iPhone in Airplane mode
iPhone with Wi-Fi
iPhone with EDGE
Call the phone while using your app
Instead of switching to Release, I switch to "Distribution". It's a copy of Release, but that's is how I got taught by some Apple doc and iPhoneDeveloperTips.
Important points:
After the final build, but before you rush off to zip up your app, open the bundle using the Finder's Show Package Contents. Due to some bug in the MacOS, which bit me in versions prior to Snow Leopard (and it might still be there), if you zip up too fast (using the Finder's Compress or Archive menu item), some of the resources have yet to be flushed out into the file. When you do a Show Package Contents, the contents get updated. The way you would notice this problem is that the size of your compressed app would be between a fifth to a tenth or less of the expected size. You might think to yourself, "hey, that zip utility really does a great job of compressing", but that's not the case. This problem would occur at this point instead of during testing mainly because you are doing a "clean all" build and all the resources and contents of the app bundle are starting out empty and then being filled by Xcode. And for some reason, even after Xcode is done creating the file, the contents are still not actually there, if you compress, but would be there if you looked at them (sort of a reverse Heisenberg). Beware.
Another area I spend a lot of time on is to make a nice backup of the sources, after I have committed all the latest changes to SVN, made a new branch, and tagged the file. I also like to have my version number match my SVN build/commit number so I always know which SVN version matches my release. I have those two version numbers in my info.plist and can be pulled up by the app user when they hit i for info. For example, a current info.pist includes:
<key>CFBundleShortVersionString</key>
<string>2.0a1</string>
<key>CFBundleVersion</key>
<string>346</string>
There are different thoughts on how to use the CFBundleVersion. This is my way. Also useful is the command line utility, agvtool.
Once the app is built, after compressing so you're not actually making any changes to the compressed version, go check the app file and make sure it is signed with the right distribution cert and not your adhoc one. Learning to use the command line utility, codesign, is helpful for this kind of checking and debugging. By making the compressed copy first, you ensure that you're not in any way going to change the final copy that Xcode has handed you and that you will upload to itunesconnect, if all looks well.
Other things to remember are the app icon, the various other icons and graphics you need for the iTunes store, the info.plist, and the fact that when the uploading of the app fails with a cryptic error message, it usually has to do with one of these pieces being missing from the compressed file you are building (those pieces that belong in the app bundle).
Look into this check list document # Github
https://github.com/bapu/AppReleaseCheckList