iOS Tutorial Installing B4i-Bridge and debugging first app

Status
Not open for further replies.
B4i-Bridge is an application that you install on the device.
It has three purposes:
1. Launch the installation process when needed. This step is done with Apple Configurator 2 if using a local builder (https://www.b4x.com/android/forum/threads/installing-apps-with-apple-configurator-2.128397/).
2. Run the installed app (when installation is not needed).
3. The bridge is also the WYSIWYG visual designer.
4. Starting from iOS 16 you need to enable developer mode under: Settings - Privacy & Security -> Developer Mode

You need to install B4i-Bridge once. It is done from the device browser.


This video tutorial shows the steps required in order to install B4i-Bridge.

The important steps are:
- Set the package name based on the provision app id.
- Build B4i-Bridge: Tools -> Build Server -> Build B4i-Bridge
- Open mobile Safari and navigate to the link displayed in the compilation window.
- Install B4i-Bridge and run it.



Transcript:
1. Create a new project and save it.
2. Set the package name based on the provision app id (Project - Build Configurations).
3. Tools - Build Server - Build B4i-Bridge app.
4. The compilation dialog will show the link that you need to enter in the device browser.
5. Click on the Install button and confirm the installation.
6. Press on the Home key. B4i-Bridge app should be installed.
7. Start B4i-Bridge. A message with the ip address will be displayed.
8. Set this address in the IDE under Tools - Device IP Address.
9. Run the program. Approve the installation on the device and click on the new installed app.


Note that this is a real device. Not an emulator.

Tips:

- B4i-Bridge must be in the foreground for it to be able to start an installation or to run the application. In most cases it will be in the foreground automatically. If it is not in the foreground then you need to click on it to bring it to the foreground.

Troubleshooting:

Device errors:


1. Make sure that the mobile provisioning file includes the device UDID and that the UDID doesn't start with ffffff (this is a fake id).
2. Select 64 bit under Tools - Build Server - Server Settings.

Compilation errors:
1. First follow the steps in this tutorial: http://www.b4x.com/android/forum/threads/creating-a-certificate-and-provisioning-profile.45880/
2. Make sure that the App Id ends with a wildcard.
 
Last edited:

tcgoh

Active Member
Licensed User
Longtime User
Sorry, You got me there. What is a hosted builder or local builder?

I installed b41 exe on a windows pc and try to run from there with my iphone and ipad on the local network.
Thanks
 

fbritop

Active Member
Licensed User
Longtime User
iOS 7+ is required. Note that iPhone 3 doesn't support iOS 7.


Please start a new thread for this issue.
Erel,
Sory my mistype, it's iphone 4 with os 7+.

I have deployed my proyect as a Release App and it runs fine on the device, but the problem still persist as the debugger cannot connect to the phone. I have tried disabling then windows firewall with no luck, I have no clue what else to do.

Anyway, regarding special characters within the application name, I think should be included in the tutorial, just by luck I detected that.
 

miker2069

Active Member
Licensed User
Longtime User
Okay, I got the default app to finally compile and deploy via my local macbook :)

The videos were very helpful. Basically I paused the videos as I followed along. The interface has changed slighty in the developer.apple.com portal but it shouldn't be to bad to follow along.

My biggest issue was that I used a UUID app from the apple store to discover my ipad's UUID. It gave me the WRONG one. After a few hours of this I went back to iTunes and copied the right one and re-generated my provisioning profile and all worked as expected.

Note, I've done a little iOS messing around in the past so many of concepts were already familiar to me.

My recommendation is a quiet block of time (i.e., a few hours) and follow the instructions carefully. Now to see what else I can do :)
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I have deployed my proyect as a Release App and it runs fine on the device, but the problem still persist as the debugger cannot connect to the phone. I have tried disabling then windows firewall with no luck, I have no clue what else to do.
What do you see on the device after you run the debug app?
 

fbritop

Active Member
Licensed User
Longtime User
It ask if I want to install the app, I click yes, it starts the app and stays with a message waiting for the IDE to connect, also displays the device IP, which is the same I have connected in the IDE, under devices, IP's.
 

fbritop

Active Member
Licensed User
Longtime User
With the Release Built it runs fine, the problem is with the Debug mode
 

fbritop

Active Member
Licensed User
Longtime User
Only one project open. The IDE is up and running, as is the B4I IDE that launches then install process. It gives me the Rapid Debugger error when I deploy it to the device
 

adangood

New Member
Licensed User
Longtime User
I compile the code then show message below:

error: no such file or directory: '/Users/adangood/Desktop/macserver-aa/UploadedProjects/adangood/B4iProject/B4iProject-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1


Error: ** BUILD FAILED **


The following build commands failed:
ProcessPCH /var/folders/9z/nrbs3jld2_vgd4nfdt_5d5c80000gn/C/com.apple.DeveloperTools/6.1-6A1052d/Xcode/SharedPrecompiledHeaders/B4iProject-Prefix-hgfksykmbryswugtkcridqckibps/B4iProject-Prefix.pch.pch B4iProject/B4iProject-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

how to do ,thanks!!
 

fbritop

Active Member
Licensed User
Longtime User
Try to check it with a different device or in a different network.

Erel,
I tried on a different device a couple o days ago with the same issue. Also have tried 2 different subnets (192.168 and 172). I'm currently working a project at a airport quite far away from my office. I will try either tomorrow or monday, to reinstall b4i on a different PC to see what happens
 

Mark Turney

Active Member
Licensed User
Longtime User
Thanks for the awesome work Erel. Everything works great! I am now connected from the IDE to my iPAD. Ready to convert my first Android app over to iOS ;).....

Mark Turney
Developer of Face Flashcards (for Android, and soon for iOS)
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Hi,
Please, where is the problem?
Thank you

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies
Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“Developpement_Ciginfo”) has an AppID of “com.ciginfo.*” which does not match your bundle identifier “b4i.essai_01.bridge”.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.0'


Error: ** BUILD FAILED **


The following build commands failed:
Check dependencies
(1 failure)
 

ciginfo

Well-Known Member
Licensed User
Longtime User
I solved the previous problem, I have seen I had to use com.ciginfo in the current app package name.
But now, another problem and I con't understand.

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies
Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“Developpement_Ciginfo”) were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.0'


Error: ** BUILD FAILED **
 
Status
Not open for further replies.
Top