Glbasic and Xcode for ios7 and fixes...

Previous topic - Next topic

spacefractal

This one took me hours to get working because glbasic is not aware of ios7. The main issue is the icons which have added three new size, but im can nothing to add them correctly at all. It's due SpotRace of course.

finally I'm got it working again, but it's does require various tweeks to some Xcode settings. I'm will later this week do a new default Xcode project which would much easier setup the iOS project and fixed various issues (dispite missing tree icons, but now much easier to add them, which was troublesome).

Also arm6 is completly removed, which have not supported quite longtime.

But that also means iOS 5.1.1 is the minimum required, due arm64.

Ps. It's still got accepted apps for AppStore. Recently I'm got Greedy Mouse v2.0 accepted few days ago. This just require some works.

EDIT:

Here is a fixed xCode project for iOS 7.1 and xCode 5.1
http://www.glbasic.com/forum/index.php?topic=9879.msg86162#msg86162
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

I am looking to a couple of my apps for iOS soon too, but I dreading it - as the new changes seem to be problematic for GLB.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spicypixel

I said ages ago that I couldn't get an XCode project compiled on os7 with maverick os because it kept giving me errors regarding icons, but my claims were somewhat ignored. That's why I let my apple dev expire as I felt that GLB doesn't support iOS out of the box anymore.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

spacefractal

#3
im do have to say this was NOT a glbasic issue its self, but this is one of the worst peice of buggy Xcode shit im have seen. Its was not a issue in Xcode 4 (which setting up icons was none annoying at all), but its came buggy in Xcode 5 which hit a wall with some icon size with Apple have oversight and still have newer fixed it, its a clean xCode bug. Im should send a bug report to them, since that one is so annoying and took me about 4-5 hours to fix.

Im do still not have tested it with a new updated stock project. So im do need few testing. Rest of the issues about arm etc is pretty easy too. Here Xcode could fix them and finally got Spot Race running.

At im see the main issue is really in the iPhone-info.plist which needs updating. Its will still missing the 3 iOS7 icons, but with the updated plist file and various other thing, then its would been easier to get the xcode project working again and should not get the issue by updateing the missing icons at all under the App Icon tab in xCode.

Im do need quite few testing before im release it (without the Storekit).

PS. There is issues with Android too with stock glbasic too. Howover its a much easier one to fix: just remember to add Icon.png to the main source directory.

PPS. Also there is too much automatic thing doing with iOS version, etc the icons creations. Here im wanted this was doing with a external tool or a bat file, not directly from IDE too. Then im could have totally fixed it.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#4
Here is a updated plist file:
Code (glbasic) Select

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Data file</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>120</string>
<string>iPhoneIcon@2x</string>
</array>
<key>CFBundleIconFiles~ipad</key>
<array>
<string>76</string>
<string>152</string>
<string>iPadIcon</string>
<string>iPadIcon2x</string>
</array>
<key>CFBundleIconFile~ipad</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>${PRODUCT_NAME:rfc1034identifier}</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarHidden~ipad</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Data file</string>
<key>UTTypeIdentifier</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>gdf</string>
<key>public.mime-types</key>
<string>application/datafile</string>
</dict>
</dict>
</array>
</dict>
</plist>


And here is the updated iPhone.xcodeproj:
Code (glbasic) Select

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Data file</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>120</string>
<string>iPhoneIcon@2x</string>
</array>
<key>CFBundleIconFiles~ipad</key>
<array>
<string>76</string>
<string>152</string>
<string>iPadIcon</string>
<string>iPadIcon2x</string>
</array>
<key>CFBundleIconFile~ipad</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>${PRODUCT_NAME:rfc1034identifier}</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarHidden~ipad</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Data file</string>
<key>UTTypeIdentifier</key>
<string>com.companyname.${PRODUCT_NAME:rfc1034identifier}</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>gdf</string>
<key>public.mime-types</key>
<string>application/datafile</string>
</dict>
</dict>
</array>
</dict>
</plist>


You do might need validate your project for your settings, before the compiling got working. Howover that is easy and will seen that as a warnings in xCode. Just imply all fixes.

Here is the whole xCode project:
https://www.dropbox.com/s/doeg7zwyx9hjlig/compiler.zip

PS. Very sorry for the very late answear for the issue. Im did first seen the issue yesterday myself.

PPS. Im hope those two important fixes does NOT got updated if they exists. That is very annoying.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Do iOS still require both landscape and portrait working within the same app?! (That would be annoying!)
Or do they now accept 1 mode for both menu and game?!

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#6
You don't need to supports both landscape and portrait. But you should do support both ways, etc when device rotated 180 degree.

On android this can done automatic in manifest, but on ios require manual work, but is not hard.

Karma Miwa is a landscape only game.

Code (glbasic) Select

FUNCTION ControlTilt: set=-1
STATIC COUNTER=13
STATIC ORIN=0
LOCAL x, y
LOCAL NEWRIENTATION
STATIC yres, xres

USESCREEN -1
COUNTER=COUNTER+1
IF COUNTER>100 THEN COUNTER=85

IF device$<>"iOS" THEN RETURN

IF COUNTER=17
IF ORIN>-1 AND (GETORIENTATION()<>ORIN) AND (ORIN=1 OR ORIN=3)
SETORIENTATION ORIN

?IFDEF IPHONE
IMPORT "C" int iOSSetOrientation(const char*)
IF ORIN=3 THEN iOSSetOrientation("landscapeleft")
IF ORIN=1 THEN iOSSetOrientation("landscaperight")
?ENDIF
ORIN=GETORIENTATION()
RETURN
ENDIF
ENDIF


IF COUNTER<15 AND set=-1 THEN RETURN

COUNTER=16

IF GETORIENTATION()=0
y=GETJOYY(0)*100
x=GETJOYX(0)*100
ELSEIF GETORIENTATION()=1
y=-GETJOYX(0)*100
x=GETJOYY(0)*100
ELSEIF GETORIENTATION()=2
y=-GETJOYY(0)*100
x=-GETJOYX(0)*100
ELSE
y=GETJOYX(0)*100
x=-GETJOYY(0)*100
ENDIF

IF device$="a" OR device$="ak"
x=x/10; y=y/10
ENDIF

IF (x>60 OR KEY(32)=1) AND ORIN<>3
ORIN=3; COUNTER=0;
ELSEIF (x<-60 OR KEY(30)=1) AND ORIN<>1
ORIN=1; COUNTER=0;
ENDIF
ENDFUNCTION


above is for iOS only, does not require doing anything on Android, which is handled by Android its self (using example "sensorLandscape" in manifest). The above code require include Classes/functions.mm to your xCode project (this might not been done automatic, but here its easy to add them). The code shown is for landscape ony, but its just matter to change the code to feed your need. The code should been pretty much self explained.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#8
also its seen after updating the xcode project in the glbasic folder, iOS 7 have been much easier to been testing. Normally im have needed to copy the lib file to the internal folder on my mac to make sure nothing is changed (this why this very late testing, sorry about that). This might still need to been required in the final code, but doing testing this is nowhere a big issue at all.

Just like what im did for Android Extras, to avoid eventuelly overwriting, do update the xcode project to the glbasic folder instead after the project working again. Then you would not have the issue again, when moving to a new project.

Just make sure the product name you using is replaced back with %GLB_PRODUCT_NAME% in the project.pbxproj, before copy back to the glbasic subfolder (\GLBasic_v12\Compiler\platform\iPhone\XCode\GLBasic).

Its much better now, since the crappy icon issue is no more (gosh, this is so bad designed in xcode, really). There is still few other issues, but they are nothing big and can been fixed by validating (also arm6 might need to been removed in the final project). Of course code signing is not my job.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Marmor