Adding smart BASIC to Xcode Tutorial

User avatar
Mr. Kibernetik
Site Admin
Posts: 4782
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Adding smart BASIC to Xcode Tutorial

Post 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 13953 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 13953 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 13953 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 13953 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 13953 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.

User avatar
greycheek
Posts: 34
Joined: Sun Mar 15, 2015 3:14 pm
My devices: MacBook Air, Iphone 6+, Ipad 2

Re: Adding smart BASIC to Xcode Tutorial

Post by greycheek »

Do we as SmartBasic developers have the right to distribute SmartBasic apps in the Apple App Store for commercial use, royalty free?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4782
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post by Elliot »

Does it matter what version of Xcode I use? (Version 8 is what is available at Mac Store) ..
Thanks.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4782
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4782
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4782
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

Elliot
Posts: 37
Joined: Thu Jun 23, 2016 10:58 am
My devices: iphone
ipad
PC
Flag: United States of America

Re: Adding smart BASIC to Xcode Tutorial

Post 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.

Post Reply