[Interest] Building iOS from command line

Jérôme Godbout godboutj at amotus.ca
Thu Jun 18 23:24:46 CEST 2020


I did try to use the command line on my local checkout (was open and configured into QtCreator) to see if the Qmake command line would generate the same thing as the GUI, it does generate the same thing, so the fact of opening the .pro and selecting ios configuration change the output of building for iOS.

A fresh checkout without .pro.user doesn’t give the same output. There is nothing into the .user that I can see that could do such a thing, I’m a bit lost why this is happenning!? QtCreator is configuring something when opening the .pro that is missing from the command line…

Is there a way to output the resulting Info.plist with replacement.  Is this the proper way to set the Info.plist:

From my .pro:
Q_PRODUCT_BUNDLE_IDENTIFIER.value = ca.amotus.NubitusApp
From my ios .pri (I use the same .pri for all iOS application):
DISTFILES += ios/Info.plist
Q_PRODUCT_BUNDLE_IDENTIFIER.name = PRODUCT_BUNDLE_IDENTIFIER
QMAKE_MAC_XCODE_SETTINGS += Q_PRODUCT_BUNDLE_IDENTIFIERQMAKE_INFO_PLIST = ios/Info.plist

Damn, I revert my local modification and folder with a
git clean -dfx

Now the bundle identifier is
ca.amotus.testdev.NubitusApp

?!? where does this come from? how does QMake generate the bundle identifier for the .xcodeproj exactly? it doesn’t seem to take the Info.plist entry, doesn’t seem to use the Q_PRODUCT_BUNDLE_IDENTIFIER either with QMAKE_MAC_XCODE_SETTINGS. Note sure if this is normal, but the Info.plist is not copied to the generate folder.  Damn this is painful. Can we just copy an Info.plist next to the .xcodeproj ? would that be considered by xcode to build the project?


From: Interest <interest-bounces at qt-project.org> On Behalf Of Jérôme Godbout
Sent: June 18, 2020 4:49 PM
To: Boris Ralchenko <bralchenko at ics.com>
Cc: interest at qt-project.org
Subject: Re: [Interest] Building iOS from command line

I have try to replace the bundle id directly into the .plist:

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

by

<key>CFBundleIdentifier</key>
<string>ca.amotus.NubtisuApp</string>

But the resulting xcode project is still got replaced by com.yourcompany.NubitusApp, now that is strange, so the .pro value have no impact and something is just kind of replacing the value to this com.yourcompany.(Application Name). If I open the xcodeproject I can see that replaced value. I have no idea where it’s coming from. Anybody have an idea for this?

From: Boris Ralchenko <bralchenko at ics.com<mailto:bralchenko at ics.com>>
Sent: June 18, 2020 3:09 PM
To: Jérôme Godbout <godboutj at amotus.ca<mailto:godboutj at amotus.ca>>
Cc: interest at qt-project.org<mailto:interest at qt-project.org>
Subject: Re: [Interest] Building iOS from command line

I do have the bundle ID specified explicitly in the Info.plist.

I prefer Xcode for debugging/packaging. It appears to be more efficient way when I needed to figure out command line build, less tools to take care of. It is possible that QtCreator GUI has something that command line tools have not.

      <key>CFBundleIcons~ipad</key>
      <dict/>
      <key>CFBundleIdentifier</key>
      <string>com.viewpoint.kiosk</string>
      <key>CFBundleInfoDictionaryVersion</key>
      <string>6.0</string>
      <key>CFBundleName</key>
      <string>ViewPoint</string>
      <key>CFBundlePackageType</key>
      <string>APPL</string>
      <key>CFBundleShortVersionString</key>
      <string>1.0</string>
      <key>CFBundleSignature</key>
      <string>com.viewpoint.kiosk</string>
      <key>CFBundleVersion</key>
      <string>1.0</string>

Regards,
    Boris Ralchenko.




On Jun 18, 2020, at 2:58 PM, Jérôme Godbout <godboutj at amotus.ca<mailto:godboutj at amotus.ca>> wrote:

Hi,
I have an Info.plist that I have into my project. I have the following entry into my Info.plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>CFBundleDisplayName</key>
         <string>${PRODUCT_NAME}</string>
         <key>CFBundleExecutable</key>
         <string>${EXECUTABLE_NAME}</string>
         <key>CFBundleGetInfoString</key>
         <string>Created by Qt/QMake</string>
         <key>CFBundleIdentifier</key>
         <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
         <key>CFBundleName</key>
         <string>${PRODUCT_NAME}</string>
         <key>CFBundlePackageType</key>
         <string>APPL</string>
    ...
</dict>

From my .pro:
Q_PRODUCT_BUNDLE_IDENTIFIER.value = ca.amotus.NubitusApp
From my ios .pri (I use the same .pri for all iOS application):
DISTFILES += ios/Info.plist
Q_PRODUCT_BUNDLE_IDENTIFIER.name = PRODUCT_BUNDLE_IDENTIFIER
QMAKE_MAC_XCODE_SETTINGS += Q_PRODUCT_BUNDLE_IDENTIFIERQMAKE_INFO_PLIST = ios/Info.plist

I was guessing the replacement should have happen. or does the above variables only work when inside QtCreator GUI?


From: Boris Ralchenko <bralchenko at ics.com<mailto:bralchenko at ics.com>>
Sent: June 18, 2020 2:46 PM
To: Jérôme Godbout <godboutj at amotus.ca<mailto:godboutj at amotus.ca>>
Cc: interest at qt-project.org<mailto:interest at qt-project.org>
Subject: Re: [Interest] Building iOS from command line

Hi Jérôme,

We have a separate Info.plist for command line build, it should solve the bundle ID issue. I don’t remember exactly the details, it was couple of years ago. But I did check - there is an Info.plist in the repository. I suspect Qt Creator generates one too, but I rely on the one from Xcode.

Regards,
    Boris Ralchenko.





On Jun 18, 2020, at 2:30 PM, Jérôme Godbout <godboutj at amotus.ca<mailto:godboutj at amotus.ca>> wrote:

Hi,
I’m trying to build my project from my CI system to generate the .ipa (and stop releasing by hand over. But I seem to be missing something into my way of doing it (I managed to do it for Android, armv7/armv8 .apk and .aab). Here is my steps raw command line steps (not the provisioning, certificate and the keychain are installed and work with a Xamarin and Unity application with the same setup, the question is not about those parts).

I’m building on lastest MacOS X, xcode is up to date and Qt 5.15.0


"/Users/Shared/Qt/5.15.0/ios/bin/qmake" Nubitus.pro -spec macx-ios-clang CONFIG+=release CONFIG+=iphoneos CONFIG+=device CONFIG+=qtquickcompiler -after

make -f Makefile qmake_all

make

The Qmake generate the makefile, make qmake_all work just fine, but the make build give me the following error:

Xcode couldn't find any iOS App Development provisioning profiles matching 'com.yourcompany.NubitusApp'

but my .pro clearly indicate

Q_PRODUCT_BUNDLE_IDENTIFIER.value = ca.amotus.NubitusApp

When building from inside QtCreator this work and the provisioning is also working just fine. so my question: Why is the build any different? is QtCreator doing any extra steps not print into the output? is there any env variables required for Q_PRODUCT_BUNDLE_IDENTIFIER to be used? Did I miss a step?!

Extra points question: will this generate an .ipa or .app ? How does one generate a .ipa from the command lines out of the result build by Qt make?

Thanks,

_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
https://lists.qt-project.org/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200618/7bd77f68/attachment.html>


More information about the Interest mailing list