2
我試過閱讀Apple提供的Xcode Tools documentation,以便我可以使用終端來構建.app
文件並在模擬器上運行生成的應用程序。基本上我想要做的就是在Xcode上做與Cmd
+ R
相同的操作。如何從命令行構建Xcode項目?
到目前爲止,我試圖建立我.xcodeproj
這樣的:
xcodebuild -configuration Debug build
然而,當我在模擬器上安裝&運行它,我得到一個應用程序瓦特/黑屏:
// Boot device
xcrun simctl boot "iPhone 7"
// Install app
xcrun simctl install "iPhone 7" "/Users/.../MyApp/build/Debug-iphoneos/MyApp.app"
// Open simulator
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
// Launch app using its bundle id
xcrun simctl launch booted "com.example.apps.MyApp"
更何況xcrun simctl launch booted "com.example.apps.MyApp"
行永不終止,並在模擬器上,它不斷嘗試打開並重新打開應用程序,但該應用程序只顯示黑屏。
如果有人可以告訴我我做錯了.xcodeproj
這將是偉大的建設!