Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug with real device using xcode tools in terminal

I've already have Xcode tools installed on my mac and now I can build my iOS game project like this:

xcodebuild -scheme "Game Scheme"

and the next thing I want is to install and run the generated app (using the command above) on a real device (connect to mac).

I'm wondering if there is a command such as (I read the document about xcrun but still can not figure out how to get this done):

xcrun "my game.app" -l

to install the game on my device, run it, and print all the logs in my terminal just like Xcode did in the console.

Any advice will be appreciated, thanks :)

like image 291
supersuraccoon Avatar asked Oct 28 '15 03:10

supersuraccoon


People also ask

How do I debug my code in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

How do I access the console in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console".

What is Apple Xcode command line tools?

The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS. It consists of the macOS SDK and command-line tools such as Clang, which are installed in the /Library/Developer/CommandLineTools directory.


1 Answers

Doing so is a complicated process that requires reverse-engineering the MobileDevice framework interface or the underlying protocols.

Fortunately, various parties have done the work for you.

https://github.com/phonegap/ios-deploy

http://www.libimobiledevice.org/

like image 151
rob mayoff Avatar answered Oct 17 '22 06:10

rob mayoff