Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App behaves different when run from XCode compared to .ipa

Tags:

xcode

ios

ipa

I have a very puzzling problem. My app uses several custom buttons that use gesture recognizers to determine a tap or a long press.

When I run the app from XCode on my device everything works as it should. However, when I package the app in an .ipa file and install that on the same device the buttons no longer work! None of the gestures are recognized nor do they change state when pressed. Everything else seems to work fine...

The devices I tested are an iPhone 5 (running iOS 6.1.4) and iPhone 4 & 4S (both running iOS 6.1.3). And I'm using XCode 4.6.2 on Max OSX 1.8.3.

Any ideas what might be causing this very strange behavior?

PS: The "Xcode generated" code keeps on working after I've disconnected it from XCode.

like image 938
Deddiekoel Avatar asked May 17 '13 21:05

Deddiekoel


People also ask

Can Xcode open IPA?

Using Xcode without source code.It will open the Devices and Simulators window. Select the Devices section and select the device from the left pane. Drag and drop the app/IPA on to the 'INSTALLED APPS' section. Wait for Xcode to finish the installation.

Can you run IPA on iOS?

iTunes application is used to install IPA files on iOS devices using the app store. First, you need to plug your iOS device (iPad/iPhone) into your laptop. Second, go to iTunes and locate your iOS device in the section Devices of the program's side menu. Drag your Open IPAss into the iTunes device list.

Can iPhone run Xcode?

To run your app in Simulator, choose an iOS simulator—for example, iPhone 6 Plus, iPad Air, or iPhone 6 + Apple Watch - 38mm—from the Xcode scheme pop-up menu and click Run. Xcode builds your project and then launches the most recent version of your app running in Simulator on your Mac screen, as shown in Figure 1-1.


2 Answers

Typically the code you archive into an IPA file would use a different configuration than from when you run it from XCode. I can't guess what's wrong specifically without looking at your project file or having some more information, but the first thing I would try would be to do an Edit Scheme on the scheme you're using and compare the build configuration used for the Run action and the Archive action.

like image 52
ScorpioCurse Avatar answered Sep 27 '22 19:09

ScorpioCurse


It could be Optimization Level! You probably build AdHoc builds with Fastest, Smallest [-Os]. See Optimization Level in your build settings. Build your debug with Fastest, Smallest [-Os], then you can see your misbehaviour in action, so you can fix it, and still submit apps with the preferred way of optimization (with Release configuration).

Fastest, Smallest [-Os] somehow releases weak references more strictly, as far as I experienced.

like image 41
Geri Borbás Avatar answered Sep 27 '22 18:09

Geri Borbás