简体   繁体   中英

using xcodebuild command line to put an app on the iPhone

Is this possible? How does Xcode actually deploy iPhone apps that were built into the iPhone?

Or is there another tool which I'm missing out on?

clarification: by "deploy" I mean actually install and run gdb on the iPhone like when you do run>debug

xcodebuild only builds targets, it does not run executables; there's no way for it to invoke the code that transfers an iPhone app to a device and starts the debugger.

xcodebuild is what Xcode uses under the cover the build iPhone apps. So you can definitely use it to build the app. Just cd into the directory in which your project resides and then execute xcodebuild:

cd myProjectDir
xcodebuild

This will build the project in that directory, much in the same way as if you'd hit Build from xcode.

One thing you cannot do with xcodebuild is deploy the app to the iPhone. If you want to do this I beleive the simplest way is to use Xcode. If you want to automate this I would suggest using AppleScript.

You can find out more about xcodebuild here , a page which includes the following description of xcodebuild:

Run xcodebuild from the directory containing your project (ie the directory containing the projectname.xcodeproj package). If you have multiple projects in this directory you will need to use -project to indicate which project should be built.

By default, xcodebuild builds the first target listed in your project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project. The active target and active build configuration properties are set for each user of the project and can vary from user to user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM