dmayer / idb

idb is a tool to simplify some common tasks for iOS pentesting and research
MIT License
942 stars 156 forks source link

Cannot launch/connect to simulator #59

Closed aemaeth2501 closed 7 years ago

aemaeth2501 commented 9 years ago

Hi,

I installed idb using the bundle methodology. It does launch perfectly (aside from the top bar bug) but I am not able to connect to a simulator. Is this normal behavior ? Looking at the code, available simulator should appear right after Device menu, which is not the case.

Can you give me a lead ?

ejohn20 commented 9 years ago

Similar issue here connecting to a simulator. I'm running a 10.10.4 VM through VMware Fusion that has XCode and the simulator installed. When launching the app and selecting the device menu, I'm not seeing any simulators listed. Screenshot attached.

Is there a specific location that it's using to look for simulators? Other ideas?

screen shot 2015-11-24 at 7 43 06 pm

ejohn20 commented 9 years ago

FYI - I think I may have identified what the issue is. The simulator.rb file appears to be looking in this directory:

def self.get_simulators basedir = ENV['HOME'] + '/Library/Application Support/iPhone Simulator'

As of XCode 6+, the simulator location has changed to ~/Library/Developer/CoreSimulator/Devices/. Unfortunately, the directory is not as easy to read now. Each simulator has a UUID for the name, and a device.plist file inside the directory that indicates which version the simulator belongs to:

<?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">

UDID A8339E2B-67DF-44F1-99FF-421BC24B67F4 deviceType com.apple.CoreSimulator.SimDeviceType.iPhone-4s name iPhone 4s runtime com.apple.CoreSimulator.SimRuntime.iOS-8-4 state 1

Once you browse into the UUID/data directory, the structure of the simulator appears to be similar. Containers, Documents, Library, Media, Root, tmp, var directories. However, it is missing the "Applications" directory.

Instead, the Application appear to be installed into this directory: ./data/Containers/Bundle/Application but data for the application seems to be in a different location: ./data/Containers/Data/Application/UUID which has the Documents, Lib, tmp dirs for the application.

Based on this, it appears this is more inline with how data is stored on the iOS device itself. But, I'll let you tell me if this is correct or not.

If so, is this fix as easy as looking in the new location (~/Library/Developer/CoreSimulator/Devices/) and parsing the simulator from the .plist file in each directory. Then, on selection browsing into the UUID/data directory?

martinvigo commented 8 years ago

+1 It would be great to be able to use the simulator

dmayer commented 7 years ago

I currently have no plans on maintaining the simulator feature. Several idb features won't work with it unfortunately. If someone wants to take a stab at it, please feel free to do so.