Hi @lili.zheng2010, I don’t think you will be able to do this as part of a Startup script in the session events as the session props will not be initialised until after the session starts. You will need the session.props.device.type property to determine what your device is.
One way you could possibly do it is to use a startup script on your docked view or the root container that determines which device is being used and then calls system.perspective.closeDock() to hide it if it’s a desktop. The only issue with this is you might see the animation of the docked view being closed as the session loads.
The other way to look at it is to open the docked view if it’s on a ios/android device. You can do this by doing something similar to the above but using the startup script on the main view (used as the startup page) and using openDock(). This provides a nicer animation IMO, as it looks like the dock window animation is part of the loading process. However, this all assumes you will always use the main view on session start.
Note you will not be able to use openDock() or closeDock() in Session Event Scripts as the functions are session scoped but the Event scripts are Gateway scoped.