iPhone Simulator Display - iphone

I'm using Titanium to build my first mobile app. Ultimately, I need to to be universal, but I'm focusing on the iPhone initially in order to learn my way around. I'm running into a problem with image display in that I need to test both the retina and non-retina display, but I can't seem to toggle between the 2.
By default, for whatever reason, my simulator launches with the "old" iPhone resolution (specifically, the combo of iOS 5 -- so location bits mostly work -- and old iPhone hardware). I see in the simulator's Hardware menu that I should be able to switch to iPhone (retina), but attempting to do so just aborts the simulator all together.
Is there a better way to navigate between hardware/software combinations in the simulator? Can the default configuration be changed? Any tips or techniques would be much appreciated by this n00b to mobile dev. For whatever it's worth, the simulator version is 5.0 (272) and, although I'm not developing native code, my XCode version is 4.2.1.
Thanks.

Titanium has a debugger connection running between the simulator and Titanium Studio. When you switch hardware the connection is severed and titanium aborts the simulator all together.
What you can do, is create a build in titanium studio, which builds an Xcode project (project name > build > iPhone).
Then, open this build in xCode, and run it from there. This way there is no debugging session running, but you can test it on multiple devices / OS versions.
Good luck!

Related

Xcode M1: Run Designed for iPhone

Hello fellow [iOS] Developers!
I've just got my M1 MacBook Pro and been loving how we can test our Apps without even using our mobile devices (props to Apple!!)
So far, I was able to test the app behaviour as it was for iPad (Running "Designed for iPad"), so I wonder if there's a way to build the app as if it was for an iPhone and run it on the M1? This would be awesome!
Yes, You can.
One simple smart hack is to
uncheck iPad from Deployment info
and then simply run the app you would see that the text would change to
Detailed Steps:
Select Project from Project Navigator
Select your specific target > Go to General
Under Deployment Info "Uncheck iPad"
Bas ho gya, Khatam, Tata, Bye Bye
Just run the Project
The answer is no, you cannot, if you mean native iPhone app on the M1. At least as far as I’ve seen. The simulator will continue to offer you to run the iPhone apps, as you probably have seen already.
As far as I understand, however, iPhone-only apps available on the iPhone are an exception. Whenever an app contains both iPhone and iPad versions of that same app (universal iOS apps), Apple ignores the iPhone version and makes available the iPad version exclusively out of those two iOS/iPadOS apps.
You should watch the video by Apple, ”Introducing iPad apps for Mac”, WWDC 2019, available in the ”Apple Developer” app (you can find it on the App Store). Here’s a web link if you prefer it: https://developer.apple.com/videos/play/wwdc2019/205/
Here is a quote from the transcript of that video:
Now along those lines, there's also some apps that are just not
candidates for this technology.
One example is iPhone apps. iPhone apps are optimized for the smaller screen, so they're trying to take advantage of that small screen. We really want you to have an iPad app that's taking advantage of larger screen sizes before bringing it to the Mac.
In 2019, this was all about Mac Catalyst on Intel Macs, but I think it still holds true today on M1: it is all about taking advantage of the similarity between macOS and iPadOS in terms of the screen.

Possible to test iPhone app without a real device?

I have to convert an iPhone app which is published at the AppStore. However, I do not have iPhone.
Is there any way to test the functionality of this app without a real phone? Would the emulator be of any help? Or maybe some web application?
If you don't have the source code for the app, you can't run it without an iPhone or iPod touch.
The iPhone Simulator (included with the SDK) won't be of any help, because it only runs apps that are compiled for Intel (your Mac). It's not an emulator and cannot run apps that are compiled for actual devices (ARM processors). Without the source code, you can't recompile the app.
iOS Simulator is NOT an emulator. It's a simulator. It doesn't emulate iOS hardware, it is running your app compiled as 64bit Intel app for Mac and displays it inside the iPhone-like window that looks and feels like iPhone, but doesn't have all features and some things don't work the same way.
For example, iOS has a case-sensitive file system, Mac doesn't, so iOS Simulator doesn't either. Also, there's no camera, sms, compass, accelerometer, magnetometer, or any other iPhone-specific feature.
So, yes, you can test some apps using iOS Simulator, but no, you shouldn't test them only using iOS Simulator.
You can of course test the app just with the simulator. However, the simulator lacks some capabilities like accelerometer data, so if you plan on using anything like this, you should consider getting at least the cheapest iPod Touch for testing.
If you do any operations that use lots of rescources (memory, processing power) you need to consider that the iPhone is not as fast as your Mac either.

iPhone, iPad versions mixed in simulator

I created a iPhone application first and converted it to iPad version to make it a universal build. Most of the time it works fine. But sometimes my iPhone version load as iPad and iPad version launches as iPhone. Kind of mixed up. What is the cause for this? Will this be an issue in actual devices once I submit that to the app store?
Thank you
In Xcode you can select the active executable (use the drop-down in the upper-left corner). I find that sometimes it switches on me, perhaps showing iPad and requiring me to set it back to the iPhone executable for example. If this is your issue, there will not be any confusion when you're running it on an actual device.
If you are planning to submit an app to the app store, it's a very good idea (understatement) to test the app on real devices first!

Run a universal app as a 'legacy' iPhone app on an iPad

I do most development testing on my iPad. When I test an iPhone app, it runs in 'compatibility' mode where the little iPhone app runs in a small window or x2 magnification. Now that I've created a universal app it runs as a native iPad app. For testing I'd like to use the simulated iPhone when I don't have an iPhone handy for testing.
How can I build the project so that the iPad will run the app in compatibility mode?
Turns out it was really simple
Get Info for the project target
Change Targeted Device Family to iPhone
You can't. If the target is 3.2 SDK, then it will always run the simulator as an iPad. So your options are to debug on a device, or configure your app to be build under 3.1.3 so that the simulator will be an iPhone (too much trouble and unreliable).
Or hope for a later release with the option.

getting Xcode to build my iPhone app on the iPhone Simulator after setting up my physical iPod to test with?

I am new to developing apps for the iPhone. I just went through the entire process the other day of properly setting up my developer account to allow me to test my programs on my physical iPod. Once I set it up though, I was not able to figure out how to get the iPhone Simulator working again. I would like to test my programs quickly with the simulator and then test major revisions periodically on the physical device. How can I adjust the target of the compiled program to test? Any insight would be appreciated. Thank you for your time.
Change the active SDK to "Simulator"
Project -> Active SDK -> iPhone Simulator 3.1.2