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:

Massimo Linossi

Member
Licensed User
Longtime User
Yes, I have installed the b4i certificate.
It's really strange. I can see the server, because the connection is working.
 

Attachments

  • IMG_0194.PNG
    IMG_0194.PNG
    284.9 KB · Views: 535
  • IMG_0193.PNG
    IMG_0193.PNG
    162.6 KB · Views: 482

Massimo Linossi

Member
Licensed User
Longtime User
I made as you wrote. The strange problem is that it creates again the keys.txt, but with an IP that is not in my network and
not reachable from the IDE neither the Iphone.
So I changed it manually but the result is always the same. The server makes the bridge and if I call the page test the SSL key
is invalid.
 

Attachments

  • Schermata 2014-12-17 alle 16.54.27.png
    Schermata 2014-12-17 alle 16.54.27.png
    96.6 KB · Views: 399

madru

Active Member
Licensed User
Longtime User
hi, I have the same problem as a few other people in this thread......

the iOS device will not install the B4i-Bridge, pressing the button will show a pop up "Cannot connect to 192.168.1.100".
Using Safari on a MAC will show "itms-services://?action=download-manifest&url=https://192.168.1.100:51042/download?type=manifest_b4i_default".
Executing the HTPS URL will end up with the following error message: "
Problem accessing /download. Reason:
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1"

Installing the bridge.ipa via itunes will have some little success, the visual designer can connect to the device but attaching the debugger is not possible.

THX

M
 

madru

Active Member
Licensed User
Longtime User
mmh, good point......

the Key Ip listed on the test page is wrong it shows the last of the virtual interfaces. The key key file has the correct value and the server startup shows the correct address:
Build server is ready
https://192.168.1.100:51042
http://192.168.1.100:51041
Adding user to keychain: b4i_default
12:06:38| Compilation time: 1788, b4i_default, queue: 0, success: true

but lsof shows * instead of the correct IP
java 23321 guido 22u IPv6 0x6f4ec668e60341cd 0t0 TCP *:51041 (LISTEN)
java 23321 guido 48u IPv6 0x6f4ec668f8b5770d 0t0 TCP *:51042 (LISTEN)
 

madru

Active Member
Licensed User
Longtime User
2014-12-30 15:00:07.336:INFO:eek:ejs.Server:main: jetty-9.1.z-SNAPSHOT

2014-12-30 15:00:07.355:WARN:eek:ejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_US

2014-12-30 15:00:07.374:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@268f9f78{/,file:/Users/Downloads/macserver-aa-2/www,AVAILABLE}

2014-12-30 15:00:07.376:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened /Users/Downloads/macserver-aa-2/logs/b4j-2014_12_30.request.log

2014-12-30 15:00:07.391:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@3f2a225b{HTTP/1.1}{0.0.0.0:51041}

2014-12-30 15:00:08.706:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@7707d6ae{SSL-http/1.1}{0.0.0.0:51042}

2014-12-30 15:00:08.706:INFO:eek:ejs.Server:main: Started @1599ms

Build server is ready

https://192.168.1.100:51042

http://192.168.1.100:51041
 
Last edited:

madru

Active Member
Licensed User
Longtime User
i tried a 2nd mac with success. That MAC has only one physical and no virtual IP interface , it is somehow related to multiple interfaces on the main dev. machine
 
Status
Not open for further replies.
Top