I'm debugging two programs in Flutter ios, but in VS Code the simulator name appears the same for the two devices, how can I rename the devices to differentiate when I launch the app?
I have tried change the name in Hardware/device/manage Devices menu, but it doesn't works.
Related
I use 2 custom fonts on my flutter project, i have registered them on pubspec.yaml. Everything works perfectly on my android emulator and my real android device. But once i start running it on ios simulator, the whole layout went crazy.
I found the solution on here https://stackoverflow.com/a/52603332/12461018 and so i commented all of the custom fonts and the app works fine.
Now the question is how to use those custom fonts so it'll work on ios devices?
I am learning flutter. I created flutter app and successfully installed in android and IOS simulator, I have a problem using ios simulator, when i click outside the simulator it get minimized. I want to disable it or want to open in android studio's window screen, is it possible or how can i do that?
Click on your simulator, Go to the windows tab and check "Stay On Top".
I already have an application which i have built for iphone only. I need to change it to work in both iphone and ipad.the upgrade to ipad application option in project tab of xcode is faded.. which I means I cant do that... I tried to run the project in ipad simulator but it gets automatically run in iphone simulator.
What are the proper steps to change my project to work in iphone and ipad.
Initially change the build setting,ie change the Targeted Device Family field to iPhone/iPad. To write logic for iPad use "UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad" this condition.
I've created a universal binary using iOS 4.2 and Xcode 3.2.5. I'm trying to do some automation testing on the application and since the interfaces are slightly different between the iPad and iPhone versions, I have separate UIAutomation scripts. Unfortunately, no matter what I do, when I click the record button in Instruments, it always starts the application using the iPad simulator. How can I force Instruments to launch the iPhone simulator?
The universal app runs fine in the simulator for all 3 simulated devices (iPhone, iPhone (Retina), and iPad). I can govern the Active Executable via Xcode and "Build and Run/Debug" works fine, correctly using the simulator specified. When I launch Instruments I'm choosing iOS Simulator > All > Automation, then selecting my automation script for the iPhone and then setting the target as project-name/build/Debug-iphonesimulator/project-name.
Before running your automation from the command line create a build of your universal app that is iPhone only by passing the following to xcodebuild:
TARGETED_DEVICE_FAMILY=1
Then run your automation using instruments.
If you want to then test iPad, make another build without that build option and then instruments / simulator will default back to iPad
For reference check out the docs for TARGETED_DEVICE_FAMILY here:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html
No need to mess around with your app at all: Instruments allows you to select whether to use the iPhone or iPad simulator. Assuming you've already selected your app:
Click the Target selector (currently displaying your app name).
Click "Edit Active Target"
Near the bottom, click the "Options" drop down.
At the bottom of the list, you can select the "Simulator Configuration".
A very easy solution is to modify the Info.plist of your application before launching the automation (no need to rebuild the app). Use PlistBuddy to modify the UIDeviceFamily to be either for iPhone or iPad. For example:
plistbuddy="/usr/libexec/PlistBuddy"
plistfile="$myapp/Info.plist"
if [ $device == "iphone" ]; then
uidevicefamily=1
else
uidevicefamily=2
fi
$plistbuddy -c "Delete :UIDeviceFamily" $plistfile
$plistbuddy -c "Add :UIDeviceFamily array" $plistfile
$plistbuddy -c "Add :UIDeviceFamily:0 integer $uidevicefamily" $plistfile
I was having problems with this as well, which I noticed because no matter which run settings I was using, XCode was displaying Simulator - 3.2, when it should have shown 4.0 or 4.1 for the SDK version on the iPhone simulator.
I was able to fix it by changing the "Target Device Family" setting over to iPhone/iPad, as it somehow was set to just iPad.
Which part of the app is it that "triggers" the iPad app as it's own app as opposed to running the iPhone version in a universal binary?
What do I need to change to make my app Universal, after clicking "Upgrade current Target for iPad"? My app runs on outside of the simulator, but my images are too small and my text is out of place. What am I missing here?
To the opposite end, how do I force my Universal app to run as an iPhone app inside the simulator on the iPad? (When changing "Target Device Family", it will run the iPad version of the app in the simulator, but not the iPhone version.)
EDIT:
It seems to me that these questions kind of complement each other. While I suspect it's the same mechanism at work in both situations, I'm not sure what it is, or how it works.
There are keys in the info.plist file put there by the Targeted Device Family setting. The iPad looks for those plist keys to determine whether to launch as a Universal app or in iPhone emulation mode, and which idiom's xib files to use for app launch.
Added:
If you don't have, and specify in the plist, a .xib file suitable for the iPad idiom, then one with the wrong UIWindow frame is used, which ends up in the upper left corner.
You need to re-code the app for the iPad to lay out your text and images how you want them when it is running on an iPad.
To make it run as an iPhone app you stop it being Universal.
The build setting is called Target Device Family
That's where it starts.
If you wrote a universal app and you want to force the iPhone mode on the iPad you switch Target Device Family to iPhone only and it will ignore everything else.