title: How to get app running on connected device
body: <p>I'm trying to get a simple NativeScript app running on my device (iPhone) connected to my mac.  The simple app works fine on the simulator, but fails when a device is connected.  (Its the HelloWorld app from the tutorial.)</p>
  
  <p>When running "tns run ios" from my mac, I get the following error:</p>
  
  <p>Unable to apply changes on device: . Error is: ENOENT: no such file or directory, scandir '/Users/edscott/Library/MobileDevice/Provisioning Profiles/'.</p>
  
  <p>I also tried installing Sidekick and using it to auto generate the  Provisioning Profile and Certificate.  It successfully generated the provisioning profile and certificate.  (I did not change any configuration in my app, if I needed to point something at these files or copy them somewhere, I did not.  Maybe that is the issue?)</p>
  
  <p>From SideKick, when selecting my connected device, setting the Build Type to Local and the Build Configuration to either Debug or Release, and then clicking "Run on Device", I get a very similar error:</p>
  
  <p>Error detected during LiveSync on  for /Users/edscott/HelloWorld. Error: ENOENT: no such file or directory, scandir '/Users/edscott/Library/MobileDevice/Provisioning Profiles/'.</p>
  
  <p>The only change I made to the app was to change the package.json file and set the nativescript.id value to a unique app id.</p>
  
  <p>FYI...The provisioning profile and certificate created by SideKick were placed in /Users/edscott/Library/Application Support/NativeScriptSidekick/CodeSigning/HelloWorld/ios directory.</p>
  
  <p>Also, I created a new apple id to use with SideKick.  The apple id I use on both my phone and mac has 2FA and apparently SideKick can not generate provisioning profile and certificates for apple ids with 2FA.  </p>
  
  <p>I plan to experiment with using NativeScript to build an ios app that reads data from iBeacons.  Therefore, running on the device is critical for me (as opposed to running on the simulator).</p>
  
  <p>I'm looking for help in what to try next.</p>
  
  <p>Update:
  Based on the comment added below, I opened the provision.mobileprovision file that was created by SideKick using Xcode - this created a provisioning profile in '/Users/edscott/Library/MobileDevice/Provisioning Profiles/'.  However, I was still not able to run the app on my device.  I'm now getting the following error:</p>
  
  <p>Unable to apply changes on device: xxxx. Error is: Command xcodebuild failed with exit code 70.</p>
  
  <p>In addition, there are multiple errors reported about the following:
  Error Domain=IDECodesignResolverErrorDomain Code=1 "No signing certificate "iOS Distribution" found"</p>
  
  <p>However, based on some other similar issues posted online, I tried running the app in Xcode directly, and that worked (after I turned off debug execution based on another online comment associated with XCode 10).</p>
  
  <p>So now, I have a way to run the app, but it won't run from the CLI or SideKick app, it will only run in Xcode.</p>