[TIMOB-24565] iOS CLI: Improve the way dist-appstore build works
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-04-14T21:38:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | CLI |
Labels | cli, ios, titanium, xcode8.3 |
Reporter | Uriel Lizama |
Assignee | Chris Barber |
Created | 2017-04-07T14:20:56.000+0000 |
Updated | 2017-05-09T23:04:31.000+0000 |
Description
First some background. I created [TiFastlane](https://github.com/ulizama/TiFastlane) as a way to be able to use [Fastlane](https://fastlane.tools/) with Titanium development. To be able to use Fastlane when archiving a build it needs to be into an .ipa archive, the way I used to do that is by a small hack, using Create the .archive:
Use the XCode exporter to export the archive into an ipa
I tested this manually and it works, but there are some issues I'm encountering to be able to have this work as real CLI option.
*Missing method export option in the plist*
The plist generated by the CLI is missing the method, which then has xcodebuild fail when doing the export because it defaults to development so the code signing is wrong. To fix this the correct method needs to be present in the plist:
dist-adhoc
with an App Store profile. This worked until XCode 8.3 in which the Legacy API was disabled.
This puts me in the current situation to which I need some assistance.
The way I'm looking to solve it is to:
Create the .archive: appc run -p ios -T dist-appstore
Use the XCode exporter to export the archive into an ipa xcodebuild -exportArchive -archivePath "~/Library/Developer/Xcode/Archives/2017-04-06/My App 2017-04-06 10-24-57.xcarchive" -exportPath "./dist" -exportOptionsPlist "./build/iphone/Info.plist"
I tested this manually and it works, but there are some issues I'm encountering to be able to have this work as real CLI option.
*Missing method export option in the plist*
The plist generated by the CLI is missing the method, which then has xcodebuild fail when doing the export because it defaults to development so the code signing is wrong. To fix this the correct method needs to be present in the plist:
<key>method</key>
<string>app-store</string>
This issue doesn't happen on 6.0.1.GA, only in the latest version.
*XCode Archiver Launch*
The other issue is that when the dist-appstore
build finishes, it automatically tries to launch the XCode archive manager. This makes it necessary to have an extra human intervention in the step, which breaks the whole automatic process.
It would be great if we could have a way to override that feature, so that when the build finishes it doesn't do anything else.
I'm more than willing to help out in doing changes or tests on the CLI to achieve this, but this is my first time hacking the Ti CLI so I'm a bit lost on what goes where.
Aside from these fixes, it might be worth it to add a --export-ipa
option on the build process so that the CLI automatically does the second step of calling the exporter so we end up with an ipa ready to use for the App Store.
For the missing method, couldn't you just add it in [here](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L3781) by checking the deployment-target and do something like
plist.method = "app-store"
(or what ever target is selected). For the Archiver launch, does--build-only
not work? Thanks!PR: https://github.com/appcelerator/titanium_mobile/pull/8954
6_1_X backport: https://github.com/appcelerator/titanium_mobile/pull/8966
Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.0 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.0.v20170509114242 Appcelerator Studio, build: 4.8.1.201612050850 Xcode 8.3.2 Tested with the above environment. I first created an app, and built to the app-store with
XCode launched and opened the archive manager. I then tried:
In this case a .ipa file was created on the Desktop, and XCode did not launch. This is expected behavior.