i want to connect my iPad Safari with Instrument 4.5 installed with Xcode 4.5.2.
i was selecting allocations from instruments file menu-->new--> Choose a Template for the trace Document -ios -All -Allocations.
While i choose device and select attach to process then get a
greyed-out "Current Instrumentation Disallows Attach" menu item.
anyone facing the same problem and whats a solution for it.
Thanks in advance
I think that only some of the Instruments' instruments allow post-launch attachment. For example, the 'Sampler' instrument allows it.
Try adding just that instrument to the blank template. You can add it from the Library button. See if it attaches like that.
Related
I'm new to Instruments, and I'm trying to use Instruments Automation to send location events to my Xcode Swift project, which uses MapKit, but using a SIMULATOR (c.f. real device).
I've got this working by:
running my project in PROFILE mode in Xcode
then going to instruments automation with a script that uses "setLocationWithOptions"
But neither in Xcode or Instruments do I see my normal log output (print or NSLog) I use to monitor the app? How would I see print line outputs when doing this? Or is the different approach I should be taking?
Xcode 8
If talk about simulator, you need to run your application first and then, record running application through you instrument, Zombies, for example.
What you need to choose for recording:
select running application
I am trying to find an issue from an Apple generated crash report
I have the dSYM and the .app files in the Xcode Organizer, but can´t import the .crash to resymbolicate it using Xcode
The issue is that the "Import" and "Re-Symbolicate" buttons are absent in the "Devices View" and in the "View Device Logs" in Xcode 6.1
I have checked the Xcode release noted, but could´t find a reference to this.
I am missing something here?... thx....
I am using xcode 6.1.1, so I'm not sure if this was the case in 6.1...
Instead of a "Re-Symbolicate" button, you now need to view the log in the devices window and Control-click on the log name in the list of logs. This gives you a popup window that lets you delete, export, or re-symbolicate the log.
Unfortunately, though I found the "Re-Symbolicate" menu option, choosing it seems to have no effect and silently fails on the crash log I'm trying to figure out.
Did you try right clicking on the crash rows in device logs?
I am observing that whenever I am profiling my application using instrument in Xcode 6.0.1, application hangs every time while I am browsing through the application. I am using iPhone 5S (iOS 8.0.2) to run my application. When I run the application on device it runs all fine.
Found the fix - disabling the NSLog statements (profiling on release and not on debug) solved the issue for me.
Extending on Abhinav's correct answer, NSLog() is indeed triggering the issue, but not all NSLogs, only some very large ones. In my case I was logging some long responses from a web service, and commenting only those ones out fixed the problem of Instruments hanging. I guess this is the reason why the issue is not as widespread as you'd think (I couldn't find any reference to it on Apple's dev forums).
I've just been solving the same issue and it turned out to be caused by something else. I'm not 100% sure yet which part of my code is responsible, but it's got something to do with accessing the internet. So I've switched into Airplane mode et voila!
So my conclusion is that a network request was hanging the main thread (only when running Instruments tho -- weird) and if anyone else is running into similar problems, try finding what might hang your main thread.
Hope it saves some time :)
Z.
Follow those steps:
Run app on your device. It would be better if you set Release build in Edit scheme menu.
Go to the Debug navigator section on your Navigator (left menu in Xcode).
Click on CPU.
Click on Profile in Instruments and choose Transfer.
Instruments will run Time Profiler. Then in top panel click on Library button (looks like "+").
The library menu will open. You need to select your instrument.
I'm trying to figure out how to do automated UI testing so that I can test my app for regression errors as I make changes and such. I'm following the instructions found in Apple's documentation. I built my app in Xcode and it is running in the iOS simulator.
I opened Instruments and chose the iOS Automation instrument. However, I can't seem to figure out how to get Instruments to run the script on my iOS app in the sim. When I first create the Automation instrument the target drop down just says "lkj" but if I try to choose the sim as my target, it tells me that the Automation instrument doesn't allow attaching.
How do I get Instruments to run my test on my iOS app?
I tried just running it with the "lkj" target selected and I got a weird error involving some random guy's name (I'm assuming he's a dev for Instruments or something?)
Path not found
'/Users/jonathan_morgan/Library/Developer/Xcode/DerivedData/lkj-randomstringofcharacters/Build/Products/Release-iphonesimulator/lkj.app/lkj
The simplest way to attach your target to the simulator and run your UIAutomation scripts is to profile the app. Xcode - Product - Build For - Profiling and then select the Automation template.
Another way to attach the target, if you've already built the app on your simulator. Is to select Choose Target and then go to the following location /Users/[yourUserName]/Library/Application Support/iPhone Simulator/[iOSVersion]/Applications/[AppFolder]/[NameOfYourTarget]
For more info, you can take a look at this blog which is pretty detailed http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation
Hope it helps.
I am trying to run an automation on an iOS App using UIAutomation with Instruments.
It had worked well when I had tried it out a few weeks back. However, I tried out another automation testing framework (KIF from Square) in the meantime, and now when I try and run Automation with Instruments, it refuses to work.
When it had worked, I had carried out the following steps:
Open my app in Xcode
Run the app
Quit the iOS simulator
Open Instruments (not necessarily through Xcode, but just by searching for Instruments in Spotlight), choose Automation
Instruments opens, and when I click on Choose target, I do not need to browse for the target. I can see the name of my app in the list (description: the app name is without the .app extension and has an icon before the name like the icon which appears at the top of the output window in Xcode - a black and white icon with a gradient) even though I haven’t opened it before i.e even when I had opened Instruments for the first time.
I choose this target from the list, choose a javascript file for the automation to run, and then click ‘Record’. The automation used to run and I could see it run in the simulator which used to open up.
However, opening Instruments no longer shows me the target in the list of targets anymore.
I have tried choosing a target from my filesystem (from the Derived Data folder) as well as from the iPhone Simulator applications folder; but no luck. The target does not appear as it used to before (in the description above), but appears with a .app extension and with the typical application icon. The automation does start and open up the simulator, but gives the following message: (although the page or the script haven't changed at all)
Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().mainWindow().elements()[2]
(Would have liked to post images, but can't, since I am a new user and do not have the required permissions yet - hope the description makes up for it)
Have been stuck on this issue for long and any help would be appreciated! Thanks so much!
I just profiled the app using Product -> Profile in Xcode, and that opened up Instruments with the target. The target was the Unix executable under Derived Data -> MyApp -> Build Products -> Release-iphonesimulator -> MyApp.app -> MyApp unix executable.
Also, while using KIF, I had enabled accessibility labels for some views in the storyboard. While running the automation tests in Instruments, the app seemed to somehow consider the views which had the accessibility labels set as one single element and could not access sub-elements on this view. In order to run with Instruments, I just disabled the accessibility labels for the views and it worked like a charm again!