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:

GiulioVale

Active Member
Licensed User
Longtime User
Note that you can install B4i-Bridge and then change to a different provisioning profile if you need an explicit id.

Thank for suggestion.
Erel, I see that App explicit Id have push flagged but App with asterisk no... Any suggestion how enable this?
 

DoctorDebug

Member
Licensed User
Longtime User
Erel I have tried to do what your instructions say multiple times, and I think my old brain is missing something.

I get the following when I try to create the bridge, does any of this ring a bell? Thanks! What it boils down to is a "No identity found" error.

Jeff



Signing Identity: "iPhone Developer: Jeff O'Donnell (S8LKSHP2GT)"
Provisioning Profile: "Wildcard"
(491e6f58-30a3-4d5a-a2e4-a0fe436d79ae)
/usr/bin/codesign --force --sign 91FB6597668B4E95E6DCB812A98A9547FD74FFE5 --resource-rules=/Users/administrator/Documents/objc/UploadedProjects/beta679/Payload/B4i-Bridge.app/ResourceRules.plist --keychain beta679 --entitlements /Users/administrator/Documents/objc/UploadedProjects/beta679/build/B4iProject.build/Release-iphoneos/B4iProject.build/B4i-Bridge.app.xcent /Users/administrator/Documents/objc/UploadedProjects/beta679/Payload/B4i-Bridge.app
91FB6597668B4E95E6DCB812A98A9547FD74FFE5: no identity found
Command /usr/bin/codesign failed with exit code 1

Error: ** BUILD FAILED **

The following build commands failed:
CodeSign Payload/B4i-Bridge.app
(1 failure)
 
Last edited:

isonliveradio

Member
Licensed User
Longtime User
Hi,

I have installed the compilling server on my mac and the various certificates. But when I go to compile/install the b4i bridge it is not compilling (following the video exactly). The last part of the output is:

/Users/sean/UploadedProjects/b4i_default/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o
/Users/sean/UploadedProjects/b4i_default/B4iProject/main.m:11:9: fatal error: 'iDesigner.h' file not found
#import "iDesigner.h"
^
1 error generated.

Error: ** BUILD FAILED **

The following build commands failed:
CompileC build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/armv7/main.o B4iProject/main.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

this I presume is a missing dependency at compile time. I have the latest xcode on the mac which I presume is 6, not sure if it might even be a later version.
 

isonliveradio

Member
Licensed User
Longtime User
Seems like the Libs folder is missing on your Mac computer. There should be a folder named Libs in the folder of B4iBuildServer.jar. All the libraries including iDesigner.h should be there.

Thanks Erel that was the problem. I setup a desktop link to the build server to save typing every time, which did start it ok, but it did not see the libs folder. Got around it by aliasing a script which changes into the correct folder first then runs the server. In Windows and even debian I can make a desktop shortcut and tell it the working folder, OSX has yet to learn this. Just got it all working, another brilliant effort on your part. Thanks, my first app took about 20 seconds to make.
 

fbritop

Active Member
Licensed User
Longtime User
Erel,
I installed the bridge at the device, he starts listening on his IP, I connect device IP on B4I, when I compile my project, it creates an icon on the phone, open the icon, and again starts waiting for the debugger on his IP, run again my project and it complains that Rapid Debugger failed to connect to device.

I reboot the device with no luck

Compile & Debug outputs:
Parsing code. 0.04
Compiling code. 0.41
Compiling debugger engine code. 3.70
Building Xcode project 0.05
Sending data to remote compiler. 2.97
Compilation completed successfully.
Make sure that B4i-Bridge is started (10.8.24.123).
Manually launch the app after installation.

** The bridge is OK, as I can connect with the designer to the device with no problems at all
 
Last edited:

fbritop

Active Member
Licensed User
Longtime User
I have launched the program on the device, it says the IP address and Waiting for IDE. Althow the IDE IP points to the device, it keeps waiting forever.

Have restarted both, mi machine and the device with no luck
 

fbritop

Active Member
Licensed User
Longtime User
As I just posted, I have launched the program, it apears a waiting icon with the device IP and a message that says, Wainting for the IDE to connect

Using iOS 7.1.2
 

klaus

Expert
Licensed User
Longtime User
Can you explain in detail what you have done.
After loading a program:
- I run in the IDE menu Tools / Build Server / Build Basic4i-Bridge App.
- Run the program
upload_2014-11-14_22-3-47.png

- Then you should see the message asking for installation.
 

fbritop

Active Member
Licensed User
Longtime User
OK, Fresh from zero
Build B4I Bridge
Navigate to the URL that the Compile tells me (63.135.170.51:51041/xxx) on the device
Click install APP on the device.

It asks to install my program, install, click to open, the program opens and it says on the screen that is waiting for the IDE to connect, which never happens.

The IDE at the status bar says: Trying to connect to device (10.8.24.123).

The IDE never connects to the IDE for debugging
 
Last edited by a moderator:
Status
Not open for further replies.
Top