{"id":4940,"date":"2014-05-04T10:11:25","date_gmt":"2014-05-04T17:11:25","guid":{"rendered":"http:\/\/www.podfeet.com\/blog\/?page_id=4940"},"modified":"2014-05-19T22:09:15","modified_gmt":"2014-05-20T05:09:15","slug":"activity-monitor-for-ios-using-instruments-in-xcode","status":"publish","type":"page","link":"https:\/\/www.podfeet.com\/blog\/tutorials-5\/activity-monitor-for-ios-using-instruments-in-xcode\/","title":{"rendered":"Activity Monitor for iOS Using Instruments in Xcode"},"content":{"rendered":"<div class=\"clarify-article-content\">\n<div class=\"clarify-article-description\">\n<p>Activity Monitor is a great utility on the Mac to monitor what applications and services are chewing up CPU cycles, energy hogs, and other things that might slow your Mac down. in this tutorial, I&#8217;ll show you how to engage a version of Activity Monitor to track your iOS device. My particular interest in using Instruments was to see if I could figure out why my iPhone was chewing up battery while it was asleep. With Instruments I was able to monitor my device and it&#8217;s processes while it was sleeping.<\/p>\n<p>Prerequisite: Download and install Xcode first from the Mac App Store: <a href=\"https:\/\/itunes.apple.com\/us\/app\/xcode\/id497799835?mt=12\">https:\/\/itunes.apple.com\/us\/app\/xcode\/id497799835?mt=12<\/a> <\/p>\n<p>Note that this download is more than 2GB.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><!--more--><\/p>\n<div class=\"clarify-article-content\">\n<div class=\"clarify-steps-container\">\n<div id=\"clarify-step-1\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Xcode in Applications<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>After installation, Xcode will bei n your Applications folder as shown.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/xcode-in-applications.png\" width=\"427\" height=\"358\" class=\"clarify-step-image\" alt=\"Xcode in Applications\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-2\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Open Package Contents<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>Xcode is actually a package that includes other applications. &nbsp;To reveal these secret files, right click on Xcode and choose Show Package Contents.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/open-package-contents.png\" width=\"314\" height=\"116\" class=\"clarify-step-image\" alt=\"Open Package Contents\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-13\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Connect Your iOS Device to Your Mac<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>Make a physical connection via a cable to your Mac from your iOS device.<\/p>\n<\/div><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-3\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Navigate to Instruments<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>Navigate to Contents\/Applications\/Instruments<\/p>\n<p>You can now launch Instruments as as standalone document. You might want to put it in your Dock, or left sidebar for the future.<\/p>\n<p>Once you have launched Instruments for the first time, you can alternatively launch Instruments directly from Spotlight.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/navigate-to-instruments.png\" width=\"604\" height=\"313\" class=\"clarify-step-image\" alt=\"Navigate to Instruments\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-4\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Instruments<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>You&#8217;re faced with several templates, or you can begin building your own. &nbsp;For this exercise we&#8217;ll open the Activity Monitor template.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/instruments.png\" width=\"604\" height=\"428\" class=\"clarify-step-image\" alt=\"Instruments\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-5\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Instruments Main Screen<\/h4>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/instruments-main-screen.png\" width=\"604\" height=\"328\" class=\"clarify-step-image\" alt=\"Instruments Main Screen\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-6\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Change All Processes to Select Your iOS Device<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>My iPhone&#8217;s name is Mikala, but you can see that it&#8217;s greyed out with the warning &quot;Not for development&quot;. &nbsp;So we need to go declare the device to be used for development.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/change-all-processes-to-select-your-ios-device.png\" width=\"420\" height=\"260\" class=\"clarify-step-image\" alt=\"Change All Processes to Select Your iOS Device\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-7\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Launch Xcode Itself<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>Open Window &#8211;&gt; Organizer<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/launch-xcode-itself.png\" width=\"336\" height=\"224\" class=\"clarify-step-image\" alt=\"Launch Xcode Itself\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-8\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Xcode Organizer<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>Choose your device in the left sidebar and select Use for Development.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/xcode-organizer.png\" width=\"604\" height=\"303\" class=\"clarify-step-image\" alt=\"Xcode Organizer\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-9\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Uh oh<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>You&#8217;ll see the window but don&#8217;t panic, simply tap Cancel, and then quit Xcode.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/uh-oh.png\" width=\"356\" height=\"138\" class=\"clarify-step-image\" alt=\"Uh oh\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-10\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Now Select Your iOS Device in Instruments<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>If all went well in the previous step, you should now be able to select your iOS device under All Processes<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/now-select-your-ios-device-in-instruments.png\" width=\"305\" height=\"260\" class=\"clarify-step-image\" alt=\"Now Select Your iOS Device in Instruments\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-11\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Hit Record!<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>As you begin your recording, you can see a real time graph of the activity on your device, along with bar graphs for % CPU, CPU Time, Real Memory Usage, and then Real Memory Usage as a pie chart.<\/p>\n<p>For more data, tap on Trace Highlights in the left sidebar, and it will change to say Activity Monitor.<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/hit-record-.png\" width=\"604\" height=\"477\" class=\"clarify-step-image\" alt=\"Hit Record!\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<div id=\"clarify-step-12\" class=\"clarify-step-container\">\n<h4 class=\"clarify-step-title\">Instruments3<\/h4>\n<div class=\"clarify-step-instructions\">\n<p>All kinds of cool goodness in here. Now you can use the headings to sort by say %CPU to see what applications are hogging up all of your cycles.<\/p>\n<p>Note that you can make multiple runs to compare them and you can even save the instrument for later viewing.<\/p>\n<p>I&#8217;ll leave you to experiment with Instruments to see what else you can learn about your device. <\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\">\n<div class=\"clarify-step-image-container\">\n\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2014\/05\/instruments3.png\" width=\"604\" height=\"428\" class=\"clarify-step-image\" alt=\"Instruments3\" \/><\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"clarify-clear\"><\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Activity Monitor is a great utility on the Mac to monitor what applications and services are chewing up CPU cycles, energy hogs, and other things that might slow your Mac down. in this tutorial, I&#8217;ll show you how to engage a version of Activity Monitor to track your iOS device. My particular interest in using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":4374,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[],"tags":[153,150,9],"class_list":["post-4940","page","type-page","status-publish","hentry","tag-ios-tutorials","tag-mac-tutorials","tag-tutorials","post"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/pages\/4940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/comments?post=4940"}],"version-history":[{"count":1,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/pages\/4940\/revisions"}],"predecessor-version":[{"id":4941,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/pages\/4940\/revisions\/4941"}],"up":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/pages\/4374"}],"wp:attachment":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media?parent=4940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/categories?post=4940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/tags?post=4940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}