iOS Question Local Builder: "codesign wants to access key 'B4i' in your keychain"

Sandman

Expert
Licensed User
Longtime User
My setup:
- A fully updated Mac Mini, running 12.2.1
- Build server 7.5
- Java JDK 8 (because I couldn't understand how to install OpenJDK in the instructions)
- Xcode 13.2.1 (I've run it, and it has installed all it wanted to)
- A project that compiles fine in the hosted builder

When I try to compile a project using this local builder, this pops up in the mac, stopping the compilation:
1646230693354.png


Apparantly I'm not the first one to get that message, and it seems people before me have figured out to solve it. But I have failed to find that solution in the forum. Can somebody please help me and explain what I should do?

(I've tried running the builder with sudo, but that gave a lot of other error messages in B4i.)
 

developer_123

Active Member
Licensed User
Longtime User
Good day. The same thing happens to me, the same password request, and I have already reinstalled everything and the same behavior continues. Erel I appreciate if you send me the updated builder.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
Good day. The same thing happens to me, the same password request, and I have already reinstalled everything and the same behavior continues. Erel I appreciate if you send me the updated builder.
Something very important that I forgot to mention. The reason I need to use a local builder is because of the size of my app (46MB and growing), the hosted builder fails to compile it and gives me a Communication Timeout error. Erel in another thread told me that a local constructor has no size limit, but I just tested with the simulator and it only allows me to compile small applications (I'm using lines, hello world, collisions, Mario, etc for testing), but when I try to compile my 46 MB app I get the Timeout warning again just like in the hosted builder.

Would this happen the same with the updated constructor ?

How do I manage to compile my application in the simulator for larger applications? The latter is very important to test if my application presents any difference on each iPhone device.
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
Does it ask for the password every compilation?
Yes, it does. (I'm now running the modified builder.)

So, after I enter the hard-coded password, it compiles fine. But the resulting binary doesn't work for my iPhone, which shows a dialog with something like "Couldn't install MyFineApp. Try again later. OK"

I cleaned the project, only changed to hosted builder - installed just fine.

Cleaned again, and switched back to the modified builder. Compiled fine after password, but refused to install.


It seems I'm not the only one with the modified builder, but it seems I'm the only one with this problem - have I missed or forgotten something obvious regarding running a local builder..?
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
No.

I should also mention that I have - perhaps foolishly, or not - spent the last hour on factory resetting and re-installing the Mac to deal with a previous issue. I'll report back here once I'm back up and running with it. I'll start with the standard local builder.
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
So, I nuked the mac and installed everything from scratch. I even managed to make a new Apple ID - amazing. I'm glad to say that the standard builder works just fine without asking for password. I should also mention that I switched to OpenJDK, if that's a factor. And for future generations, if you fail to run OpenJDK: Google Rosetta, it's crucial to make OpenJDK work on a mac with M1.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
So, I nuked the mac and installed everything from scratch. I even managed to make a new Apple ID - amazing. I'm glad to say that the standard builder works just fine without asking for password. I should also mention that I switched to OpenJDK, if that's a factor. And for future generations, if you fail to run OpenJDK: Google Rosetta, it's crucial to make OpenJDK work on a mac with M1.
Sandman, I'm glad it worked for you, however unfortunately for me it didn't. After reading your comments I just formatted 100% of my Mac with Monterrey 12.2.1 and the only thing I have done on the computer is to install OpenJdk (as I see it is the only difference with what I was doing), and I installed Xcode. My processor is older than M1. After executing Xcode and the constructor through the terminal, the exact same thing continues to happen. It keeps asking me for the password that I don't know. I really don't know what else to do, since I'm following each and every one of the steps to the letter. When I try to compile directly to my physical iPhone in B4i, a red bar appears with the legend COMMUNICATION ERROR Timeout, after this immediately on my Mac it asks me for the password that I don't have. However with the simulator if it works. Something curious that I must indicate is that when I select the simulator the Error Timeout legend also appears, but after approximately one minute in the Mac simulator the application appears installed and can be executed normally.

I would like to try the version of the constructor indicated by Erel which does not ask for the password, since I see that it is the only thing left for me to try.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
Sandman, Please let me know if, in addition to what you indicated in your comment, you made another change. Otherwise I would appreciate Erel sending me the version of the modified constructor where the password is set programmatically.
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
I followed the instructions, so I didn't pick the one with strike-through. I picked the one below that.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
Erel, with the adjusted version and the static key of the codesign, it already connects with my physical iphone. However, after the compilation, in B4i it shows me a successful compilation, and directs me to the manual installation, but on the screen of my iphone immediately instead of appearing the option to install a warning appears that says: "Unable to connect with: <builder ip>" .
Mac, iphone and Windows PC (B4i) are in the same local LAN network.
Reading your previous comments you say that AC2 must be installed with a Local Mac. I have already installed AC2 on my Mac, and the first step is to pair the device. The truth is that I am zero familiar with AC2 and searching the internet I have not been able to understand how to link it, since the examples I have found refer to connections with applications of specific brands and I have lost myself.
I appreciate your guidance on connecting to AC2 so I can finally use the local compiler.
 
Upvote 0

Steve Beer

Member
Licensed User
Longtime User
I have had a very similar problem, and have managed to get the app on the iPhone in a very convoluted way.

In case my solution helps anyone else or gives more of a clue as to why several of us seem to be having similar issues, My steps are as follows

1 - Load second partition on Mac with Monterey
2 - Install Java 8 JDK from Oracle web site
3 - Install XCode 13 from Apple App store
4 - Install B4iBuildserver (v7.5) from standard package
5 - Get updated B4XBuildServer.jar from Erel to overcome password issue and replace B4iBuildServer.Jar installed above
6 - Install Apple Configurator 2 on the Mac
7 - Start Configurator 2 and install the automation tools ( I did not need to Pair a device)
8 - Start B4iBuildServer as per the standard instructions
9 - Connect iPhone to Mac via USB Data Cable
10 - Answer question on iPhone confirming Mac is a trusted device, after which iPhone picture appears on the Configurator 2 Devices screen

Now came the tricky bit, as none of straight forward methods for getting the App onto the iPhone in a functioning state worked for me.

When I tried to install the app via the B4i Bridge, I got a grey Icon on the iPhone with the words "Waiting" underneath that never went away. If I clicked it, it just said can't install, try again later.

When I ticked the "Use Apple Configurator to Install" box on the Windows Build Server Settings screen, and tried to compile, I got an Icon on the iPhone, but selecting it produced a message saying "Could not install as the integrity could not be verified"

I found that when I got the various failure messages, an IPA file had actually been created on the Mac, so I thought I would try and use it anyway. Several combinations of attempts produced the same issues as above

I finally got the App installed by doing the following:

1 - From the B4i Tools Menu set Device IP Address to Simulator
2 - I then unticked the "Use Apple Configurator" box on the B4iBuildServer settings screen from the B4i Tools Menu
3 - From the B4i Tools Menu select BuildServer and then Build Bridge App (and watch it fail)
4 - Go to the Mac and right click on the image of the iPhone on Configurator 2 when a menu will appear
5 - Select Add then Apps.
6 - Press the button bottom left that says "Choose from my Mac"
7 - Navigate to the B4iBuildServer Folder, then the UploadedProjects subfolder and then the b4i_default subfolder
8 - I then found and selected the Builder ipa file and clicked Add
9 - The builder then successfully installed on the iPhone

Then to install my application, I did the following

1 - Start B4i Bridge on the iPhone
2 - From the B4i Tools Menu set Device IP Address to the IP of my iPhone
3 - Selected "Build Release App" from B4i Tools / Build Server menu
4 - When complete I get a message asking for the Bridge to be connected (which it already was). I just ignored this
5 - I then went back to the Mac and followed steps 4 - 9 above, this time selecting my Apps ipa file
6 - My app then successfully installed on the iPhone.

I am sure this is not the way it should work, but so far this is the only method I have found that does actually get a working app onto my iPhone.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
I have had a very similar problem, and have managed to get the app on the iPhone in a very convoluted way.

In case my solution helps anyone else or gives more of a clue as to why several of us seem to be having similar issues, My steps are as follows

1 - Load second partition on Mac with Monterey
2 - Install Java 8 JDK from Oracle web site
3 - Install XCode 13 from Apple App store
4 - Install B4iBuildserver (v7.5) from standard package
5 - Get updated B4XBuildServer.jar from Erel to overcome password issue and replace B4iBuildServer.Jar installed above
6 - Install Apple Configurator 2 on the Mac
7 - Start Configurator 2 and install the automation tools ( I did not need to Pair a device)
8 - Start B4iBuildServer as per the standard instructions
9 - Connect iPhone to Mac via USB Data Cable
10 - Answer question on iPhone confirming Mac is a trusted device, after which iPhone picture appears on the Configurator 2 Devices screen

Now came the tricky bit, as none of straight forward methods for getting the App onto the iPhone in a functioning state worked for me.

When I tried to install the app via the B4i Bridge, I got a grey Icon on the iPhone with the words "Waiting" underneath that never went away. If I clicked it, it just said can't install, try again later.

When I ticked the "Use Apple Configurator to Install" box on the Windows Build Server Settings screen, and tried to compile, I got an Icon on the iPhone, but selecting it produced a message saying "Could not install as the integrity could not be verified"

I found that when I got the various failure messages, an IPA file had actually been created on the Mac, so I thought I would try and use it anyway. Several combinations of attempts produced the same issues as above

I finally got the App installed by doing the following:

1 - From the B4i Tools Menu set Device IP Address to Simulator
2 - I then unticked the "Use Apple Configurator" box on the B4iBuildServer settings screen from the B4i Tools Menu
3 - From the B4i Tools Menu select BuildServer and then Build Bridge App (and watch it fail)
4 - Go to the Mac and right click on the image of the iPhone on Configurator 2 when a menu will appear
5 - Select Add then Apps.
6 - Press the button bottom left that says "Choose from my Mac"
7 - Navigate to the B4iBuildServer Folder, then the UploadedProjects subfolder and then the b4i_default subfolder
8 - I then found and selected the Builder ipa file and clicked Add
9 - The builder then successfully installed on the iPhone

Then to install my application, I did the following

1 - Start B4i Bridge on the iPhone
2 - From the B4i Tools Menu set Device IP Address to the IP of my iPhone
3 - Selected "Build Release App" from B4i Tools / Build Server menu
4 - When complete I get a message asking for the Bridge to be connected (which it already was). I just ignored this
5 - I then went back to the Mac and followed steps 4 - 9 above, this time selecting my Apps ipa file
6 - My app then successfully installed on the iPhone.

I am sure this is not the way it should work, but so far this is the only method I have found that does actually get a working app onto my iPhone.
Steve, thanks for your response. I will drink a coffe while try all these steps. I will be reporting.
 
Upvote 0

developer_123

Active Member
Licensed User
Longtime User
Hello everyone! Well, after spending a long, long, long time trying to get the local constructor to work, I finally got it. For some strange reason, every time I tried it from scratch, new errors appeared and everything seemed like chaos. Inlcusive I tried with virtual machines. However, another Macbook Pro arrived to me this morning, which was clean, just as it came from the factory. In this Macbook Pro, I performed the steps for the hundredth time and it worked like this:

1. Mac running Monterey 12.3.
2. I installed on this computer Java 1.8.0_202 (the file to download usually has this name JDK-8U202-macosx-x64 ).
3. I installed Xcode 13.3.
4. I installed Apple Configurator 2.15.1. Within Apple Configurator I installed the Automation Tools found in the top bar in the menu with the same name "Apple Configurator".
5. I unzipped and using TERMINAL found the builder folder and ran "java -jar B4iBuildServer.jar"
(The constructor that I used is the one that Erel sends in the initial mail. In this occasion, by magic, it did not ask me for a password. Strangely, the modified version that Erel sends that should solve the problem of the password, in this occasion I had drawbacks).
6. I connected by USB cable my Iphone to the Local MAC, which is automatically paired with the Apple Configurator. The iPhone image should appear in the local Mac's Apple configurator. If it's not wired with USB it won't work.
7. From the WINDOWS computer where I have B4i installed, I disabled the FireWall.
8. You must have all the previously mentioned applications open on the Local Mac simultaneously.
9. From B4i in the server configuration of the tools menu, I disabled the Hosted Builder boxes, and in the server IP I put the IP of the Local Mac. I checked the "Use Apple settings for installation" box.
10. I open b4i bridge from my iphone. From B4i clic in compile application release and Compilation successful!!!!

NOTE: It is important to indicate that at the end of the compilation from B4i, it shows an error message, indicating time out, as if it had not worked, but if you go to the iphone after about 20 seconds, you can see that the application is being installed correctly.

I hope these steps be of help to the person who presents the same inconvenience, since it took me too long, a long time, and I repeat, a long time to achieve it.


Erel It would be nice to update the instructions, since you don't name the Apple Configurator steps or automation tools, or that it should be connected with a USB cable. Since the hosted compiler does the installation wirelessly, it's normal to mistakenly assume that the local Mac will do the same. In my case it was mandatory to use the USB cable for it to work.
 
Last edited:
Upvote 0
Top