49
49
appID string
50
50
teamID string
51
51
bundleID string
52
+ deviceID string
52
53
)
53
54
54
55
// lock is a file lock to serialize iOS runs. It is global to avoid the
@@ -77,6 +78,9 @@ func main() {
77
78
// https://developer.apple.com/membercenter/index.action#accountSummary as Team ID.
78
79
teamID = getenv ("GOIOS_TEAM_ID" )
79
80
81
+ // Device IDs as listed with ios-deploy -c.
82
+ deviceID = os .Getenv ("GOIOS_DEVICE_ID" )
83
+
80
84
parts := strings .SplitN (appID , "." , 2 )
81
85
// For compatibility with the old builders, use a fallback bundle ID
82
86
bundleID = "golang.gotest"
@@ -294,7 +298,7 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
294
298
if err != nil {
295
299
return nil , err
296
300
}
297
- s . cmd = exec . Command (
301
+ cmdArgs := [] string {
298
302
// lldb tries to be clever with terminals.
299
303
// So we wrap it in script(1) and be clever
300
304
// right back at it.
@@ -307,9 +311,13 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
307
311
"-u" ,
308
312
"-r" ,
309
313
"-n" ,
310
- `--args=` + strings .Join (args , " " )+ `` ,
314
+ `--args=` + strings .Join (args , " " ) + `` ,
311
315
"--bundle" , appdir ,
312
- )
316
+ }
317
+ if deviceID != "" {
318
+ cmdArgs = append (cmdArgs , "--id" , deviceID )
319
+ }
320
+ s .cmd = exec .Command (cmdArgs [0 ], cmdArgs [1 :]... )
313
321
if debug {
314
322
log .Println (strings .Join (s .cmd .Args , " " ))
315
323
}
0 commit comments