Could not start com.apple.debugserver? - iphone

I was using the command idevicedebug . First it works well on iPhone 5c with iOS version 7.1 something & then i run it on iPhone 5s i get the following error. Why ?
Could not start com.apple.debugserver!
Please make sure to mount the developer disk image first:
1) Get the iOS version from `ideviceinfo -k ProductVersion`.
2) Find the matching iPhoneOS DeveloperDiskImage.dmg files.
3) Run `ideviceimagemounter` with the above path.
Command which i was using is
idevicedebug run bundleid
Why is it so ? How do i solve it ?

In order to use libimobiledevice tools on a device, first you will need to make sure that it is mounted with a developer image.
There are two ways to do that:
Run any Xcode project on device, it will mount it automatically upon launching the app.
libimobiledevice has multiple tools. One of them is 'ideviceimagemounter', use it to mount the proper ios version developer image on device. The developer image for 7.1 should be in the following path:
Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSup‌​port/7.1/
Hope it helped.

The following steps worked for me:
Step 1: Quit the XCode
Step 2: Reopen XCode
Step 3: Clean and build
Step 4: Run again

Related

Flutter can't connect to iOS simulator

I created first flutter app on Mac.
but I can't build it on iOS simulator.
when I build it;
an iOS simulator will run.
and wait.
vs Code say to me;
-Cannot launch without an active device
-Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds
IDE : vs Code
my Macbook : MacBook Pro 2011 early
macOs version : high Sierra
flutter version : 13.8
xcode version : 9.4
Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above
at the first run bellow command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
and then
sudo xcodebuild -runFirstLaunch
after than run "flutter devices"
now you see ios simulators if running
I have also same issue
follow these instruciton:
Xcode -> Prefrences -> locations -> select your command line tols
Which device do you use as a Simulator? From the docs:
Make sure your simulator is using a 64-bit device (iPhone 5s or later)
by checking the settings in the simulator’s Hardware > Device menu.
Run flutter doctor. Are there any errors?
I have the same problem. Flutter doesn't see any simulators.
Flutter required now Xcode 10.2 minimum. You can't run 10.2 on high sierra, therefore use flatter.
If you have multiple Xcode and don't have Xcode With default name "Xcode", this problem may occur. Try to rename one of xcode to "Xcode"
The major issue is with XCode. To quickly fix the issue, open project on XCode(make sure you choose the /ios path inside your flutter project.) and Open Preferences. On preferences dialog, go to Location and choose a command line tool from given option.
Restart your IDE.
In my case (with VS Code) I just had to quit the simulator app in my dock and select the simulator again.
I had the same problem , also I've been trying to solve it with all these solutions here, I solved it when I I deleted ios folder and wrote flutter create . in the terminal
I had many problems with flutter stable version before,
Try to change it to Dev version

iOS 6 UIAutomation - "an error occured while trying to run the script" [duplicate]

When I try to run a UI Automation script on iOS 5 devices I am getting the following error:
"An error occurred while trying to run the script."
The same script is running perfectly in the simulator or on an iOS 4.3.3 device.
How can I solve this problem?
This should fix this issue:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
On devices you should explicity allow to run UI Automation scripts.
Go to Settings -> Developer
Switch Enable UI Automation to on
After turning the option on, the error went away and everything worked as expected.
I would try closing xcode and starting the automation script without xcode running. I had an issue where the process was attached to xcode, when I attempted to run from instruments, xcode got stuck on a breakpoint/crash and I couldn't proceed.
The solution I'm proposing is run Instruments independent of xcode.
Might be you are having more than one Xcode in your machine either delete others or
Just follow these steps
1 Open Xcode and go to its preferences.
2 Then open Location tab
3 In command line tools select the Xcode version that you are using . it might be possible that this entry is wrong

"Failed to upload *.app on Device " Error in iPhone

I am getting an error while uploading my app on device. It does installs it but not able to upload it.
Also I want to run the instrument tool on device but when I run it shows nothing.
Anyone facing the same issues.
I had this problem after changing around provisioning profiles and app ID's.
What fixed it for me:
Quit XCode
In Terminal.app, navigate to your project directory and execute rm -rf build/
Restart XCode
I also confirm, that I had that issue on Xcode 3.2.5 and iOS 4.2 GM Seed and after adding new provisioning profile.
You do not have to use terminal, you can select *.app from Products Group in 'Groups & Files' pane in Xcode. Then right-click on it, and select 'Reveal in finder'. Then manually delete the build catalogue. And restart Xcode.
Worked for me.
I was getting this issue on an iPhone running 3.0 software, but it was working fine on phones running 3.1. The app used to work on the 3.0 software until we added users to the provisioning for the app - this is the only thing I can think of that might have caused it.
If you're running 3.0 still, try upgrading to 3.1 and see if that fixes it.
I had the same error message in iOS 4.1 but from a different cause: when trying to link to a universal (ARM & X86) static library that was over 10MB. If I link directly to the ARM version of the static library (for iPhones), then it works fine.
Sometimes manual delete of Build folder of your application fails to solve the problem
"Failed to upload the .app on device"
Try
WIndows->organizer->Provisioning profile(in left pane)->refresh it once....
This has solved my problem!

How to install iPhone application in iPhone Simulator

I have a mySample.app file - an iPhone application developed by xcode.
How do I run this (only mySample.app file) application using my xcode?
Please note: this answer is obsolete, the functionality was removed from iOS simulator.
I have just found that you don't need to copy the mobile application bundle to the iPhone Simulator's folder to start it on the simulator, as described in the forum. That way you need to click on the app to get it started, not confortable when you want to do testing and start the app numerous times.
There are undocumented command line parameters for the iOS Simulator, which can be used for such purposes. The one you are looking for is: -SimulateApplication
An example command line starting up YourFavouriteApp:
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication path_to_your_app/YourFavouriteApp.app/YourFavouriteApp
This will start up your application without any installation and works with iOS Simulator 4.2 at least. You cannot reach the home menu, though.
There are other unpublished command line parameters, like switching the SDK. Happy hunting for those...
This thread discusses how to install the binary on the simulator. I've done it and it works: http://forums.macrumors.com/showthread.php?t=547557
From the thread:
Look inside your
~/Library/Application Support/iPhone Simulator/User/Applications/
directory and see what happens inside this directory when you install and run apps using XCode, and also when you delete apps using the Simulator.
You can run the Simulator by itself (without starting XCode).
If you start the Simulator, delete an app, quit the Simulator, put back copies of the files that were deleted from the support directory, and restart the Simulator, the app will reappear in the Simulator. Email those files with instructions about how to copy them into the appropriate support directory.
You can install apps in simulator from Xcode 8.2
From Xcode 8.2,You can install an app (*.app) by dragging any previously built app bundle into the simulator window.
Note: You cannot install apps from the App Store in simulation environments.
If you're looking to do this XCode 5+, I found this is the easiest method:
Install ios-sim:
npm install -g ios-sim
Then simply execute:
ios-sim launch ./mySample.app --devicetypeid com.apple.CoreSimulator.SimDeviceType.iPhone-6
In which you can switch up your device type. Simple, fast, and it actually works.
From Xcode v4.3, it is being installed as application.
The simulator is available at
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS\
Simulator.app/
Enter the following in the terminal:
$/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication path/to/your/file/projectname.app/projectname
I see you have a problem. Try building your app as Release and then check out your source codes build folder. It may be called Release-iphonesimulator. Inside here will be the app. Then go to (home folder)/Library/Application Support/iPhone Simulator (if you can't find it, try pressing Command - J and choosing arrange by name). Go to an OS that has apps in it in the iPhone sim, like 4.1. In that folder there should be an Applications folder. Open that, and there should be folders with random lettering. Pick any one, and replace it with the app you have. Make sure to delete anything in the little folders!
If it doesn't work, then I'm dumbfounded.
Select the platform to be iPhone Simulator then click Build and Go. If it builds correctly then it will launch the simulator and run. If it does not build ok then it will indicate errors at the bottom of the window on the right hand side.
If you only have the app file then you would need to manually install that into the simulator. The simulator was not designed to be used this way, but I'm sure it would be possible, even if it was incredibly difficult.
If you have the source code (.proj .m .h etc) files then it should be a simple case of build and go.
This worked for me on iOS 5.0 simulator.
Run the app on the simulator.
Go to the path where you can see something like this:
/Users/arshad/Library/Application\ Support/iPhone\ Simulator/5.0/Applications/34BC3FDC-7398-42D4-9114-D5FEFC737512/…
Copy all the package contents including the app, lib, temp and Documents.
Clear all the applications installed on the simulator so that it is easier to see what is happening.
Run a pre-existing app you have on your simulator.
Look for the same package content for that application as in step 3 and delete all.
Paste the package contents that you have previously copied.
Close the simulator and start it again. The new app icon of the intended app will replace the old one.
The Short Answer
For those who can't wait, the following command installs an iOS app bundle to the specified simulator.
xcrun simctl install 2A3F00EE-F412-4999-8109-ED3D4E70D266 ./YOURAPP.app
The Long Version
The full story is in this Quip doc.
xcrun
Apple has a command-line tool called xcrun that looks for the named command-line tool in the active developer directory and runs it. We will use xcrun simctl in this article.
Active Developer Directory
A user of macOS could install more than one version of Xcode and use the xcode-select command to choose which one to use. Each Xcode bundle that has been installed has a folder called Developer. The following command shows the developer directory that is currently being used.
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
List Simulator Types
The xcrun simctl list devicetypes command shows all of the simulator types that are installed on the macOS system. Think of simulators as virtual machines (VMs). Each type is like a VM specification.
$ xcrun simctl list devicetypes
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
...
iPhone 12 (com.apple.CoreSimulator.SimDeviceType.iPhone-12)
...
Create a Simulator
The following command creates a simulator named yi-iphone12-sim that is of the type com.apple.CoreSimulator.SimDeviceType.iPhone-12, as shown above.
$ xcrun simctl create yi-phone12-sim com.apple.CoreSimulator.SimDeviceType.iPhone-12
No runtime specified, using 'iOS 16.2 (16.2 - 20C52) - com.apple.CoreSimulator.SimRuntime.iOS-16-2'
2A3F00EE-F412-4999-8109-ED3D4E70D266
It prints the ID of the new simulator.
List Created Simulators
The following commands lists simulators.
$ xcrun simctl list devices
== Devices ==
-- iOS 16.2 --
yi-phone12-sim (2A3F00EE-F412-4999-8109-ED3D4E70D266) (Shutdown)
We can see that it lists the simulator yi-iphone12-sim, and its status is Shutdown.
Boot a Simulator
The following command boots the simulator yi-iphone12-sim.
$ xcrun simctl boot 2A3F00EE-F412-4999-8109-ED3D4E70D266
Please note that we can't use the name yi-iphone12-sim. Instead, we'll use the ID.
After the home screen is shown on the simulator window, the xcrun simctl list devices command shows that the simulator is Booted.
$ xcrun simctl list devices
== Devices ==
-- iOS 16.2 --
yi-phone12-sim (2A3F00EE-F412-4999-8109-ED3D4E70D266) (Booted)
Install an App to the Simulator
I checked out this project at https://github.com/sheldonth/ios-cmake/tree/master and built it with CMake. The result is an iOS bundle called ./build.sim64/Release-iphonesimulator/YOURAPP.app.
This app will be installed on the simulator with the following command.
xcrun simctl install 2A3F00EE-F412-4999-8109-ED3D4E70D266 build.sim64/Release-iphonesimulator/YOURAPP.app

How do I automatically run my iphone app after building it?

I'm using google unit testing code.
I'm building it quite nicely with xcodebuild on the command line. Now I want to run it (preferably on attached Device but simulator would also work) and catch all the feedback from the tests.
But I can't find out how to run it. Any ideas?
Jeff Haynie's iphonesim project on Github looks like it could work. I had trouble building 27812bb4b (make failed on a warning in nsprintf.m), but that may just be me using a pre-release OS and SDK. See also this related question.
If you followed the instructions from the Google page (creating the target, adding the test files to the target) and you have an iPhone SDK certificate (you need it to upload apps to the device) you can just change the Active SDK to your device (upper left corner combo in XCode)
If you don't have a certificate, you need to apply to the SDK program.
The only iPhone simulator and debugger I'm aware of comes with the iPhone SDK. In order to use the iPhone SDK you need to have an Intel-based mac with OS 10.5 Leopard installed, in which case you might as well be programming/compiling in XCode instead of using the command line.
There has to be some misunderstanding here. What exactly do you want to run from the command line? The test suite? If so, the test suite should be a separate target, so that all you have to do is build it, for example like this:
xcodebuild -target UnitTests -sdk iphonesimulator2.2.1 -configuration Debug
If you have the testing target configured correctly, it will run the RunIPhoneUnitTest.sh shipped with the Google Toolbox and the script will run all your tests.