Tuesday 15 September 2015

ios - Unable to execute tests from command line via xcodebuild on Jenkins -



ios - Unable to execute tests from command line via xcodebuild on Jenkins -

i'm using next command execute tests:

xcodebuild test -workspace myapp.xcworkspace -scheme myscheme -destination 'platform=ios simulator,name=iphone 6,os=8.1'

this works fine locally, when seek on jenkins fails next error:

xcodebuild test -workspace myapp.xcworkspace -scheme myscheme -destination 'platform=ios simulator,name=iphone 6,os=8.1'

xcodebuild: error: unable find destination matching provided destination specifier: { platform:ios simulator, os:8.1, name:iphone 6 }

the requested device not found because no available devices matched request.

available destinations "myscheme" scheme:

build step 'execute shell' marked build failure

finished: failure

so launched xcode gui on jenkins check if iphone 6 simulator present, , it's there. interesting thing when run same xcodebuild command without specifying name , os destination on local, list of available simulators, so:

available destinations "myscheme" scheme: { platform:ios simulator, id:683233c4-ec2b-48a3-826b-10ef62a875cd, os:8.1, name:ipad 2 } { platform:ios simulator, id:6358a6f5-2fd0-4377-bd32-0a2c3329276d, os:8.1, name:ipad air } { platform:ios simulator, id:224533ed-94da-46cc-b1db-1781a1c80710, os:8.1, name:ipad retina } { platform:ios simulator, id:d114bc7e-a913-4063-a349-c119bafc06da, os:8.1, name:iphone 4s } { platform:ios simulator, id:7af6d6f4-c6bc-4a47-b83c-3a4b43abe0dd, os:8.1, name:iphone 5 } { platform:ios simulator, id:be82d607-466a-43e5-863d-6a05f217c117, os:8.1, name:iphone 5s } { platform:ios simulator, id:0afcc9ab-7c59-48c7-9bfb-fbf4865b7a63, os:8.1, name:iphone 6 plus } { platform:ios simulator, id:d183ff05-3023-4fb5-bea0-290ea881040a, os:8.1, name:iphone 6 } { platform:ios simulator, id:26038dbd-791c-421e-99f4-9153ca726a2f, os:8.1, name:resizable ipad } { platform:ios simulator, id:31b2f0ae-3547-4189-a561-cd2088f6c645, os:8.1, name:resizable iphone }

but when same on jenkins, list empty.

i'm using xcode version 6.1 (6a1052d) on both local , jenkins, schemes shared can see them in gui when launch on jenkins. i'm not sure if it's relevant, i'm using workspace cleanup plugin , remove derived info before build on jenkins.

edit: discovered when prepending destination value generic/ proper simulator list on jenkins, still complains couldn't find simulator run on, though 1 used on list:

xcodebuild test -workspace myapp.xcworkspace -scheme myscheme -destination 'generic/platform=ios simulator,name=iphone 6,os=8.1'

xcodebuild: error: unable find destination matching provided destination specifier: { platform:ios simulator, os:8.1, name:iphone 6 }

the requested device not found because no available devices matched request.

available destinations "myscheme" scheme: { platform:ios simulator, id:20d0a659-a25a-40e1-9c11-fc6eca004012, os:8.1, name:ipad 2 } { platform:ios simulator, id:7b5df104-be34-415f-8818-3907b6cb9c63, os:8.1, name:ipad air } { platform:ios simulator, id:2ddf024e-811d-4d93-bd8e-ef34bfc9d8ca, os:8.1, name:ipad retina } { platform:ios simulator, id:ffe95d35-b9dd-449e-83d0-50777bf5b783, os:8.1, name:iphone 4s } { platform:ios simulator, id:ef5a0d8a-6a1f-492c-b451-8f3b8b5ec5ee, os:8.1, name:iphone 5 } { platform:ios simulator, id:a1fcf8da-bd9f-4abc-8e0a-4b8547362274, os:8.1, name:iphone 5s } { platform:ios simulator, id:1b75e350-7fc8-4407-8116-f3674f3ac187, os:8.1, name:iphone 6 plus } { platform:ios simulator, id:694caa87-765d-4fdf-8b27-75e5b537f48e, os:8.1, name:iphone 6 } { platform:ios simulator, id:ff5588c0-14b5-4303-a2ac-9acf63b1852c, os:8.1, name:resizable ipad } { platform:ios simulator, id:e402c9c9-97ba-4909-96b3-3d3c7f6ccc3b, os:8.1, name:resizable iphone }

build step 'execute shell' marked build failure

finished: failure

turns out jenkins using user didn't have plenty permissions. figured out when created job , tried sign archive. default, jenkins uses 'jenkins' user stuff, if ssh or screen share build server other user, screwed. decided remove jenkins daemon , instead utilize jenkinsapp.

ios xcode unit-testing command-line jenkins

No comments:

Post a Comment