use xcode to instrument/profile third-party app - iphone

Is it possible to use Xcode Instruments to profile a third-party app? Right now, whenever I trying to profile any third-party app installed on device, I got error saying
'Target failed to run: Remote exception encountered: failed to get task for pid '
Is there any settings that need to be configured?

From Apple documentation: For your protection, the instrument does not allow you to process any application that is not code-signed with your provisioning profile. This includes any copy that has been downloaded from the iTunes App Store.

UPDATE
As of more recent versions of iOS, you can only attach the profiler to your own developer-signed apps.
ORIGINAL
Using Xcode 4.4.1 and my iPad 3 running iOS 5.1.1, I'm able to use the Core Animation and Time Profiler instruments on third-party apps. I tried it with Twitter and Minecraft PE.
The profiles are rather useless since I don't have symbols for the apps. I just get a lot of addresses in hex. And Instruments won't even show me the disassembly of the apps. I believe this is because iOS, for security, doesn't allow Instruments (or gdb or lldb) to look at the address space of apps installed from the App Store.

Related

Failed to install ad-hoc distribution with itunes 11.0.1

I have strange problem. I developed app code signed it with Distribution provisioning profile which includes correct devices and sent it to Client. He installed via iTunes and there were no problems. Suddenly iTunes 11 was released and Client told me that he is unable to install app on his devices.
The situations looks like this:
authorizing computer
adding app to iTunes library
selecting app to sync/install on device
start synchronization
Synchronization goes to step 4 where message says thet apps to synchronization are prepared and synchronization ends showing in iTunes that app is installed on device. But on device there is no app. No error or any kind of message, nothing...
To make things more complicated I'm able to install app on my devices (I even borrowed iPad's, iPhones and one iPod touch from friends to check it). Although I'm not able to install it on one iPod Touch 4G. The app is compatible with iOS 5 and 6.
Any ideas?
Same issue i was facing, i don't why iTunes 11 has this strange behaviour. But i managed to sent my .ipa to client using, Diawi. You have to upload your .ipa over here and it'll generate a link which will pass to your client and it'll be download easily. So this is simple and nice solution without interacting with iTunes.
Similar situation to me. iTunes 11 (OSX 10.8) failed to install IPA file. Everything seems all right, but there is no app on device, iPhone4 iOS6.0.1 in this case.
But when I install app via Test Flight, installation works.
When I try to install same application on OSX 10.7, iTunes10, installation works fine.
Maybe is problem in iTunes artwork that has to be 1024x1024, I do not know.

simulating app upgrade in iOS

I am trying to simulate an upgrade from version 2.0 to 2.1. I have version 2.0 hosted in testflight, so I did install it in my device. Then I tried running the app from xcode. However what happened is that the app did not get overlapped, instead it created two apps with the same name. How can I make it such that when I run the app from xcode it overlays the old version?
I've made sure that the bundle identifier is the same.
Well the info you can get while updating can be found # this link here.
when user updates an app, Documents folder is stored as is, including
NSUserDefaults (but, sometimes user download app via iTunes and
replace the whole application, crying 'OMG! update killed all my
levels progress!'); Application bundle is erased and replaced by new
one (anyway, it is readonly for user); Re-deployment of new build
version will be enough;
You can't access the appstore inside the simulator because: # link here
It's a simulator not an emulator. Even if there was an App Store in
the Simulator, none of the apps in the store would work since they are
compiled for ARM CPUs while the Simulator runs x86 code.
Another stack overflow # link here states:
Build and install your old version, generate some data, and then
install the new version on top of it.
For testing before submitting to the Appstore I generally download
from the AppStore again the old version, and then install with Xcode
the newer version - for your next update... ;-)
And another stack overflow (that I lost the link for) states:
No, the simulator runs i386 binaries and iPhone appstore apps are ARM
binaries apps.
iOS apps are compiled to machine code, Android apps are run in a
Virtual Machine using byte code and are translated to machine code at
the time they are run.
So no, I don't believe you can run it in the simulator, how ever you can have older projects saved on the iPhone and test both out. And the apple documentation is # this link here.
Read this: https://developer.apple.com/library/ios/technotes/tn2285/_index.html
You cannot simulate update in XCode (neither in simulator or connected device). You have to create IPA file and simulate update process via iTunes.

Error installing iOS app with Ad Hoc Profile

I have finished developing a big and heavy app. It is universal (for iPhone and iPad), and now I am trying to publish it in App Store. I have done this other times, so I know how annoying it is.
I'm using Xcode 4.2 and devices with many iOS versions (4.2.1, 5.0, 5.1). My app is enabled to send Push Notifications, and it doesn't use iCloud.
I have tested it with development certificate, and it works OK. Now I've generated and downloaded Ad Hoc Distribution Provisioning Profile in order to test it in my iPhone and iPad. It seem like all is OK, but when I'm going to install the app (with the Ad Hoc Distribution Provisioning profile) with Xcode in any device, Xcode shows an error: "Error launching remote program: failed to get the task for process".
I've read this link it suggests two causes:
I am using Ad Hoc Distribution Provisioning profile when debugging the app in my device. This is not the problem, because I'm not debugging the app.
I specify a code signing entitlements property list in my build settings which does not include a "get-task-allow" or "Can be debugged" property. This is not the problem, because I'm not specifying any entitlements property list because I don't need it (or I think so).
Some people that have the same problem solve it adding the "get-task-allow" property to the entitlements property list. But I haven't that file. So the question is, Do I need to create it just for add the "get-task-allow" property?
If I don't , which is the problem? I'm not trying to debugging and I haven't entitlements p-list in my app.
Although my app doesn't need entitlements p-list, I tried to create it and add the "get-task-allow" property in OFF following this, but it didn't solve the problem.
I have also to say that althought Xcode shows the error during the installation in the device and the app shut off, when I start again the app, the installation is done and the app runs without problem.
I read the following similar thread, but they didn't solve my problem:
iPhone Debugging: How to resolve 'failed to get the task for process'?
Profile bug (Error launching remote program: failed to get the task for process XXX.)
iPhone Debugging Error launching remote program: failed to get the task for process 907
Error launching remote program: failed to get the task for process 699
Thank you so much.
I am using Ad Hoc Distribution Provisioning profile when debugging the app in my device. This is not the problem, because I'm not debugging the app.
This is exactly the problem.
You are trying to run an ad-hoc application from the XCode - it means to debug it.
You should archive your app and install it (an ipa file) together with the correct provisioning profile.
There are few ways to install the app:
Using iTunes - not trivial
Using an iPhone Configuration Utility - easier
Using some OTA (over the air) installation service (e.g. TestFlight site) - I use this all the time, after a couple of times it gets really easy and you can distribute your Beta version to remote devices (e.g. clients, friends etc.)
The problem look like you are running App from Xcode with Ad Hoc Distribution Provisioning profile.
After Archiving (Product menu > Archive ) the App from Xcode, you can get ipa.
You can install ipa via iTunes if you device already sync with your iTunes app.
https://testflightapp.com/ , I am using testflightapp for testing the app. It's easy to use and we can distribute to for test user.

Testers unable to install application

I've sent my iphone application to my testers and all but one complain that the get error OxE8003FFE when they sync their devices. They are not able to install and run the application.
I'm using an ad hoc distribution provisioning profile and all of the testers devices are included in the profile.
I'm not sure how to proceed and would really appreciate any help you might be to give.
One more interesting bit of information: The program is a universal iPad/iPhone application. My testers are able to install it on their iPads but not their iPhones.
Did you properly add entitlements.plist, and uncheck the box therein?
I would recommend having one device locally that you deploy to through iTunes (not building through XCode), to test that the IPA file will work for other testers. That may mean buying an iPod touch, even the very oldest one will do (if you are targeting 3.x users).
I'd suggest you to right click your package, find a file embedded provisioning profile and open it with TextEdit. See that the name of the profile you've signed your application is indeed of that of ad-hoc.
After that be sure you sent this file (embedded provisioning profile) along with your ad-hoc build to your testers, because they have to install it on their devices, it's not being done automatically and w/o that profile your ad-hoc build will not sync to the device.
After some back and forth with DTS I managed to fix this issue.
The problem was that I was compiling for armv7 only which caused the installation to fail on armv6 machines.
Another interesting bit, the default universal project template and iphone projects converted to universal will compile for both architectures by default, this didn't happen for me bacause my project was initially an iPad only project which I converted manually (since there are no automatic tools for this) to be iPhone/iPad universal, this is the probable reason for this setting being incorrect in my project.

How to add adhoc application on multiple iphone on the same computer in itunes?

How to install my app in adhoc release on multiple device with the same computer/itunes, when i try to do it, itunes sync the devices..so i clean them up ...
Apple has solved your problem with an Enterprise Utility called the "iPhone Configuration Utility" which you may freely download from their information webpage here: http://support.apple.com/downloads/iPhone_Configuration_Utility_2_0_for_Mac_OS_X
Once you install this and connect a device and close iTunes (which typically launches in response to the device connection) you can easily use its simple interface to manage your adhoc provision profiles, add the device and install or remove adhoc apps directly.
I used this app months ago to put the Crash Landing demo I'd built with the SDK directly on my wife's 2.1 iPhone 3G from my desktop dev Mac without messing up her own laptop Mac iTunes sync management of her apps, music, etc. FYI: I've not tried this since the June update to v2.0 of the Utility which accompanied the release of OS 3.0. edit: I couldn't resist testing this (yes, it still works)
The only downside I noticed to this method is that the iPhone/Touch user will have to later delete the app manually on their device, as their iTunes management won't list the app in the device applications tab to be unchecked.
it should just work, as long as the mobileprovision file that you're using includes all of the devices that you're trying to use. (also assuming that all of the devices are set to sync to that one computer's iTunes library.)
If the device is jailbroken you can install sshd and copy the application directly.