Skip to content

Commit f3e6e2f

Browse files
yangel2017GitHub Enterprise
authored and
GitHub Enterprise
committed
Support ios build/test with connected device in both intel/M1 host machine. (PixarAnimationStudios#663)
1 parent 36b74ab commit f3e6e2f

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Jenkinsfile

+27-2
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def windowsNode(platform, config) {
358358
def macNode(platform, config) {
359359
def label = 'OGS && Mac && nogpu'
360360
if ("${platform}".contains("ios")) {
361-
label = 'OGS && M1'
361+
label = 'device'
362362
}
363363
node("${label}") {
364364
def buildInfo
@@ -704,6 +704,29 @@ def windowsBuild(buildInfo) {
704704
}
705705
}
706706

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+
707730
def macBuild(buildInfo) {
708731
if (!(isDevBranch() || isReleaseBranch()) && (!"${buildInfo.Platform}".contains("ios"))) {
709732
// Check if the package is already deployed
@@ -748,8 +771,10 @@ def macBuild(buildInfo) {
748771
"""
749772

750773
if ("${buildInfo.Platform}".contains("ios")) {
774+
// Get connected real device name
775+
def deviceName = getConnectedDeviceName()
751776
sh """
752-
export DESTINATION="platform=iOS,name=iPad" ;
777+
export DESTINATION="platform=iOS,name=${deviceName}" ;
753778
${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
754779
"""
755780
}

0 commit comments

Comments
 (0)