Page 1 of 3

Adding smart BASIC to Xcode Tutorial

Posted: Mon Oct 27, 2014 8:50 am
by Mr. Kibernetik
Smart BASIC allows you to create genuine iOS applications which can be valid for App Store submission or Ad-Hoc distribution.
Although all iOS applications should be compiled with Xcode, you will not need to write any single line in Objective C language - you will simply compile template Xcode project together with your smart BASIC program.

Of course you will need Apple developer license and knowledge of how to use Xcode for compiling and codesigning your applications. But these topics are out of scope of smart BASIC support and should be referred to respective Apple help resources.

Now, as a tutorial let's create an iOS application for example from this smart BASIC program:
viewtopic.php?p=3493#p3493

Download smart BASIC SDK for Xcode.

Copy text of BASIC program and create text file "turtle.txt" from it.

Rename root template foler name from "BASIC SDK" to "Turtle".

Copy file "turtle.txt" to "Turtle/Samples" folder.

Open template project in Xcode.
1.png
1.png (153.01 KiB) Viewed 14172 times
In file "BASIC/AppDelegate.m" inside empty quotes write down name of program file which you want to run (in our case: turtle.txt).
2.png
2.png (331.84 KiB) Viewed 14172 times
In file "BASIC/Supporting Files/Application-Info.plist" change "Bundle display name" parameter from default "Application" to "Turtle".
3.png
3.png (266.74 KiB) Viewed 14172 times
Compile project by selecting Xcode menu item "Product > Build". Thus all changes will be saved.

Rename project name from default "Application" to "Tutrtle".
4.png
4.png (233 KiB) Viewed 14172 times
Select Xcode menu item "Product > Scheme > Edit Scheme..." and in "Archive" section rename default name "Application" to "Turtle".
5.png
5.png (150.52 KiB) Viewed 14172 times
Now you can do anything you want with your application: compile it for App Store submission, for Ad-Hoc distribution or test it in iOS Simulator.

NOTES:
1) Template project "BASIC SDK" contains two libraries: "libSB-dev.a" for running on iOS device and "libSB-sim.a" for running on iOS Simulator. Library name used in project is "libSB.a", so you may need to rename proper library file to "libSB.a" before running your project.

Here you can download the complete instruction as a PDF file, compiled by Scott A. Rossell.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Sun Mar 06, 2016 8:01 pm
by greycheek
Do we as SmartBasic developers have the right to distribute SmartBasic apps in the Apple App Store for commercial use, royalty free?

Re: Adding smart BASIC to Xcode Tutorial

Posted: Sun Mar 06, 2016 8:02 pm
by Mr. Kibernetik
greycheek wrote:Do we as SmartBasic developers have the right to distribute SmartBasic apps in the Apple App Store for commercial use, royalty free?
Of course YES.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Sat Jun 25, 2016 6:45 pm
by Elliot
Does it matter what version of Xcode I use? (Version 8 is what is available at Mac Store) ..
Thanks.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Sat Jun 25, 2016 6:52 pm
by Mr. Kibernetik
Elliot wrote:Does it matter what version of Xcode I use? (Version 8 is what is available at Mac Store) ..
Thanks.
Whatever works.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Thu Jun 30, 2016 10:51 am
by Elliot
I have downloaded the smart BASIC SDK for Xcode. But your tutorial says rename template folder from "BASIC runner" to "Turtle". Are you referring the the folder labelled BASIC? This is a virtual folder, correct?

Then you open the Samples (virtual) folder and copy the turtle.txt into it.

When you click on Application.xcdoeproj, it should open in Xcode. Do I have this right?

Thanks so much for your help.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Fri Jul 01, 2016 5:22 am
by Mr. Kibernetik
Elliot wrote:I have downloaded the smart BASIC SDK for Xcode. But your tutorial says rename template folder from "BASIC runner" to "Turtle". Are you referring the the folder labelled BASIC? This is a virtual folder, correct?
Now name of this folder is "BASIC SDK" (I have corrected the tutorial). So you can rename it to "Turtle".
Elliot wrote:When you click on Application.xcdoeproj, it should open in Xcode. Do I have this right?
Usually I run Xcode and then load project from there.

These folders are not virtual (what does it mean?). "BASIC SDK" and "Samples" are normal folders.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Fri Jul 01, 2016 11:27 am
by Elliot
I attempted to build the product but got 9 error messages. including Ignoring file/Users/admin/Downloads/Turtle/libSB.a, missing required architecture x86_64 in file /Users/admin/Downloads/Turtle/lib SB.a (2 slices)...

The others were _OBJ__$_ViewController.activateGPS", and similar with .dropboxAppKey, .dropboxAppSecret, .dropboxRoot,

I have screenshots of the error messages if that would help. Also the BASIC SDK already contained all 3 library files (libSB-dev.a, libSB-sim.a, and libSB.a) I did not change the names of any library.

Thanks.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Fri Jul 01, 2016 12:00 pm
by Mr. Kibernetik
Elliot wrote:I have screenshots of the error messages if that would help. Also the BASIC SDK already contained all 3 library files (libSB-dev.a, libSB-sim.a, and libSB.a) I did not change the names of any library.
Probably you should change. Please read NOTES in the end of tutorial: proper library should be chosen when compiling for Simulator and for device.

Re: Adding smart BASIC to Xcode Tutorial

Posted: Fri Jul 01, 2016 5:17 pm
by Elliot
I am not sure what you mean. I would be using the iOS Simulator. Does that mean I should change the name of libSB-sim.a to libSB.a? (Overwriting or deleting the current libSB.a file)?

Thanks.