How to archive a browser app base on Chromium for iOS to AppStore?

616 views
Skip to first unread message

watsons...@gmail.com

unread,
Sep 10, 2018, 12:29:57 PM9/10/18
to Chromium-dev
Recently, I want to up a browser app base on Chromium for iOS to AppStore.  But chromium uses ninja to bulid , i don’t find the way to archive ipa to AppStore.  So,if anybody knows the way. Could you tell me? Thanks a lot.

Sylvain Defresne

unread,
Sep 11, 2018, 4:27:31 AM9/11/18
to chromi...@chromium.org
An ipa is an archive using the zip file format and known content. To create it, you create a temporary directory, put the files with expected names and content in it, use zip to create the archive and change the extension to ipa from zip.

You can get more information about the content on this wikipedia article.
-- Sylvain

On Mon, Sep 10, 2018 at 6:29 PM <watsons...@gmail.com> wrote:
Recently, I want to up a browser app base on Chromium for iOS to AppStore.  But chromium uses ninja to bulid , i don’t find the way to archive ipa to AppStore.  So,if anybody knows the way. Could you tell me? Thanks a lot.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/2ef8a616-5444-4d72-86b3-8566f026fc5d%40chromium.org.

watsons...@gmail.com

unread,
Sep 11, 2018, 4:51:16 AM9/11/18
to Chromium-dev
Sorry, maybe i don’t make the question clear. My problem is I want to upload my app what is base on Chromium for iOS to app store, but chromium uses ninja to build. I can't use the 'Product -> Archive' to archive my app. When I use 'Product -> Archive' , xcode tell me that 'No such file'. 
在 2018年9月11日星期二 UTC+8下午4:27:31,Sylvain Defresne写道:

Sylvain Defresne

unread,
Sep 11, 2018, 5:38:57 AM9/11/18
to chromi...@chromium.org
You just need to create a zip file from the command-line and then rename it to ipa.

You can probably use the following commands (untested):
$ ninja -C out/Official-iphoneos chrome
$ mkdir temp
$ rm -rf temp/*
$ mkdir temp/Payload
$ cp out/Official-iphoneos/Chromium.app temp/Payload
$ cd temp
$ zip -r ../MyBrowser.zip .
$ cd ..
$ mv MyBrowser.zip MyBrowser.ipa
-- Sylvain

watsons...@gmail.com

unread,
Sep 11, 2018, 5:46:35 AM9/11/18
to Chromium-dev
When I use  ninja -C out/Official-iphoneos chrome , the terminal shows the message:

FAILED: build.ninja 

/Users/admin/Desktop/depot_tools/gn --root=/Users/admin/Desktop/Chromium_iOS/src -q --check gen //out/Official-iphoneos

ERROR at //build/config/ios/ios_sdk.gni:100:21: Script returned non-zero exit code.

  _ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")

                    ^----------

Current dir: /Users/admin/Desktop/Chromium_iOS/src/out/Official-iphoneos/

Command: python -- /Users/admin/Desktop/Chromium_iOS/src/build/config/mac/sdk_info.py iphoneos

Returned 1.

stderr:


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):

  File "/Users/admin/Desktop/Chromium_iOS/src/build/config/mac/sdk_info.py", line 70, in <module>

    FillXcodeVersion(settings)

  File "/Users/admin/Desktop/Chromium_iOS/src/build/config/mac/sdk_info.py", line 26, in FillXcodeVersion

    lines = subprocess.check_output(['xcodebuild', '-version']).splitlines()

  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output

    raise CalledProcessError(retcode, cmd, output=output)

subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1


See //remoting/remoting_enable.gni:9:3: whence it was imported.

  import("//build/config/ios/ios_sdk.gni")

  ^--------------------------------------

See //BUILD.gn:20:1: whence it was imported.

import("//remoting/remoting_enable.gni")

^--------------------------------------

ninja: error: rebuilding 'build.ninja': subcommand failed


What's wrong with my code so that it shows that wrong message?
在 2018年9月11日星期二 UTC+8下午5:38:57,Sylvain Defresne写道:

Sylvain Defresne

unread,
Sep 11, 2018, 9:37:41 AM9/11/18
to chromi...@chromium.org
On Tue, Sep 11, 2018 at 11:47 AM <watsons...@gmail.com> wrote:
When I use  ninja -C out/Official-iphoneos chrome , the terminal shows the message:

FAILED: build.ninja 

/Users/admin/Desktop/depot_tools/gn --root=/Users/admin/Desktop/Chromium_iOS/src -q --check gen //out/Official-iphoneos

ERROR at //build/config/ios/ios_sdk.gni:100:21: Script returned non-zero exit code.

  _ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")

                    ^----------

Current dir: /Users/admin/Desktop/Chromium_iOS/src/out/Official-iphoneos/

Command: python -- /Users/admin/Desktop/Chromium_iOS/src/build/config/mac/sdk_info.py iphoneos

Returned 1.

stderr:


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


From this error message, I get the impression that you have not correctly configured Xcode to be available from the command-line. Have you followed the instruction to build Chromium on iOS as found at https://chromium.googlesource.com/chromium/src/+/master/docs/ios/build_instructions.md.
-- Sylvain
 

watsons...@gmail.com

unread,
Sep 11, 2018, 11:03:35 PM9/11/18
to Chromium-dev
Indeed, I don't correctly configured Xcode's path, so that it can not to be available from the command-line, orz. Now, I correct it. But it shows me a new wrong message. Like below:

ERROR at //build/util/branding.gni:26:11: Script returned non-zero exit code.

_result = exec_script("version.py",

          ^----------

Current dir: /Users/admin/Desktop/Chromium_iOS/src/out/Official-iphoneos/

Command: python -- /Users/admin/Desktop/Chromium_iOS/src/build/util/version.py -f ../../chrome/app/theme/google_chrome/BRANDING -t full_name = "@PRODUCT_FULLNAME@" short_name = "@PRODUCT_SHORTNAME@" bundle_id = "@MAC_BUNDLE_ID@" creator_code = "@MAC_CREATOR_CODE@" installer_full_name = "@PRODUCT_INSTALLER_FULLNAME@" installer_short_name = "@PRODUCT_INSTALLER_SHORTNAME@" 

Returned 1.

stderr:


Traceback (most recent call last):

  File "/Users/admin/Desktop/Chromium_iOS/src/build/util/version.py", line 170, in <module>

    sys.exit(main())

  File "/Users/admin/Desktop/Chromium_iOS/src/build/util/version.py", line 143, in main

    values = fetch_values(options.file, options.official)

  File "/Users/admin/Desktop/Chromium_iOS/src/build/util/version.py", line 50, in fetch_values

    fetch_values_from_file(values, file_name)

  File "/Users/admin/Desktop/Chromium_iOS/src/build/util/version.py", line 25, in fetch_values_from_file

    for line in open(file_name, 'r').readlines():

IOError: [Errno 2] No such file or directory: '../../chrome/app/theme/google_chrome/BRANDING'


See //ui/base/BUILD.gn:10:1: whence it was imported.

import("//build/util/branding.gni")

^---------------------------------

See //BUILD.gn:72:5: which caused the file to be included.

    "//ui/base:ui_base_unittests",

    ^----------------------------

ninja: error: rebuilding 'build.ninja': subcommand failed


It seems like that is related to src/build/util/version.py, but I can't find what's wrong.


在 2018年9月11日星期二 UTC+8下午9:37:41,Sylvain Defresne写道:

Sylvain Defresne

unread,
Sep 12, 2018, 7:56:14 AM9/12/18
to chromi...@chromium.org
Ah, this is because the args.gn file generated by setup-gn.py for Official-iphoneos sets both is_official_build and is_chrome_branded to true. You don't want the second (as you do not have access to Google branded resources). So run "gn args out/Official-iphoneos" and change is_chrome_branded to false.
-- Sylvain

watsons...@gmail.com

unread,
Sep 13, 2018, 7:01:45 AM9/13/18
to Chromium-dev
Thank you so much for your help,now I can build official version. Though I don't know if I can succeed in uploading my app to app store. But  I still wish you happiness every day!  
 
在 2018年9月12日星期三 UTC+8下午7:56:14,Sylvain Defresne写道:

Feng Ao

unread,
Jul 2, 2019, 12:25:49 PM7/2/19
to Chromium-dev
By your advise, I have set the xcode path where my Xcode's real location.

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


But get this same error.

Current dir: /Users/username/Project/cronet/cronet_ios/src/out/Cronet/
Command: python /Users/username/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py --get_sdk_info iphonesimulator
Returned 1.
stderr:

Traceback (most recent call last):
  File "/Users/username/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 106, in <module>
    FillXcodeVersion(settings, args.developer_dir)
  File "/Users/username/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 58, in FillXcodeVersion
    settings['xcode_version'] = FormatVersion(lines[0].split()[-1])
  File "/Users/username/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 42, in FormatVersion
    major, minor, patch = SplitVersion(version)
  File "/Users/username/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 29, in SplitVersion
    version = version.split('.')
TypeError: a bytes-like object is required, not 'str'

See //remoting/remoting_enable.gni:8:3: whence it was imported.
  import("//build/config/ios/ios_sdk.gni")
  ^--------------------------------------
See //BUILD.gn:22:1: whence it was imported.
import("//remoting/remoting_enable.gni")
^--------------------------------------


在 2018年9月11日星期二 UTC+8下午9:37:41,Sylvain Defresne写道:

M shauket

unread,
Jul 4, 2019, 2:07:10 AM7/4/19
to Chromium-dev
Definitely Apple will reject your application with many reasons, first of all, Chromium code using some private API that prohibited by apple to use in your application. The 2nd reason is if you have integrated any swift code library your app will not approve you need to add swift support for your binary. I did a lot of changes and now I can upload to app store and apple approved without any issue raised.

Tuan Nomoty

unread,
Sep 11, 2023, 2:49:29 PM9/11/23
to Chromium-dev, M shauket
Hi I've got the same issue when I enable is_chrome_branded=true 

No such file or directory: '../../chrome/app/theme/google_chrome/BRANDING'

But if I disable is_chrome_branded = false, Apple rejected my upload because of the private Apple APIs.

Can anyone helpme out?

M shauket

unread,
Sep 18, 2023, 4:43:58 AM9/18/23
to Tuan Nomoty, Chromium-dev
Hi Tuan,

Can you share which specific private Apple api usage error you got from apple?
Reply all
Reply to author
Forward
0 new messages