@@ -358,7 +358,7 @@ def windowsNode(platform, config) {
358
358
def macNode (platform , config ) {
359
359
def label = ' OGS && Mac && nogpu'
360
360
if (" ${ platform} " . contains(" ios" )) {
361
- label = ' OGS && M1 '
361
+ label = ' device '
362
362
}
363
363
node(" ${ label} " ) {
364
364
def buildInfo
@@ -704,6 +704,29 @@ def windowsBuild(buildInfo) {
704
704
}
705
705
}
706
706
707
+ // Get connected real device name
708
+ def getConnectedDeviceName ()
709
+ {
710
+ def realDeviceName = ' '
711
+ output = COMMONSHELL . capture_script_output(" xcrun xctrace list devices" ). tokenize(' \n ' )
712
+ for (line in output) {
713
+ line = line. trim()
714
+ if (line == ' ' || line. startsWith(' ==' ) || line. contains(' simulator' )){
715
+ continue
716
+ }
717
+ // The real device would be something like iPhone (16.6) (00008110-001A44CE0220A01E)
718
+ // Please only use letters, digitals and '_' for the device name.
719
+ def matcher = line =~ / (\w +) \( .+\) \( .+\) /
720
+ if (matcher. find()){
721
+ realDeviceName = matcher[0 ][1 ]
722
+ matcher = null
723
+ break
724
+ }
725
+ matcher = null
726
+ }
727
+ return realDeviceName
728
+ }
729
+
707
730
def macBuild (buildInfo ) {
708
731
if (! (isDevBranch() || isReleaseBranch()) && (! " ${ buildInfo.Platform} " . contains(" ios" ))) {
709
732
// Check if the package is already deployed
@@ -748,8 +771,10 @@ def macBuild(buildInfo) {
748
771
"""
749
772
750
773
if (" ${ buildInfo.Platform} " . contains(" ios" )) {
774
+ // Get connected real device name
775
+ def deviceName = getConnectedDeviceName()
751
776
sh """
752
- export DESTINATION="platform=iOS,name=iPad " ;
777
+ export DESTINATION="platform=iOS,name=${ deviceName } " ;
753
778
${ buildInfo.Python} -u build_scripts/build_usd.py ${ build_target} --build ${ buildInfo.USDgen_build} --src ${ buildInfo.USDgen_src} ${ buildInfo.USDinst} --build-variant ${ buildInfo.BuildVariant} ${ build_flags} ${ add_flags} -v
754
779
"""
755
780
}
0 commit comments