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:

ilan

Expert
Licensed User
Longtime User
my iphone 5s is running version: 10.3.3 (14G57)

and when i checked the Certificate Trust Setting, B4i was also turned off so i turned it on and its working now but only Hosted builder! the local builder still doesnot work!

ps: my hosted builder will expire soon so it would be very nice if we could get an update for the local builder :)

btw the hosted builder ip is: 63.135.170.51
 

ilan

Expert
Licensed User
Longtime User
Check the ip address printed when the builder is started. It is probably incorrect. If so then follow the instructions on explicitly setting the ip address: https://www.b4x.com/android/forum/threads/46402/#content

this is what i get when i start the builder:

Last login: Mon Jul 10 16:31:37 on ttys000

macmini:~ Ilan$ cd downloads/macserver

macmini:macserver Ilan$ java -jar B4IBuildServer.jar

Build server version: 4.01

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2017-07-10 16:37:13.122:INFO::main: Logging initialized @177ms

Loading default configuration file.

AppPath=/Users/Ilan/Downloads/macserver

Mac version: 10.12.5

Creating key for: 192.168.14.106

2017-07-10 16:37:15.082:INFO:eek:ejs.Server:main: jetty-9.3.z-SNAPSHOT

2017-07-10 16:37:15.144:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@5ae9a829{/,file:///Users/Ilan/Downloads/macserver/www,AVAILABLE}

2017-07-10 16:37:15.147:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened /Users/Ilan/Downloads/macserver/logs/b4j-2017_07_10.request.log

2017-07-10 16:37:15.172:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@706a0252{HTTP/1.1,[http/1.1]}{0.0.0.0:51041}

2017-07-10 16:37:15.205:INFO:eek:ejus.SslContextFactory:main: x509=X509@20e2cbe0(rootca,h=[],w=[]) for SslContextFactory@68be2bc2(file:///Users/Ilan/Downloads/macserver/key/key.jks,null)

2017-07-10 16:37:15.206:INFO:eek:ejus.SslContextFactory:main: x509=X509@28feb3fa(jetty,h=[192.168.14.106],w=[]) for SslContextFactory@68be2bc2(file:///Users/Ilan/Downloads/macserver/key/key.jks,null)

2017-07-10 16:37:15.427:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@7e9a5fbe{SSL,[ssl, http/1.1]}{0.0.0.0:51042}

2017-07-10 16:37:15.428:INFO:eek:ejs.Server:main: Started @2486ms

Build server is ready

https://192.168.14.106:51042

http://192.168.14.106:51041

Build server version: 4.01

Adding user to keychain:

success: true, 143

16:39:50| Compilation time: 121625, ai27w5m, queue: 0, success: false

16:41:41| Compilation time: 55950, ai27w5m, queue: 0, success: true

the ip that i use is: 192.168.14.106
 
Last edited by a moderator:

ilan

Expert
Licensed User
Longtime User
Can you install other apps (not B4i-Bridge)?

Sorry i dont understand your question.

I can install the bridge via hosted builder and then install apps from b4i (debug and release) but with local builder i get an error msg that i cannot connect to ip...

Even if i install the bridge via hosted builder and then try to connect to the local builder i get the same error.

Can you maybe put a download link to the hosted builder with ip: 63.135.170.51

Maybe its a different jar file that was sent via b4i v4.01 mail??

I need to mention that i had the same error with the hosted builder but when i enabled b4i certificate in settings the hosted builder start working but not the local. And i also can run debug with simulator so the local builder is building the project and i can connect to it and run on simulator but with my iphone i get "cannot connect to ip"
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem is not in the builder program.

I need to mention that i had the same error with the hosted builder but when i enabled b4a certificate in settings the hosted builder start working
This is expected.

Try to delete the keys folder in the Mac, change the user name under Tools - Build Server (to any value you like) , restart the Mac builder and test it again.
 

ilan

Expert
Licensed User
Longtime User
The problem is not in the builder program.


This is expected.

Try to delete the keys folder in the Mac, change the user name under Tools - Build Server (to any value you like) , restart the Mac builder and test it again.

Ok i will try it when i get to my pc and let you know. Thank you
 

ilan

Expert
Licensed User
Longtime User
Try to delete the keys folder in the Mac

done!

hange the user name under Tools - Build Server (to any value you like)

done!

restart the Mac builder

done!

test it again

IMG_0831[4931].PNG

@Erel, i really think there is a problem with the .jar file. everything worked in the previous version.
i also am able to build the project and run it on the simulator (with the local builder) and if i use the hosted builder i can run my project on my iphone
i only cannot connect my iphone with the local builder!!

btw i am not the only one with this issue, @JanPRO has the same issue and others here too. and it started with version 4.01.
 
Last edited:

ilan

Expert
Licensed User
Longtime User
ok, ok, ok , ok..... i found the reason!!!!

b4i doesnot like if the date and time on the iphone is not correct!!!

i am not using my iphone a lot and the date was june 2017 and not july. setting the right date/time (go to setting - date & time - Set Automatically) fixed the issue!

so if someone has the same issue check the date & time on your iphone! i have no idea why the bridge is date/time sensitive but setting the right date/time fixed the issue!! thanks a lot for your help @Erel :)
 

JanPRO

Well-Known Member
Licensed User
Longtime User

hongbii khaw

Member
Licensed User
Longtime User
Hi all,
i got this error message:
Check dependencies
Provisioning profile "SCloud Development" has app ID "com.<user id>.scloud.*", which does not match the bundle ID "com.<user id>.scloud".
Code signing is required for product type 'Application' in SDK 'iOS 10.3'
Anything I did wrong?
Thank you.
 

b4xscripter

Member
Licensed User
Longtime User
Hi,
first of all, many thanks for your support!
I have the issue related to the hosted Mac Builder. I select Build B4i-Bridge App:

upload_2017-10-1_16-8-44.png


That was compiled successfully:

upload_2017-10-1_16-11-19.png


Now, I put the url on Safari with my user: 208.52.154.96:51041/XXXXXX

I get this message:

upload_2017-10-1_16-12-53.png


And when I click o Install App, I always get "can't connect to 208.52.154.96":

upload_2017-10-1_16-14-27.png



I have B4X certificate installed on my Ipad, as required.

Could someone please explain what is the problem and how to sort it out?

Thanks in advance!
 

Attachments

  • upload_2017-10-1_16-11-4.png
    upload_2017-10-1_16-11-4.png
    94 KB · Views: 444

b4xscripter

Member
Licensed User
Longtime User
Hi, Erel!
Thank you! It is true... I needed to enable the certificate. But now, when I try to open the installed app, I get this error:

upload_2017-10-2_21-0-59.png



The translation from spanish is something like "You need to update B4i Example, the developer must update this app to be compatible with this iOS version.
I have the version iOS 11.0.1

Best regards
 

stingrae

Member
Licensed User
Longtime User
I've gone through the instructional at least 10 times, with 3 or 4 different apps but cannot get past this bit:

"Build B4i-Bridge: Tools -> Build Server -> Build B4i-Bridge". I get this error below.

I've got my Android app working well, and now want to replicate in iOS but can't get a "hello world" app to compile :-(

Please help

upload_2017-10-7_15-24-13.png
 
Status
Not open for further replies.
Top