![](/img/trans.png)
[英]How do I build titanium apps from the command line and invoke the simulator?
[英]How to build & run xcodeproj on simulator from command line?
我想要做的就是能夠做到與Cmd
+ R
相同的東西,我可以在Xcode中做,除了終端。 但到目前為止看看多個堆棧溢出帖子和文章讓我迷失了方向。
到目前為止,我已經能夠從命令行運行模擬器:
open -a Simulator --args -CurrentDeviceUDID <UDID for iPhone 7>
但是我無法使用這些命令安裝和啟動應用程序
xcrun simctl install booted <PATH-TO-APPLICATION-BUNDLE>
xcrun simctl launch booted <BUNDLE-ID-OF-APP-BUNDLE>
我不知道如何找到<PATH-TO-APPLICATION-BUNDLE>
。 我假設它並不像只是將路徑放到.xcodeproj
那么容易......
如果有人可以編寫我需要的步驟和特定命令(1)從命令行構建.xcodeproj
和(2)從命令行在模擬器上運行應用程序,將非常感謝!
PS我知道有像ios-sim這樣的工具可能會使整個過程變得更容易,但是我想做它是原始的(即使用Xcode命令行工具)
(1)為了構建你的項目我建議你查看這個鏈接https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
(2)這是我如何在模擬器上啟動應用程序的示例
列出設備
xcrun simctl list
啟動裝置
(例)
xcrun simctl boot "iPhone 5"
或(例子)
xcrun simctl boot E9469085-68B9-450A-A716-87F013C9AF56
安裝.app (找到你的Library文件夾..可以隱藏)
格式:xcrun simctl install <device> <.app path>(示例)
xcrun simctl install "iPhone 5" "MyUserPath/Library/Developer/Xcode/DerivedData/CustomTransitions-edghiwbzifosladnxssmsfwzykxg/Build/Products/Debug-iphonesimulator/CustomTransitions.app"
關機裝置
xcrun simctl boot "iPhone 5"
打開模擬器 (這是我的路徑..你的可以是不同的)
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
啟動應用程序
格式:xcrun simctl啟動引導<bundle id>
xcrun simctl launch booted "com.example.apple-samplecode.CustomTransitions"
您可以使用此命令啟動並運行該應用程序
$ ios-sim launch --devicetypeid "iPhone-7" ".app path"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.