从命令行使用xcodebuild构建可可应用后,该如何运行? [英] How do I run a Cocoa app after building it from the command line with xcodebuild?
本文介绍了从命令行使用xcodebuild构建可可应用后,该如何运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用这样的Xcode项目从命令行构建Mac OS X Cocoa应用程序:
I'm building a Mac OS X Cocoa application from the command line using an Xcode project like this:
xcodebuild -scheme MyApp -configuration Debug
构建完成后如何运行?
推荐答案
我写了一个脚本来做到这一点:
I wrote a script to do this:
#!/bin/bash
x=$( xcodebuild -showBuildSettings -project MyApp.xcodeproj | grep ' BUILD_DIR =' | sed -e 's/.*= *//' )
DYLD_FRAMEWORK_PATH=$x/Debug DYLD_LIBRARY_PATH=$x/Debug $x/Debug/MyApp.app/Contents/MacOS/MyApp
(我是通过从Xcode运行应用程序,然后在进程上运行ps -wwE -p
来查看其环境变量来解决这个问题的.)
(I figured this out by running the application from Xcode and then ps -wwE -p
on the process to see its environment variables.)
这篇关于从命令行使用xcodebuild构建可可应用后,该如何运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文