I have ported a library (ice , NAT traversal ) for iPhone and encountering issue while actually testing it on iphone device(Version 4.3). Developed a cocoa touch wrapper which is linked with my library. The library routines get called from "test" button placed in my application.
The application is .mm and library is C++ based.
Below are the cases in which my application fails/passes
Case I: I "build and debug" / "build and run" application from Xcode for iphone. The application works fine on iphone and I am able to see logs for the same on the console on my mac machine.
Case II: I try to run application from my iphone, but it just crashes while opening.
Case III: I build and debug application from Xcode, the application get's launched. But as soon as i unplug the debug cable (attached to iphone from my mac), the application get's crashed.
The size of application is 16 MB, and size of library is 288 MB.
I tried to simulate same issue by making a simple test application and a test library. it runs fine in all cases without issues. What can be the issue?
It seems that the application is mapping library code from mac machine while running on iphone. and once the physical link is broken, the app crashes.
size of library is huge?
Thanks in advance
iOS kills apps that blocks the main thread for too long. So that may be the problem and also explains why the app doesn't get killed in debug mode.
Try running your function in the background and see if that helps!
Finally I got answer to my question! Thanks a lot Martin for pointing out "iOS kills apps that blocks the main thread for too long"
Following is the procedure i followed to find the resolve the issue:
Xcode "orgainzer"--> "Device logs" section shows iphone crash report. My application crash report was also generated in the same.
In crash report it was clearly written "mytestapp failed to launch in time" and further it showed the API which was taking too long to return the result. ( in my case it was getlocalhostname API).
I just corrected the API as per my requirement, compiled and run the app on iphone device and it worked!! Also the launch time of application is pretty less now.
Thanks again!
Related
Distributed a build through TestFlight. The ad-hoc build works fine on iPhone 5,but will open and then crash on iPhone 4 and 4s. If compiled and run through Xcode (directly to Phone with dev provisioning profile) the build runs on both iPhone 5, 4s and 4.
Has anyone ran into this?
The first thing to do debugging testflight errors (or any other, for that matter) is to get the error log, and read and understand the error message. In this case the error is:
failed to launch in time
If your app doesn't finish starting up (I believe this is essentially return from the application:DidFinishLaunchingWithOptions: method) in a certain amount of time, it's killed by the system. Either you have an infinite loop or you are trying to do way too much in that method. In this case, the app caches images in that method, which evidently is fast enough to finish in time on the iPhone 5 but not earlier ones. The solution is to queue a dispatch_async call (see Dispatch Queues) that caches the images in the background, and return quickly from the app launch method.
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.
I want to install and simulate iOS applications and find their malware intentions. See if connects to an IP address, downloads something, API call logs and soo on... kind of everything it does on the system. Does iOS Simulator log this events, or is there any online project that does that. If not then I should do it from scratch, do you have any advice how to do this? I only have the application file, not the entire Xcode project.
ALL i have is a bunch of applications(not the projects) that i have to test. All i want is to run them and log their actions in an automated way. Just like running a windows application on a virtual machine and log api trace, internet connections, memory, registry, disk actions... IN AN AUTOMATED WAY.
Thank you.
In the iOS simulator apps simply run on Mac, but their output is shown in the iOS simulator. This means that any tool that allows you to audit Mac applications will allow you to do the same with the iOS simulator.
Check your Activity Monitor, you'll see that the app is simply listed there. I think the standard Xcode Instruments will work fine for you.
If you have the Xcode project, then look at the code and the debugger while it is running. Other than that, if you run it in the iOS simulator you will only see the GUI portion of the app, unless you are running it side by side from Xcode (then you can use Instruments or the debugger). This documentation should allow you to run the apps on the simulator.
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.
My application crashes when freely running it on a real device or in the simulator. When I'm running it with XCode attached, the app works fine.
The app doesn't give me any errors and since I'm not running it with XCode attached, there is no message sent to the logger.
Any idea of what could be wrong or how I could find out what causes this crash?
Thanks!
You can read about CFRelease in detail in the following thread
Cheers
If you just want to test in a device why don't you try through iTunes. Find the Target of your project in the Finder, then drag it to iTunes. You can then sync the applications. This is not a solution but an alternative to run the app on your device.
Thanks Aditya,
The crash logs in the Organizer are actually very well detailed and they even include the line of code in the implementation file where the app crashed. When going to that line of code it seemed that I was CFRelease -ing a ABRecordRef, which is an integer of some kind...therefore I shouldn't release it
The weird thing is that it didn't crash or complain while debugging, but when running it on the device it did.