Xcode 6 -從命令行啟動模擬器Xcode 6 - Launch simulator from command line- 此內(nèi)容更新于:2015-04-21
主題: 我想從命令行啟動iPhone模擬器。 直到現(xiàn)在我一直使用以下命令 /應(yīng)用程序/ Xcode.app /內(nèi)容/開發(fā)/平臺/ iPhoneSimulator。平臺/開發(fā)/應(yīng)用程序/ iPhone模擬器。應(yīng)用程序/內(nèi)容/ MacOS / -SimulateDevice iPhone模擬器 -SimulateDevice用于啟動一個特定的設(shè)備類型 現(xiàn)在Xcode 6路徑和應(yīng)用已經(jīng)改變 /應(yīng)用程序/ Xcode。應(yīng)用程序/內(nèi)容/開發(fā)/應(yīng)用程序/ iOS模擬器。應(yīng)用程序/內(nèi)容/ MacOS / iOS模擬器 但遺憾的是-SimulateDevice選擇現(xiàn)在不工作。我可以啟動模擬器,但沒有一個選項來指定哪一個啟動 有人發(fā)現(xiàn)這與Xcode 6的替代品嗎? 原文: I want to launch iPhone simulator from command line. until now I have been using the below command
-SimulateDevice is used to launch a specific device type Now with Xcode 6 the path and the app has been changed to
but sadly -SimulateDevice option is not working now. I can launch the simulator, but dont have an option to specify which one to launch Anyone found any alternatives for this with Xcode 6? 解決方案: 我想要找到一種方法來實現(xiàn) 蘋果公司推出了一個有趣的工具與Xcode 6 ! simctl simclt允許您控制模擬器運行 運行xcrun simctl可用子命令的列表。許多新選項來玩耍。 現(xiàn)在去做我想要的。這是命令來啟動模擬器 xcrun儀器- w“iPhone 5(8.0模擬器)” - w是提供設(shè)備類型和可用設(shè)備列表,執(zhí)行這個 xcrun儀器- s 發(fā)射后使用simctl模擬器可以控制它 安裝你的應(yīng)用程序 xcrun simctl安裝啟動< >應(yīng)用程序路徑 啟動應(yīng)用程序 xcrun simctl發(fā)射啟動<應(yīng)用標(biāo)識符> 希望這有助于 原文: Found a way to achieve what I wanted Apple has introduced an interesting tool with Xcode 6!
simclt allows you to control the simulators running run Now to do what I wanted. Here is the command to launch simulator
-w is to provide device type and to get the list of available devices, just execute this
After launching the simulator you can control it using To install you app
To launch the app
Hope this helps dusty的回復(fù):<應(yīng)用標(biāo)識符>是應(yīng)用程序包id (原文:<app identifier> is your app bundle id) space_monkey的回復(fù):官方文檔simctl命令的存在嗎? (原文:Does official documentation exists for the simctl command?) daniellmb的回復(fù):我看到,除了一些已知問題,如前所述xcrun simctl將列出的命令。在我看來他們是漂亮的自我解釋。 (原文:Not that I saw, other than some known issues, as mentioned running xcrun simctl will list the commands. In my opinion they are pretty self explanatory.) iLoveUnicorns的回復(fù):優(yōu)秀,工作的100%。 (原文:Excellent, working 100%.) CambridgeMike的回復(fù):我不能夠讓它使用xcrun simctl啟動<設(shè)備id >而不是xcrun儀器- w…… (原文:I wasn't able to get it to work using xcrun simctl boot <device id> instead of xcrun instruments -w...)
IT組織首度開放,在 創(chuàng)建屬于你的IT怪組織, 即日起前100名發(fā)表過有質(zhì)量帖子的注冊用戶,馬上就變成組織頭目了, 心情好激動啊。 馬上去看看
解決方案: Xcode 6,如果你想iOS模擬器。應(yīng)用程序啟動時啟動一個特定的設(shè)備,你可以從命令行運行這個: 開放——“iOS模擬器”——args -CurrentDeviceUDID <設(shè)備UDID > 在那里你可以找出你想要的設(shè)備的UDID引導(dǎo): xcrun simctl列表 原文: With Xcode 6, if you want to have the iOS Simulator.app boot a specific device when it launches, you can run this from the command line:
where you can figure out the UDID of the device you want to boot from:
Michael Teper的回復(fù):在6.2測試版,命令不再有效。例如,而不是推出iPhone 5 s模擬器(鑒于其ID),我讓iPad空氣模擬器。 (原文:In 6.2 beta, that command no longer works. For example, instead of launching the iPhone 5s simulator (given its ID), I get the iPad Air simulator.) Jeremy Huddleston Sequoia的回復(fù):它仍然很吸引我。 (原文:It still works for me.) Michael Teper的回復(fù):嗯,我們已經(jīng)不可靠地工作在3個不同的機(jī)器上。其他的信息我可以提供幫助解決嗎? (原文:Hmm, we have it reliably not working across 3 different machines. Any other info I can supply to help troubleshoot?) Michael Teper的回復(fù):我知道正在發(fā)生什么。我們安裝Xcode 6.2測試版,但是不讓它默認(rèn)Xcode。所以,/usr/bin/xcrun simctl列表列出了常規(guī)Xcode模擬器。然而,開放——“iOS模擬器”啟動6.2 beta模擬器,它預(yù)計從beta模擬器設(shè)備id。我怎么能指定哪個我模擬器啟動(定期比β)嗎? (原文:I've figured out what is happening. We installed Xcode 6.2 beta, but did not make it the default Xcode. So, /usr/bin/xcrun simctl list lists the simulators available to regular Xcode. However, open -a "iOS Simulator" launches the 6.2 beta simulator, which is expecting the device IDs from the beta simulator. How can I specify which simulator I launch (regular vs. beta)?) Jeremy Huddleston Sequoia的回復(fù):/ / Xcode打開/路徑。應(yīng)用程序/內(nèi)容/開發(fā)/應(yīng)用程序/ iOS \ Simulator.app (原文:open /path/to/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app) 解決方案: 您可以指定的硬件和iOS版本- w國旗。的格式是 如: 工具- w“iPhone視網(wǎng)膜(3.5英寸)-模擬器iOS 7.1”。 你會得到可用hardvare-iOS組合使用工具- w幫助命令。 原文: You can specify the hardware and iOS version with -w flag. The format is
For eg:
You will get the available hardvare-iOS combinations by using the Michael Teper的回復(fù):使用儀器- s設(shè)備的設(shè)備列表。然而,一旦你有設(shè)備名稱,只需調(diào)用工具- w <設(shè)備>可能會產(chǎn)生一個錯誤,因為工具試圖編寫一個跟蹤您的驅(qū)動器的根。您可能希望指定一個路徑跟蹤,它將成功地寫入。 (原文:Use instruments -s devices to get a list of devices. However, once you have the device name, simply calling instruments -w <device> will likely yield an error as instruments attempts to write a trace to the root of your drive. You may want to specify a path for the trace that it will successfully write to.) |
|