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:

klaus

Expert
Licensed User
Longtime User
I don't really understand. It seems you are missing some steps.
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.
Does this mean installing Basic4i-Bridge or your program ?
 
Last edited by a moderator:

ciginfo

Well-Known Member
Licensed User
Longtime User
hello,
I suppose that it can only be installed on an Apple device (iPhone or iPad), not Android?
 

Erel

B4X founder
Staff 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
Don't post your user id. Only you should use it. If it will be used by other ip addresses at the same time it will be blocked automatically.

Are both the PC and device connected to the same local network? 10.8.24.123 doesn't look like a local network ip address (though it might be).
 

fbritop

Active Member
Licensed User
Longtime User
Erel,
They are on the same NET, and it is a private network.

I have tried at home, with another local network (192.168.43.215) on the device, again.

When I compile my program I get an error about the Rapid Debugger (screen attached), anyway, after the bridge asks if I want to install my application, I install it, run it and I got the icon and the message saying that is waiting for the IDE to connect.

It seems that the debugger never connects to de iPhone.

What is the debugger error in the screen attached?

Thanks
FBP
 

Attachments

  • screen.png
    screen.png
    133 KB · Views: 651

fbritop

Active Member
Licensed User
Longtime User
Erel
I can ping the device. The bridge works ok, and the visual designer too.

Pretty strange all this. I had never had any issues with b4a.
 

fbritop

Active Member
Licensed User
Longtime User
I just createad an new project. No luck again, same as with the first project.

Just for the doubt. The certificate I created in apple.com was "com.llavemovil.*" and my project package is set to "com.llavemovil.test"

The strange thing, if this was a network issue, it wouldn't be possible to connect to the device with the abstract designer or not?
 

cmartins

Member
Licensed User
Longtime User
almost the same issue with me. When I try to compile I got error?

Parsing code. 0.00
Compiling code. 0.03
Compiling debugger engine code. 0.67
Building Xcode project 0.02
Sending data to remote compiler. Error
Communication error: ConnectFailure

I can use designer. the connection is ok
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
@cmartins please start a new thread for this issue. It is a different issue.

The strange thing, if this was a network issue, it wouldn't be possible to connect to the device with the abstract designer or not?
The designer uses different ports. Maybe your firewall blocks the debugger ports.

The debugger connects to ports 58190 - 58195 on the device. Can you try it with a different device or in a different network (I can send you a user id for the mac builder so you can test it with any computer).
 

fbritop

Active Member
Licensed User
Longtime User
Erel,
Started from scratch, deleted both certificates, b4i, and the development one. Created a new set of certificates on apple.com. download ca.pem at the device.

I also disable the windows firewall. I have build the b4i bridge at the device, but when I compile the project, I get the same error on b4i "Rapid Debugger failed to connect to the device", and on the device, the bridge goes to background and I get a message box that says it is imposible to connect to 63.135.170.51

I do not have another device with me at this time in order to test. I have double checked the udid of the device and it is correct.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is a different error from what you previously described. It is unable to install the app.

The rapid debugger will only be able to connect if the target app is running and showing the message: waiting for connections...

You need to check that:
1. The B4I certificate is listed under Settings - General - Profiles.
2. The mobile provisioning file includes the device UDID.
 

cmartins

Member
Licensed User
Longtime User
I got it. Now I understood... I do not have a Mac, then I need to setup my server builder instead use a local server

thanks Erel
 

fbritop

Active Member
Licensed User
Longtime User
Erel,
Does it requieres a special edition of hardware?. Running iPhone 3,1 with iOS 7.1.2
 

fbritop

Active Member
Licensed User
Longtime User
The connection problem I'm seeing now is when the device tries to download the manifiest he cannot get the URL:

https://63.135.170.51:51042/download?type=manifest__xxxxxxx
where xxxxxxx is the hosted mac key

  1. Status Code:

    500 java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
***EDITED***
I just discover that if the application name has special chars (accents) it wont connect. Having resolved that issue, we are back to the first problem. The application never connects to b4i for debugging
 
Last edited:

davepamn

Active Member
Licensed User
Longtime User
My bridge app will not install from Safari.

The ip address is good, verified with PING on the iPad
The port 51041 opens the webpage.

Why doesn't the bridge app install? Can I download it from the app store?

I later get a popup that says, "Cannot connect to " xx.xx.xxx.xx

ip address
 

tcgoh

Active Member
Licensed User
Longtime User
Hi Erel,

is My iphone ios 7.0 (11A465) giving me this problem?

"Communication error: ConnectFailure"


error.JPG

I have followed all the other steps in this tutorial.

Thanks
 
Status
Not open for further replies.
Top