<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Developer Insider</title>
    <description>The latest articles on DEV Community by Developer Insider (@developerinsider).</description>
    <link>https://dev.to/developerinsider</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F237%2F73f1a020-5831-42bf-aeea-71d95d5fc5c2.png</url>
      <title>DEV Community: Developer Insider</title>
      <link>https://dev.to/developerinsider</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/developerinsider"/>
    <language>en</language>
    <item>
      <title>Best iOS Development Tips and Tricks</title>
      <dc:creator>Vineet Choudhary</dc:creator>
      <pubDate>Fri, 10 Aug 2018 15:14:50 +0000</pubDate>
      <link>https://dev.to/developerinsider/best-ios-development-tips-and-tricks-2pk4</link>
      <guid>https://dev.to/developerinsider/best-ios-development-tips-and-tricks-2pk4</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://developerinsider.co/best-ios-development-tips-and-tricks/" rel="noopener noreferrer"&gt;Developer Insider&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Track build time in Xcode
&lt;/h2&gt;

&lt;p&gt;If you don't know the exact build time of your project, enable the following option in Xcode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;defaults write com.apple.dt.Xcode ShowBuildOperationDuration &lt;span class="nt"&gt;-bool&lt;/span&gt; YES
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz91ohrcw6bbkp0kh3zaz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz91ohrcw6bbkp0kh3zaz.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Improve your Swift project build time
&lt;/h2&gt;

&lt;p&gt;The Xcode 9.2 release notes mentioned an experimental feature that may improve Swift build times, enabled with the "BuildSystemScheduleInherentlyParallelCommandsExclusively" user default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;defaults write com.apple.dt.Xcode BuildSystemScheduleInherentlyParallelCommandsExclusively &lt;span class="nt"&gt;-bool&lt;/span&gt; NO
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: According to the release notes it's an experimental feature which can "increase memory use during the build"&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Use Simulator in full-screen mode with Xcode
&lt;/h2&gt;

&lt;p&gt;Being able to run Xcode and iOS simulator together in full screen mode is probably my favorite feature of Xcode 9. You can just execute the following command in the terminal to enable this feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;defaults write com.apple.iphonesimulator AllowFullscreenMode &lt;span class="nt"&gt;-bool&lt;/span&gt; YES
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/YFPUgQpUmuE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you want to use more secret features in Simulator you should enable Apple hidden Internals menu. To do so you need to create an empty folder with name "&lt;strong&gt;AppleInternal&lt;/strong&gt;" in the root directory. Just run this command below and restart Simulator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /AppleInternal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new menu item should show up.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4foq0zapzhh9m9c1qeow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4foq0zapzhh9m9c1qeow.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Capture iOS Simulator video
&lt;/h2&gt;

&lt;p&gt;You can take a screenshot or record a video of the simulator window using the xcrun command-line utility. To record a video, execute the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl io booted recordVideo &amp;lt;filename&amp;gt;.&amp;lt;file extension&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl io booted recordVideo appvideo.mov
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press &lt;code&gt;control + c&lt;/code&gt; to stop recording the video. The default location for the created file is the current directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Share files to Simulator from Finder
&lt;/h2&gt;

&lt;p&gt;From Xcode 9, Simulator has Finder extension which allows you to share files directly from the Finder's window. However, drag &amp;amp; drop file to the Simulator's window seems much faster.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/G7gpQQ49mhA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;However, You can do something similar with image/video files using the simctl command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl addmedia booted &amp;lt;PATH TO FILE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Use your fingerprint to sudo
&lt;/h2&gt;

&lt;p&gt;If you want to use your fingerprint as your sudo password on Macbook Pro edit &lt;code&gt;/etc/pam.d/sudo&lt;/code&gt; and add the following line to the top&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;auth sufficient pam_tid.so
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now use your fingerprint to sudo.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Debug your AutoLayout constraints with  Sound Notification
&lt;/h2&gt;

&lt;p&gt;And this is a great way to debug your AutoLayout constraints. Just pass UIConstraintBasedLayoutPlaySoundOnUnsatisfiable argument on launch and it’s plays sounds when constraints are screwed at runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;-_UIConstraintBasedLayoutPlaySoundOnUnsatisfiable&lt;/span&gt; YES
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/G_fuCXMChp8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Remove unavailable simulators from Xcode
&lt;/h2&gt;

&lt;p&gt;This little command will remove all unavailable simulators from Xcode. Here "unavailable" means unavailable to xcode-select's version of Xcode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcrun simctl delete unavailable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What are your favorites? Please add in comment section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developerinsider.co/best-ios-development-tips-and-tricks-part-2/" rel="noopener noreferrer"&gt;Best iOS Development Tips and Tricks - Part 2&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>macos</category>
      <category>iosdevelopment</category>
      <category>tipsandtricks</category>
    </item>
  </channel>
</rss>
