Ios app signing with cocos 3.16 and xcode 9

Hi, while signing ios application I met following error :

cocos compile -s Project/MyProject -p ios -m release --sign-identity “iPhone Distribution”

xcodebuild; error: The flag -scheme is required when specifying -archivePath but not -exportArchive
Error running command, return code 65

cocos 3.16. xcode 9.0. The same error occurred if run xcodebuild directly:

xcodebuild -project MyProject.xcodeproj -configuration Release -target “MyProject-mobile” -sdk iphoneos CONFIGURATION_BUILD_DIR="" CODE_SIGN_IDENTITY=“iPhone Distribution” -archivePath path/MyProject.xarchive archive

xcodebuild; error: The flag -scheme is required when specifying -archivePath but not -exportArchive
Error running command, return code 65

Is this is a known problem ?

@slackmoehrle @nite

I see in cocos 3.16 changelog that it was fixed? But we still getting this error - could you please give solution?

I think it is related to xcode 9.1 as I’m testing with it, you probably fiexed something for 8.x but not 9.x

For now in file:

plugin_compile/project_compile.py on line 799 I replaced

"-scheme" if self.cocoapods else "-target",

to

"-scheme" if self.cocoapods else "-scheme",

Let see if it helps

UPDATE:

Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}"

got until this, will try to pass it to build

I wonder why this needed? Just create archive using Xcode is never been easy and simple and without problems.

oh no, this is used for autocompile servers usually, that why manual archive doesn’t work and cocos comand was very simple to setup.

Autocompile for what?

for IOS project

What reason to compile using command line? What purpose?

Ther purpose is to automate building process.

I’m really interested in all this process and how it helps. So, you have builded ipa and what next? Can you describe all processes.

There could be many scenarious of what to do next. It is not clear for me what really you are asking.

f.e. next could be submit created .ipa to ItunesConnect.

Submit via what app? Or method?
I just askin how you do this exactly, and so why you need to built from command line.

Submit through the web-interface of ItunesConnect. Not through some app. Manually.

That’s interesting and do you do that? I can find any options for that.

I wrote incorrectly - Submit to ItunesConnect through XCode or ApplicationLoader.

So thats why I’ve started to ask you first about this. Why you don’t just use Xcode and after compiling it will usefully suggest you to upload .ipa right after.
It’s like typical was build fro android using command line, but for iOS it’s nonsense as for me… however, if there can be done some automation, like some script time to time builds and sends .ipa to iTunes and after it processed - assign this new build for specified testers group. I would like to know about that…

I do not know how fully automate following : build .ipa using scripts, send .ipa to iTunes, and then assign new build for specified testers group. If that is possible - I also would be interested in it…
But the fact that builded .ipa should be manually loaded to iTunesConnect through ApplicationLoader does not mean that previous steps could not be automated. Having script which build and signs .ipa allows to do less work for sending it to iTunesConnect. it also allows to automatically build and sign .ipa once and then do something with this .ipa. f.e. load to iTunes, store in version database, send to somebody…

Regarding our scenario, we using Teamcity there is also possibility to use Jenkins software - this process is called continuous integration - when developer makes commit to git, Teamcity automatically getting code from git and starting compile build, when build compiled it get uploaded to diawi or hockeyapp for test. So it is very usseful to test new builds, no need to ask dev to compile it for me it is done automaticly. So this cocos compile was very usseful to launch thru teamcity to get ipa or apk.

I am having a code sign issue too, personally. We should look into this more.

Hi, will someone will look into this?

So far it seems there was changes on Apple side compile/signing process for xcode 8.3+ and then for xcode 9.x

if using cocos2d-x 3.15 there is possibility to copy utility “PackageApplication” to xcode package and then it will work like before.

In cocos2d-x 3.16 devs changed console to support xcode 8.3 , but this change doesn’t work with xcode 9.1, so there should something done else. From what I see xcode changed where is stored info about build and auto signing looks also works differently now.