aboutsummaryrefslogtreecommitdiff
path: root/misc/ios
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2017-08-20 18:57:18 +0200
committerChris Broadfoot <cbro@golang.org>2017-08-21 21:08:17 +0000
commit1a2ac46edd162366e685a5fb782cd20adc1e36fa (patch)
tree18016ab6c6bffb42a642bf10a884b93f9a5764e3 /misc/ios
parent3dd1b0d07cda613d421990a5ddef55c33f6afc96 (diff)
downloadgo-1a2ac46edd162366e685a5fb782cd20adc1e36fa.tar.gz
go-1a2ac46edd162366e685a5fb782cd20adc1e36fa.zip
misc/ios: add support for device ids to the exec wrapper
If set, GOIOS_DEVICE_ID specifies the device id for the iOS exec wrapper. With that, a single builder can host multiple iOS devices. Change-Id: If3cc049552f5edbd7344befda7b8d7f73b4236e2 Reviewed-on: https://go-review.googlesource.com/57296 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: JBD <jbd@google.com> Reviewed-by: Chris Broadfoot <cbro@golang.org>
Diffstat (limited to 'misc/ios')
-rw-r--r--misc/ios/go_darwin_arm_exec.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/misc/ios/go_darwin_arm_exec.go b/misc/ios/go_darwin_arm_exec.go
index e84e513f93..cc57adb584 100644
--- a/misc/ios/go_darwin_arm_exec.go
+++ b/misc/ios/go_darwin_arm_exec.go
@@ -49,6 +49,7 @@ var (
appID string
teamID string
bundleID string
+ deviceID string
)
// lock is a file lock to serialize iOS runs. It is global to avoid the
@@ -77,6 +78,9 @@ func main() {
// https://developer.apple.com/membercenter/index.action#accountSummary as Team ID.
teamID = getenv("GOIOS_TEAM_ID")
+ // Device IDs as listed with ios-deploy -c.
+ deviceID = os.Getenv("GOIOS_DEVICE_ID")
+
parts := strings.SplitN(appID, ".", 2)
// For compatibility with the old builders, use a fallback bundle ID
bundleID = "golang.gotest"
@@ -294,7 +298,7 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
if err != nil {
return nil, err
}
- s.cmd = exec.Command(
+ cmdArgs := []string{
// lldb tries to be clever with terminals.
// So we wrap it in script(1) and be clever
// right back at it.
@@ -307,9 +311,13 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
"-u",
"-r",
"-n",
- `--args=`+strings.Join(args, " ")+``,
+ `--args=` + strings.Join(args, " ") + ``,
"--bundle", appdir,
- )
+ }
+ if deviceID != "" {
+ cmdArgs = append(cmdArgs, "--id", deviceID)
+ }
+ s.cmd = exec.Command(cmdArgs[0], cmdArgs[1:]...)
if debug {
log.Println(strings.Join(s.cmd.Args, " "))
}