48

How do I deploy my app down to the iPhone (for testing purposes) from XCode without actually running the app?

Jason Marcell
  • 2,605
  • 5
  • 27
  • 39

6 Answers6

71

Edit your launch Scheme, open the section titled "Run myApp.app" and toggle ON the option to "Wait for myApp.app to launch".

It will then just install, and not run the app. If you do run it yourself, the debugger should attach. This is useful for when you want to test how your applications works when launched via a URL, amongst other things.

NOTE - To be fair, this answer is the same as the one for this question. I didn't mark this question as a duplicate though, because you might have a different reason for wanting to do this. Still, if you want a more detailed explanation, look there.

Community
  • 1
  • 1
DougW
  • 25,384
  • 18
  • 76
  • 106
  • 1
    Maybe I'm not doing this right, but I see no logs in the console. You said `the debugger should attach`. Does that not mean it will also capture logs ? – n00bProgrammer Jun 14 '14 at 05:53
  • 2
    As an additional help to those who are wondering how to edit the scheme, look at this link https://developer.apple.com/library/mac/recipes/xcode_help-scheme_editor/Articles/SchemeDialog.html – Qin Zhengquan Jul 08 '14 at 12:29
8

Xcode -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Wait for executable to be launched

ethanneff
  • 2,393
  • 3
  • 20
  • 12
8

☝️ One...: enter image description here

✌️...Two...:

enter image description here

... and Three: enter image description here

0

You can create an archive, drag that .ipa onto iTunes and sync the device.

Or you can just run it from XCode, and then kill the XCode process, and run it from the SpringBoard, though I assume you need the virgin case or you wouldn't have asked the question.

Rayfleck
  • 12,116
  • 7
  • 44
  • 72
-1

If you time it just right by watching the Xcode console, you can kill the debugger after the app is completely downloaded, but before any code in the app is executed.

If you don't want to depend on timing, and don't need to consider the app to be running until it hits some Cocoa Touch or Objective C runtime code, you could set a breakpoint on an NSLog inserted as the first line of main() and kill the app after it hits that breakpoint.

hotpaw2
  • 68,014
  • 12
  • 81
  • 143
-6

Connect your device, set the Scheme on your top left to iOS Device.

Melvin Lai
  • 801
  • 3
  • 14
  • 35