Bla*_*laz 18 iphone build ipad ios-simulator xcode5
如何在多个目的地(例如,iPhone,iPad和iSimulator)上同时运行项目?


有2个相关问题:
1ˢᵗ问题(据说)有一个答案,但我无法弄清楚你究竟应该如何使用Aggregate目标(如果这是正确的方向),显然也不是Josh Kahane,OP; "答案"仍以某种方式得到/仍被接受.
2ⁿᵈ问题被关闭为"重复",好像1ˢᵗ提供了一个(可行的)答案.
添加了赏金:(如何)可以Aggregate同时使用多个目标Build & Run?或许可以Build & Run通过一些.sh脚本使用同时实现多个xcodebuild?还有其他可能解决方案
kit*_*rol 15
我遇到了同样的问题,所以我写了一个Xcode插件来帮助解决这个问题.我发现它比AppleScript选项更强大,更容易调用.
该插件被称为KPRunEverywhereXcodePlugin,并可通过恶魔或在GitHub上:https://github.com/kitschpatrol/KPRunEverywhereXcodePlugin

希望这可以帮助!
Bla*_*laz 11
它实际上比我想象的要简单.这会AppleScript带来一些痛苦Xcode:
tell application "Xcode"
activate
end tell
tell application "System Events"
tell application process "Xcode"
click menu item "1st iDevice Name" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
delay 5
click menu item "2nd iDevice Name" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
delay 5
click menu item "iPhone 6.1 Simulator" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
end tell
end tell
Run Code Online (Sandbox Code Playgroud)
AppleScript为.app.(自定义delay您的机器.)Service的Automator:选择Launch Application并.app从上一步中选择.Service上一步并为其指定键盘快捷键.提示:避免使用快捷方式^,因为它会显示此对话框:

当然,这不是严格意义上的同时 "构建和运行",但它肯定会在目的地之间手动琐事.
这是一个将在所有连接的 iOS 设备上构建和运行的脚本。使用方法:
JavaScript:
function run(input, parameters)
{
var xcode = Application("Xcode");
var ws = xcode.activeWorkspaceDocument();
var genericDest = null;
var devices = [];
ws.runDestinations().forEach(function(runDest)
{
if (runDest.platform() != "iphoneos")
return;
if (runDest.device().generic())
{
genericDest = runDest;
}
else
{
devices.push(runDest);
}
});
devices.forEach(function(device)
{
ws.activeRunDestination = device;
var buildResult = ws.run();
while (true)
{
if (buildResult.completed())
break;
if (buildResult.buildLog() && buildResult.buildLog().endsWith("Build succeeded\n"))
break;
delay(1);
}
delay(1);
});
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9519 次 |
| 最近记录: |