OlivierLDff / QtIosCMake

📱 Deploy Qt Application for iOS with a single macro when using CMake.
BSD 3-Clause "New" or "Revised" License
58 stars 15 forks source link

Add support for Free Apple development certificates #23

Open sufuk opened 2 years ago

sufuk commented 2 years ago

Apple now allows Free Developer accounts to flash their apps to real iphones (app certificate will be valid for only 7 days) . If I try to build I get ;

error: No account for team "123456789A". Add a new account in the Accounts preference pane or verify that your accounts have valid credentials. (in target 'MyApp' from project 'MyApp') error: No profiles for 'MyApp.MyApp' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'MyApp.MyApp'. (in target 'MyApp' from project 'MyApp')

But after that if I launch the MyApp.xocdeproj with XCode and go to Signing & Capabilities and check "Automatically signing" and select Team as Personal Team it works.

It will be avesome if this will automated too

OlivierLDff commented 2 years ago

Interesting news. I won't have time to work on that, but you can have a look around here: https://github.com/OlivierLDff/QtIosCMake/blob/c5a541eddf25554c300f316c48a1021866b1b2a1/AddQtIosApp.cmake#L383-L392 If you find how to automate that, I think that would be interesting for lots of people, wanting to play around and test Qt for iOs development. I can help you if you want to make a PR.

sufuk commented 2 years ago

It seems your utility already supports this, by just specifying team id; Don't try to add Signing Identity it doesn't needed in this case

    include(QtIosCmake/AddQtIosApp.cmake)
    add_qt_ios_app(${PROJECT_NAME}
            TEAM_ID "***********")

But apple doesn't show TEAM_ID to free users directly. Normally the one can look it it from Apple Developer Website but if you don't have an paid membership it doesn't show you. However you can find it from keychain app; just open keychain select login then certificates then find the Certifiacte you created before from xcode; Right click into it and under find the first Organizational Unit that is your Team id (The one with hided with red mark below) test

Congratss youre done you can start building normally. Dont forget to create new certificates every 7 days.!!

Important Note!! If you connect your macos over ssh or something else you might get an error like MyApp.app: errSecInternalComponent Command CodeSign failed with a nonzero exit code Unfortunatly this is a common problem in codesign there are many suggested solutions on the web but none of them worked for me (may work on you) .

Dushistov commented 2 years ago

May be #6 is related. There was @OlivierLDff's idea to compare project "fixed by xcode" and original generated by cmake, but I received paid account , so this is become not important for me.

sufuk commented 2 years ago

May be #6 is related. There was @OlivierLDff's idea to compare project "fixed by xcode" and original generated by cmake, but I received paid account , so this is become not important for me.

Yeah actually it is related, for some reason apple doesn't allow you to see your Team id directly :). But it can be learn from key chain explained above.

OlivierLDff commented 2 years ago

Would you consider doing a PR to add your explaination to Readme for the next person looking for its TEAM_ID ?